Cell voltages fork (SoC)
Dependencies: CUER_CAN CUER_DS1820 LTC2943 LTC6804 mbed PowerControl
EEPROM_I2C.h@66:c884fba9eaea, 2017-09-16 (annotated)
- Committer:
- DasSidG
- Date:
- Sat Sep 16 01:10:01 2017 +0000
- Revision:
- 66:c884fba9eaea
- Parent:
- 1:51477fe4851b
Added more flags to the BMU status; Removed some unused functions, re-ordered some functions slightly; Tidied up some bits that were generating warnings
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lcockerton62 | 0:0a5f554d2a16 | 1 | #include "mbed.h" |
lcockerton62 | 0:0a5f554d2a16 | 2 | |
lcockerton62 | 0:0a5f554d2a16 | 3 | #ifndef EEPROM_I2C_H |
lcockerton62 | 0:0a5f554d2a16 | 4 | #define EEPROM_I2C_H |
lcockerton62 | 0:0a5f554d2a16 | 5 | |
lcockerton62 | 0:0a5f554d2a16 | 6 | #define I2C_DATA p9 |
lcockerton62 | 0:0a5f554d2a16 | 7 | #define I2C_CLOCK p10 |
lcockerton62 | 0:0a5f554d2a16 | 8 | #define ADDRESS_1 0xAF |
lcockerton62 | 0:0a5f554d2a16 | 9 | #define ADDRESS_2 0xAE // TODO check did both addresses work |
lcockerton62 | 0:0a5f554d2a16 | 10 | |
lcockerton62 | 1:51477fe4851b | 11 | /** |
lcockerton62 | 1:51477fe4851b | 12 | * Method for writing one byte to the EEPROM |
lcockerton62 | 1:51477fe4851b | 13 | * |
lcockerton62 | 1:51477fe4851b | 14 | * @param start_address the start address on the EEPROM to read from |
lcockerton62 | 1:51477fe4851b | 15 | * @param data_out data to send |
lcockerton62 | 1:51477fe4851b | 16 | */ |
lcockerton62 | 1:51477fe4851b | 17 | /* Dont think this will be used |
lcockerton62 | 0:0a5f554d2a16 | 18 | void i2c_write(int start_address,char data_out); |
lcockerton62 | 1:51477fe4851b | 19 | */ |
lcockerton62 | 1:51477fe4851b | 20 | /** |
lcockerton62 | 1:51477fe4851b | 21 | * Method for reading from the EEPROM |
lcockerton62 | 1:51477fe4851b | 22 | * |
lcockerton62 | 1:51477fe4851b | 23 | * @param start_address the start address on the EEPROM to read from |
lcockerton62 | 1:51477fe4851b | 24 | * |
lcockerton62 | 1:51477fe4851b | 25 | */ |
lcockerton62 | 1:51477fe4851b | 26 | /*Dont think this will be used |
lcockerton62 | 0:0a5f554d2a16 | 27 | char i2c_read(int start_address); |
lcockerton62 | 1:51477fe4851b | 28 | */ |
lcockerton62 | 1:51477fe4851b | 29 | /** |
lcockerton62 | 1:51477fe4851b | 30 | * Method for page writing to the EEPROM |
lcockerton62 | 1:51477fe4851b | 31 | * |
lcockerton62 | 1:51477fe4851b | 32 | * @param start_address the start address on the EEPROM to write to |
lcockerton62 | 1:51477fe4851b | 33 | * @param length the length of data_out |
lcockerton62 | 1:51477fe4851b | 34 | * @param data_out data to send |
lcockerton62 | 1:51477fe4851b | 35 | * |
lcockerton62 | 1:51477fe4851b | 36 | */ |
lcockerton62 | 1:51477fe4851b | 37 | void i2c_page_write(uint16_t start_address,int length, char data_out[] ); |
lcockerton62 | 0:0a5f554d2a16 | 38 | |
lcockerton62 | 1:51477fe4851b | 39 | /** |
lcockerton62 | 1:51477fe4851b | 40 | * Method for page reading from the EEPROM |
lcockerton62 | 1:51477fe4851b | 41 | * |
lcockerton62 | 1:51477fe4851b | 42 | * @param start_address the start address on the EEPROM to read from |
lcockerton62 | 1:51477fe4851b | 43 | * @param length the length of data_in |
lcockerton62 | 1:51477fe4851b | 44 | * @param data_in data to read |
lcockerton62 | 1:51477fe4851b | 45 | * |
lcockerton62 | 1:51477fe4851b | 46 | */ |
lcockerton62 | 1:51477fe4851b | 47 | void i2c_page_read(uint16_t start_address,int length, char data_in[]); |
lcockerton62 | 0:0a5f554d2a16 | 48 | |
lcockerton62 | 0:0a5f554d2a16 | 49 | #endif |