Project

General

Profile

Revision 335

Added by James Kong over 16 years ago

Rewrote bom.c and bom.h for the new analog8 code and for compatibility with bom 1.5 and
rbom. BOM values are now buffered and updating them will require a call to bom_refresh.
Old bom function calls have been left for backwards compatibility, but are now
deprecated. See comments for appropriate use. BOM 1.5 and rbom sections have not been
implemented yet.

Fixed some analog bugs. Made some analog functions static.

May not compile! Not tested!

View differences:

bom.h
42 42
 * @addtogroup bom
43 43
 * @{
44 44
 **/
45
 
46
/** @brief Include all elements in the 16-bit bitfield **/
47
#define BOM_ALL 0xFFFF
48
/** @brief Original BOM - No Range, No Individual LED control **/
49
#define BOM     0
50
/** @brief BOM 1.5 - No Range, Individual LED control **/
51
#define BOM15   1
52
/** @brief RBOM - Range, Individual LED control **/
53
#define RBOM    2
54
 
55
/** @brief Initialize the bom according to bom type **/
56
void bom_init(char type);
57
/** @brief Refresh bom_val[] with new values from analog8.  analog_init and bom_init must be called for this to work. **/
58
void bom_refresh(int bit_field);
59
/** @brief Gets the bom reading from bom_val[which].  Call bom_refresh beforehand to read new bom values. **/
60
int bom_get(char which);
61
/** @brief Compares all the values in bom_val[] and returns the index to the highest value element. **/
62
int bom_get_max(void);
63
/** @brief Turns on the selected bom leds. Only works with BOM_ALL if using the original bom. **/
64
void bom_leds_on(int bit_field);
65
/** @brief Turns off the selected bom leds. Only works with BOM_ALL if using the original bom. **/
66
void bom_leds_off(int bit_field);
45 67

  
46
/** @brief Returns the location of the maximum BOM reading. **/
47
int get_max_bom( void );
48
/** @brief Turns the BOM on. **/
68
/** @brief (DEPRECATED) Gets and compares all bom values.  Returns the index to the highest value element. **/
69
int get_max_bom(void);
70
/** @brief (DEPRECATED) Turns on all bom leds. **/
49 71
void bom_on(void);
50
/** @brief Turns the BOM off. **/
72
/** @brief (DEPRECATED) Turns off all bom leds. **/
51 73
void bom_off(void);
52 74

  
53 75
/** @} **/

Also available in: Unified diff