77 #include <stm32f4xx.h>
108 uint8_t startAddress) {
110 uint8_t charstoWrite;
117 if ((startAddress + nbrOfChar) > 0x07FF) {
122 charstoWrite = startAddress % 8;
123 if (charstoWrite > 0) {
124 charstoWrite = 8 - charstoWrite;
126 startAddress, 1, (uint8_t *) data, charstoWrite);
129 for (i = 0; i < timeout; i++)
132 nbrOfChar -= charstoWrite;
133 data += charstoWrite;
134 startAddress += charstoWrite;
137 while (nbrOfChar > 0) {
142 charstoWrite = nbrOfChar;
146 startAddress, 1, (uint8_t *) data, charstoWrite);
149 for (i = 0; i < timeout; i++)
152 nbrOfChar -= charstoWrite;
153 data += charstoWrite;
154 startAddress += charstoWrite;
176 uint8_t startAddress) {
178 if ((startAddress + nbrOfChar) > 0x07FF) {
183 startAddress, 1, (uint8_t *) recdata, nbrOfChar)) {
uint8_t ERROR_CODES
Error variable.
ERROR_CODES CARME_EEPROM_Write(uint8_t *data, uint8_t nbrOfChar, uint8_t startAddress)
Write an Array of 8-bit data to the Eeprom This Function can take several ms to perfrom. 5ms are needed for a Pagewrite (8 Byte).
#define CARME_EEPROM_I2C_ADDRESS
EEPROM board support package for the CARME module.
ERROR_CODES CARME_I2C_Read(I2C_TypeDef *I2Cx, uint8_t addr, uint16_t reg, uint8_t twoByte, uint8_t *pdata, uint16_t count)
Read data from an I2C slave device on a specific register address.
#define CARME_ERROR_EEPROM_BUSY
The EEPROM is busy at the moment.
#define CARME_ERROR_EEPROM_OVERFLOW
The end of the address range will be reached 0x07FF.
ERROR_CODES CARME_I2C_Write(I2C_TypeDef *I2Cx, uint8_t addr, uint16_t reg, uint8_t twoByte, uint8_t *pdata, uint16_t count)
Write data to an I2C slave device on a specific register address.
ERROR_CODES CARME_EEPROM_Read(uint8_t *recdata, uint8_t nbrOfChar, uint8_t startAddress)
Read an Array of char to the Eeprom.
I2C board support package for the CARME module.