STM32373C_EVAL BSP User Manual: Exported Functions

STM32373C EVAL BSP Drivers

STM32373C_EVAL BSP User Manual

Functions

uint32_t BSP_EEPROM_Init (void)
 Initializes peripherals used by the I2C EEPROM driver.
uint32_t BSP_EEPROM_ReadBuffer (uint8_t *pBuffer, uint16_t ReadAddr, uint32_t *NumByteToRead)
 Reads a block of data from the EEPROM.
uint32_t BSP_EEPROM_WriteBuffer (uint8_t *pBuffer, uint16_t WriteAddr, uint32_t NumByteToWrite)
 Writes buffer of data to the I2C EEPROM.
uint32_t BSP_EEPROM_WaitEepromStandbyState (void)
 Wait for EEPROM Standby state.
__weak void BSP_EEPROM_TIMEOUT_UserCallback (void)
 Basic management of the timeout situation.
void EEPROM_IO_Init (void)
 Initializes peripherals used by the I2C EEPROM driver.
uint32_t EEPROM_IO_WriteData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
 Write data to I2C EEPROM driver.
uint32_t EEPROM_IO_ReadData (uint16_t DevAddress, uint16_t MemAddress, uint8_t *pBuffer, uint32_t BufferSize)
 Read data from I2C EEPROM driver.
HAL_StatusTypeDef EEPROM_IO_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
 Checks if target device is ready for communication.

Function Documentation

uint32_t BSP_EEPROM_Init ( void  )

Initializes peripherals used by the I2C EEPROM driver.

Note:
There are 2 different versions of EEPROM (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 163 of file stm32373c_eval_eeprom.c.

References EEPROM_ADDRESS_M24LR64_A01, EEPROM_ADDRESS_M24LR64_A02, EEPROM_ADDRESS_M24M01_A01, EEPROM_ADDRESS_M24M01_A02, EEPROM_FAIL, EEPROM_IO_Init(), EEPROM_IO_IsDeviceReady(), EEPROM_MAX_TRIALS, EEPROM_OK, EEPROM_PAGESIZE_M24LR64, EEPROM_PAGESIZE_M24M01, EEPROMAddress, and EEPROMPageSize.

uint32_t BSP_EEPROM_ReadBuffer ( uint8_t *  pBuffer,
uint16_t  ReadAddr,
uint32_t *  NumByteToRead 
)

Reads a block of data from the 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 209 of file stm32373c_eval_eeprom.c.

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

Basic management of the timeout situation.

Return values:
None.

Definition at line 450 of file stm32373c_eval_eeprom.c.

Referenced by BSP_EEPROM_WaitEepromStandbyState().

uint32_t BSP_EEPROM_WaitEepromStandbyState ( void  )

Wait for EEPROM 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 434 of file stm32373c_eval_eeprom.c.

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

Referenced by EEPROM_WritePage().

uint32_t BSP_EEPROM_WriteBuffer ( uint8_t *  pBuffer,
uint16_t  WriteAddr,
uint32_t  NumByteToWrite 
)

Writes buffer of data to the I2C EEPROM.

Parameters:
pBufferpointer to the buffer containing the data to be written to the EEPROM.
WriteAddrEEPROM's internal address to write to.
NumByteToWritenumber of bytes to write to 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.

< If WriteAddr is EEPROM_PAGESIZE aligned

< If NumByteToWrite < EEPROM_PAGESIZE

< If NumByteToWrite < EEPROM_PAGESIZE

< If the number of data to be written is more than the remaining space in the current page:

< Write the data contained in same page

< Write the remaining data in the following page

Definition at line 277 of file stm32373c_eval_eeprom.c.

References EEPROM_OK, EEPROM_WritePage(), and EEPROMPageSize.

void EEPROM_IO_Init ( void  )

Initializes peripherals used by the I2C EEPROM driver.

Return values:
None

Definition at line 1255 of file stm32373c_eval.c.

References I2C2_Init().

Referenced by BSP_EEPROM_Init().

HAL_StatusTypeDef EEPROM_IO_IsDeviceReady ( uint16_t  DevAddress,
uint32_t  Trials 
)

Checks if target device is ready for communication.

Note:
This function is used with Memory devices
Parameters:
DevAddressTarget device address
TrialsNumber of trials
Return values:
HALstatus

Definition at line 1293 of file stm32373c_eval.c.

References I2C2_IsDeviceReady().

Referenced by BSP_EEPROM_Init(), and BSP_EEPROM_WaitEepromStandbyState().

uint32_t EEPROM_IO_ReadData ( uint16_t  DevAddress,
uint16_t  MemAddress,
uint8_t *  pBuffer,
uint32_t  BufferSize 
)

Read data from I2C EEPROM driver.

Parameters:
DevAddressTarget device address
MemAddressInternal memory address
pBufferPointer to data buffer
BufferSizeAmount of data to be read
Return values:
HALstatus

Definition at line 1281 of file stm32373c_eval.c.

References I2C2_ReadBuffer().

Referenced by BSP_EEPROM_ReadBuffer().

uint32_t EEPROM_IO_WriteData ( uint16_t  DevAddress,
uint16_t  MemAddress,
uint8_t *  pBuffer,
uint32_t  BufferSize 
)

Write data to I2C EEPROM driver.

Parameters:
DevAddressTarget device address
MemAddressInternal memory address
pBufferPointer to data buffer
BufferSizeAmount of data to be sent
Return values:
HALstatus

Definition at line 1268 of file stm32373c_eval.c.

References I2C2_WriteBuffer().

Referenced by EEPROM_WritePage().

Generated on Wed May 31 2017 11:20:45 for STM32373C_EVAL BSP User Manual by   doxygen 1.7.6.1