STM32303C_EVAL BSP User Manual: STM32303C_EVAL_EEPROM_Private_Functions

STM32303C EVAL BSP Drivers

STM32303C_EVAL BSP User Manual
STM32303C_EVAL_EEPROM_Private_Functions

Functions

static uint32_t EEPROM_I2C_Init (void)
 Initializes peripherals used by the I2C EEPROM driver.
static uint32_t EEPROM_I2C_ReadBuffer (uint8_t *pBuffer, uint16_t ReadAddr, uint32_t *NumByteToRead)
 Reads a block of data from the I2C EEPROM.
static uint32_t EEPROM_I2C_WritePage (uint8_t *pBuffer, uint16_t WriteAddr, uint32_t *NumByteToWrite)
 Writes more than one byte to the EEPROM with a single WRITE cycle.
static uint32_t EEPROM_I2C_WaitEepromStandbyState (void)
 Wait for EEPROM I2C Standby state.
static uint32_t EEPROM_SPI_Init (void)
 Initializes peripherals used by the SPI EEPROM driver.
static uint32_t EEPROM_SPI_ReadBuffer (uint8_t *pBuffer, uint16_t ReadAddr, uint32_t *NumByteToRead)
 Reads a block of data from the SPI EEPROM.
static uint32_t EEPROM_SPI_WritePage (uint8_t *pBuffer, uint16_t WriteAddr, uint32_t *NumByteToWrite)
 Writes more than one byte to the EEPROM with a single WRITE cycle.
static uint32_t EEPROM_SPI_WaitEepromStandbyState (void)
 Wait for EEPROM SPI Standby state.

Function Documentation

static uint32_t EEPROM_I2C_Init ( void  ) [static]

Initializes peripherals used by the I2C EEPROM driver.

Note:
There are 2 different versions of M24LR64 (A01 & A02). Then try to connect on 1st one (EEPROM_I2C_ADDRESS_A01) and if problem, check the 2nd one (EEPROM_I2C_ADDRESS_A02)
Return values:
EEPROM_OK(0) if operation is correctly performed, else return value different from EEPROM_OK (0)

Definition at line 445 of file stm32303c_eval_eeprom.c.

References EEPROM_ADDRESS_M24LR64_A01, EEPROM_ADDRESS_M24LR64_A02, EEPROM_ADDRESS_M24M01, EEPROM_FAIL, EEPROM_I2C_IO_Init(), EEPROM_I2C_IO_IsDeviceReady(), EEPROM_MAX_TRIALS, EEPROM_OK, EEPROM_PAGESIZE_M24LR64, EEPROM_PAGESIZE_M24M01, EEPROMAddress, and EEPROMPageSize.

static uint32_t EEPROM_I2C_ReadBuffer ( uint8_t *  pBuffer,
uint16_t  ReadAddr,
uint32_t *  NumByteToRead 
) [static]

Reads a block of data from the I2C EEPROM.

