| 1234567891011121314151617181920212223242526272829 |
- #include "i2c_target.h"
- #include "battery.h"
- /*
- - command: as defined in the Wiki for Pi 0x01, 0x02, 0x03, refer to i2c_target.h file
- - slot_id: battery slot numner from 0 to NUM_SLOTS-1
- - data: pointer to SET battery limits
- - len: length of the data
- */
- void ProcessI2CCommand(uint8_t command, uint8_t slot_id, uint8_t *data, uint8_t len) {
- switch(command) {
- case CMD_GET_BATTERY_STATUS:
- // Transmit the battery state for the given slot
-
-
- case CMD_GET_BATTERY_DATA: {
- // Create a data message and transmit it
-
- }
-
- case CMD_SET_BATTERY_LIMIT: {
-
-
- }
- }
- }
|