Revision 7394be9e
include/bq27500/v1/alld_bq27500_v1.h | ||
---|---|---|
36 | 36 |
/******************************************************************************/ |
37 | 37 |
|
38 | 38 |
/** |
39 |
* @brief Hardware version number. |
|
40 |
* @details There are three different revisions of the bq27500 fuel gauge: |
|
41 |
* 100, 120, and 130. |
|
42 |
* If no version is set, it defaults to 100. |
|
43 |
*/ |
|
44 |
#if !defined(BQ27500_LLD_HWVERSION) |
|
45 |
#define BQ27500_LLD_HWVERSION 100 |
|
46 |
#endif |
|
47 |
|
|
48 |
/* hardware version santity checks */ |
|
49 |
#if (BQ27500_LLD_HWVERSION != 100) && (BQ27500_LLD_HWVERSION != 120) && (BQ27500_LLD_HWVERSION != 130) |
|
50 |
#error "Invalid hardware version selected" |
|
51 |
#endif |
|
52 |
|
|
53 |
/** |
|
39 | 54 |
* @brief fixed I2C address |
40 | 55 |
*/ |
41 | 56 |
#define BQ27500_LLD_I2C_ADDR 0x55u |
... | ... | |
43 | 58 |
/** |
44 | 59 |
* @brief maximum I2C frequency in Hz |
45 | 60 |
*/ |
46 |
#if defined(BQ27500_LLD_HWVERSION) |
|
47 |
#if (BQ27500_LLD_HWVERSION == 120) |
|
48 |
#define BQ27500_LLD_I2C_MAXFREQUENCY 100000 |
|
49 |
#elif (BQ27500_LLD_HWVERSION == 130) |
|
50 |
#define BQ27500_LLD_I2C_MAXFREQUENCY 400000 |
|
51 |
#endif |
|
52 |
#else |
|
53 |
#define BQ27500_LLD_I2C_MAXFREQUENCY 100000 |
|
61 |
#if (BQ27500_LLD_HWVERSION == 100) |
|
62 |
#define BQ27500_LLD_I2C_MAXFREQUENCY 100000 |
|
63 |
#elif (BQ27500_LLD_HWVERSION == 120) |
|
64 |
#define BQ27500_LLD_I2C_MAXFREQUENCY 400000 |
|
65 |
#elif (BQ27500_LLD_HWVERSION == 130) |
|
66 |
#define BQ27500_LLD_I2C_MAXFREQUENCY 400000 |
|
54 | 67 |
#endif |
55 | 68 |
|
56 | 69 |
/** |
Also available in: Unified diff