Parameters:
pBufferpointer to the buffer that receives the data read from the EEPROM.
ReadAddrEEPROM's internal address to start reading from.
NumByteToReadpointer to the variable holding number of bytes to be read from the EEPROM.
Return values:
EEPROM_OK(0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 483 of file stm32303c_eval_eeprom.c.

References EEPROM_FAIL, EEPROM_I2C_IO_ReadData(), EEPROM_OK, and EEPROMAddress.

static uint32_t EEPROM_I2C_WaitEepromStandbyState ( void  ) [static]

Wait for EEPROM I2C Standby state.

Note:
This function allows to wait and check that EEPROM has finished the last operation. It is mostly used after Write operation: after receiving the buffer to be written, the EEPROM may need additional time to actually perform the write operation. During this time, it doesn't answer to I2C packets addressed to it. Once the write operation is complete the EEPROM responds to its address.
Return values:
EEPROM_OK(0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 551 of file stm32303c_eval_eeprom.c.

References BSP_EEPROM_TIMEOUT_UserCallback(), EEPROM_I2C_IO_IsDeviceReady(), EEPROM_MAX_TRIALS, EEPROM_OK, EEPROM_TIMEOUT, and EEPROMAddress.

Referenced by EEPROM_I2C_WritePage().

static uint32_t EEPROM_I2C_WritePage ( uint8_t *  pBuffer,
uint16_t  WriteAddr,
uint32_t *  NumByteToWrite 
) [static]

Writes more than one byte to the EEPROM with a single WRITE cycle.

Note:
The number of bytes (combined to write start address) must not cross the EEPROM page boundary. This function can only write into the boundaries of an EEPROM page. This function doesn't check on boundaries condition (in this driver the function BSP_EEPROM_WriteBuffer() which calls EEPROM_WritePage() is responsible of checking on Page boundaries).
Parameters:
pBufferpointer to the buffer containing the data to be written to the EEPROM.
WriteAddrEEPROM's internal address to write to.
NumByteToWritepointer to the variable holding number of bytes to be written into the EEPROM.
Note:
The variable pointed by NumByteToWrite is reset to 0 when all the data are written to the EEPROM. Application should monitor this variable in order know when the transfer is complete.
Return values:
EEPROM_OK(0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 520 of file stm32303c_eval_eeprom.c.

References EEPROM_FAIL, EEPROM_I2C_IO_WriteData(), EEPROM_I2C_WaitEepromStandbyState(), EEPROM_OK, and EEPROMAddress.

static uint32_t EEPROM_SPI_Init ( void  ) [static]

Initializes peripherals used by the SPI EEPROM driver.

Return values:
EEPROM_OK(0) if operation is correctly performed, else return value different from EEPROM_OK (0)

Definition at line 568 of file stm32303c_eval_eeprom.c.

References EEPROM_FAIL, EEPROM_OK, EEPROM_PAGESIZE_M95M01, EEPROM_SPI_IO_Init(), EEPROM_SPI_WaitEepromStandbyState(), and EEPROMPageSize.

static uint32_t EEPROM_SPI_ReadBuffer ( uint8_t *  pBuffer,
uint16_t  ReadAddr,
uint32_t *  NumByteToRead 
) [static]

Reads a block of data from the SPI EEPROM.

Parameters:
pBufferpointer to the buffer that receives the data read from the EEPROM.
ReadAddrEEPROM's internal address to start reading from.
NumByteToReadpointer to the variable holding number of bytes to be read from the EEPROM.
Note:
The variable pointed by NumByteToRead is reset to 0 when all the data are read from the EEPROM. Application should monitor this variable in order know when the transfer is complete.
Return values:
EEPROM_OK(0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 596 of file stm32303c_eval_eeprom.c.

References EEPROM_FAIL, EEPROM_OK, EEPROM_SPI_IO_ReadData(), and EEPROM_SPI_WaitEepromStandbyState().

static uint32_t EEPROM_SPI_WaitEepromStandbyState ( void  ) [static]

Wait for EEPROM SPI Standby state.

Note:
This function allows to wait and check that EEPROM has finished the last operation. It is mostly used after Write operation.
Return values:
EEPROM_OK(0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 661 of file stm32303c_eval_eeprom.c.

References BSP_EEPROM_TIMEOUT_UserCallback(), EEPROM_OK, EEPROM_SPI_IO_WaitEepromStandbyState(), and EEPROM_TIMEOUT.

Referenced by EEPROM_SPI_Init(), EEPROM_SPI_ReadBuffer(), and EEPROM_SPI_WritePage().

static uint32_t EEPROM_SPI_WritePage ( uint8_t *  pBuffer,
uint16_t  WriteAddr,
uint32_t *  NumByteToWrite 
) [static]

Writes more than one byte to the EEPROM with a single WRITE cycle.

Note:
The number of bytes (combined to write start address) must not cross the EEPROM page boundary. This function can only write into the boundaries of an EEPROM page. This function doesn't check on boundaries condition (in this driver the function BSP_EEPROM_WriteBuffer() which calls EEPROM_WritePage() is responsible of checking on Page boundaries).
Parameters:
pBufferpointer to the buffer containing the data to be written to the EEPROM.
WriteAddrEEPROM's internal address to write to.
NumByteToWritepointer to the variable holding number of bytes to be written into the EEPROM.
Note:
The variable pointed by NumByteToWrite is reset to 0 when all the data are written to the EEPROM. Application should monitor this variable in order know when the transfer is complete.
Return values:
EEPROM_OK(0) if operation is correctly performed, else return value different from EEPROM_OK (0) or the timeout user callback.

Definition at line 634 of file stm32303c_eval_eeprom.c.

References EEPROM_FAIL, EEPROM_OK, EEPROM_SPI_IO_WriteData(), and EEPROM_SPI_WaitEepromStandbyState().

Generated on Wed May 31 2017 10:00:44 for STM32303C_EVAL BSP User Manual by   doxygen 1.7.6.1