| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- #include <stdint.h>
- #include <stdbool.h>
- #ifndef CONFIG_H_
- #define CONFIG_H_
- #define I2C_TX_MAX_PACKET_SIZE (8)
- #define I2C_RX_MAX_PACKET_SIZE (12)
- #define BATTERY_THRESHOLD (20)
- #define TEMPERATURE_MAX_C (60)
- #define MAX_CYCLES (2)
- #define TARGET_BASE_ADDRESS (0x48)
- #define MEASUREMENT_CHECK_INTERVAL 320000 //Do not know yet the exact timing
- #define HEALTHY_BATTERY_VALUE (3800)
- // soft overvoltage treshold before getting into the soft overvoltage state
- #define SOV_THRESHOLD_MV 6000
- // hard overvoltage treshold for getting into the hard overvoltage state (error)
- #define HOV_THRESHOLD_MV 8000
- // define the temperature error state
- #define OVERTEMPERATURE_TRESHOLD 43
- #define CONTROLLER_HYSTERESIS 5
- typedef struct{
- uint8_t txBuffer[I2C_TX_MAX_PACKET_SIZE];
- uint8_t txLen;
- uint8_t txCount;
- bool txComplete;
- }tx_Packet;
- typedef struct{
- uint8_t rxBuffer[I2C_RX_MAX_PACKET_SIZE];
- uint8_t rxLen;
- uint8_t rxCount;
- bool rxComplete;
- }rx_Packet;
- // Global variables declared in i2c_hal.c
- extern tx_Packet txPacket;
- extern rx_Packet rxPacket;
- #endif
|