STM32072B_EVAL BSP User Manual: BUS Operations Functions

STM32072B EVAL BSP Drivers

STM32072B_EVAL BSP User Manual
BUS Operations Functions

Functions

static void I2C1_Init (void)
 I2C Bus initialization.
static void I2C1_Error (void)
 Manages error callback by re-initializing I2C.
static void I2C1_MspInit (I2C_HandleTypeDef *hi2c)
 I2C MSP Initialization.
static HAL_StatusTypeDef I2C1_WriteBuffer (uint16_t Addr, uint8_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
 Write a value in a register of the device through BUS.
static HAL_StatusTypeDef I2C1_ReadBuffer (uint16_t Addr, uint8_t Reg, uint16_t RegSize, uint8_t *pBuffer, uint16_t Length)
 Reads multiple data on the BUS.
static HAL_StatusTypeDef I2C1_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
 Checks if target device is ready for communication.
static HAL_StatusTypeDef I2C1_TransmitData (uint8_t *pBuffer, uint16_t Length)
 Write buffer through I2C.
static void I2C2_Init (void)
 I2C Bus initialization.
static void I2C2_Error (void)
 Discovery I2C2 error treatment function.
static void I2C2_MspInit (I2C_HandleTypeDef *hi2c)
 I2C MSP Initialization.
static HAL_StatusTypeDef I2C2_ReceiveData (uint16_t Addr, uint8_t *pBuffer, uint16_t Length)
 Read a register of the device through I2C.
static void SPIx_Init (void)
 SPIx Bus initialization.
static void SPIx_Write (uint8_t Value)
 SPI Write a byte to device.
static void SPIx_WriteReadData (const uint8_t *DataIn, uint8_t *DataOut, uint16_t DataLegnth)
 SPI Write a byte to device.
static void SPIx_FlushFifo (void)
 SPIx_FlushFifo.
static uint32_t SPIx_Read (void)
 SPI Read 4 bytes from device.
static void SPIx_Error (void)
 SPI error treatment function.
static void SPIx_MspInit (SPI_HandleTypeDef *hspi)
 SPI MSP Init.

Function Documentation

static void I2C1_Error ( void  ) [static]

Manages error callback by re-initializing I2C.

Return values:
None

Definition at line 635 of file stm32072b_eval.c.

References heval_I2c1, and I2C1_Init().

Referenced by I2C1_ReadBuffer(), I2C1_TransmitData(), and I2C1_WriteBuffer().

static void I2C1_Init ( void  ) [static]

I2C Bus initialization.

Return values:
None

Definition at line 529 of file stm32072b_eval.c.

References EVAL_I2C1, heval_I2c1, I2C1_MspInit(), and I2C1_TIMING.

Referenced by EEPROM_IO_Init(), HDMI_CEC_IO_Init(), I2C1_Error(), and TSENSOR_IO_Init().

static HAL_StatusTypeDef I2C1_IsDeviceReady ( uint16_t  DevAddress,
uint32_t  Trials 
) [static]

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 580 of file stm32072b_eval.c.

References heval_I2c1, and I2c1Timeout.

Referenced by EEPROM_IO_IsDeviceReady(), and TSENSOR_IO_IsDeviceReady().

static void I2C1_MspInit ( I2C_HandleTypeDef *  hi2c) [static]

I2C MSP Initialization.

Parameters:
hi2cI2C handle
Return values:
None

Definition at line 649 of file stm32072b_eval.c.

References EVAL_I2C1_CLK_ENABLE, EVAL_I2C1_FORCE_RESET, EVAL_I2C1_GPIO_CLK_ENABLE, EVAL_I2C1_GPIO_PORT, EVAL_I2C1_RELEASE_RESET, EVAL_I2C1_SCL_PIN, EVAL_I2C1_SCL_SDA_AF, and EVAL_I2C1_SDA_PIN.

Referenced by I2C1_Init().

static HAL_StatusTypeDef I2C1_ReadBuffer ( uint16_t  Addr,
uint8_t  Reg,
uint16_t  RegSize,
uint8_t *  pBuffer,
uint16_t  Length 
) [static]

Reads multiple data on the BUS.

Parameters:
AddrI2C Address
RegReg Address
RegSizeThe target register size (can be 8BIT or 16BIT)
pBufferpointer to read data buffer
Lengthlength of the data
Return values:
0if no problems to read multiple data

Definition at line 558 of file stm32072b_eval.c.

References heval_I2c1, I2C1_Error(), and I2c1Timeout.

Referenced by EEPROM_IO_ReadData(), and TSENSOR_IO_Read().

static HAL_StatusTypeDef I2C1_TransmitData ( uint8_t *  pBuffer,
uint16_t  Length 
) [static]

Write buffer through I2C.

Parameters:
pBufferThe address of the data to be written
Lengthbuffer size to be written
Return values:
None

Definition at line 615 of file stm32072b_eval.c.

References heval_I2c1, I2C1_Error(), and I2c1Timeout.

Referenced by HDMI_CEC_IO_WriteData().

static HAL_StatusTypeDef I2C1_WriteBuffer ( uint16_t  Addr,
uint8_t  Reg,
uint16_t  RegSize,
uint8_t *  pBuffer,
uint16_t  Length 
) [static]

Write a value in a register of the device through BUS.

Parameters:
AddrDevice address on BUS Bus.
RegThe target register address to write
RegSizeThe target register size (can be 8BIT or 16BIT)
pBufferThe target register value to be written
Lengthbuffer size to be written
Return values:
None

Definition at line 594 of file stm32072b_eval.c.

References heval_I2c1, I2C1_Error(), and I2c1Timeout.

Referenced by EEPROM_IO_WriteData(), and TSENSOR_IO_Write().

static void I2C2_Error ( void  ) [static]

Discovery I2C2 error treatment function.

Return values:
None

Definition at line 733 of file stm32072b_eval.c.

References heval_I2c2, and I2C2_Init().

Referenced by I2C2_ReceiveData().

static void I2C2_Init ( void  ) [static]

I2C Bus initialization.

Return values:
None

Definition at line 687 of file stm32072b_eval.c.

References EVAL_I2C2, heval_I2c2, I2C2_MspInit(), and I2C2_TIMING.

Referenced by HDMI_CEC_IO_Init(), and I2C2_Error().

static void I2C2_MspInit ( I2C_HandleTypeDef *  hi2c) [static]

I2C MSP Initialization.

Parameters:
hi2cI2C handle
Return values:
None

Definition at line 747 of file stm32072b_eval.c.

References EVAL_I2C2_AF, EVAL_I2C2_CLK_ENABLE, EVAL_I2C2_FORCE_RESET, EVAL_I2C2_GPIO_CLK_ENABLE, EVAL_I2C2_GPIO_PORT, EVAL_I2C2_RELEASE_RESET, EVAL_I2C2_SCL_PIN, and EVAL_I2C2_SDA_PIN.

Referenced by I2C2_Init().

static HAL_StatusTypeDef I2C2_ReceiveData ( uint16_t  Addr,
uint8_t *  pBuffer,
uint16_t  Length 
) [static]

Read a register of the device through I2C.

Parameters:
AddrDevice address on I2C Bus.
pBufferThe address to store the read data
Lengthbuffer size to be read
Return values:
None

Definition at line 714 of file stm32072b_eval.c.

References heval_I2c2, I2C2_Error(), and I2c2Timeout.

Referenced by HDMI_CEC_IO_ReadData().

static void SPIx_Error ( void  ) [static]

SPI error treatment function.

Return values:
None

Definition at line 884 of file stm32072b_eval.c.

References heval_Spi, and SPIx_Init().

Referenced by SPIx_Read(), SPIx_Write(), and SPIx_WriteReadData().

static void SPIx_FlushFifo ( void  ) [static]

SPIx_FlushFifo.

Return values:
None

Definition at line 875 of file stm32072b_eval.c.

References heval_Spi.

Referenced by LCD_IO_WriteMultipleData().

static void SPIx_Init ( void  ) [static]

SPIx Bus initialization.

Return values:
None

Definition at line 779 of file stm32072b_eval.c.

References EVAL_SPIx, heval_Spi, and SPIx_MspInit().

Referenced by LCD_IO_Init(), SD_IO_Init(), and SPIx_Error().

static uint32_t SPIx_Read ( void  ) [static]

SPI Read 4 bytes from device.

Return values:
Readdata

Definition at line 812 of file stm32072b_eval.c.

References heval_Spi, SPIx_Error(), and SpixTimeout.

Referenced by LCD_IO_ReadData().

static void SPIx_Write ( uint8_t  Value) [static]

SPI Write a byte to device.

Parameters:
Valuevalue to be written
Return values:
None

Definition at line 856 of file stm32072b_eval.c.

References heval_Spi, SPIx_Error(), and SpixTimeout.

Referenced by LCD_IO_ReadData(), LCD_IO_WriteMultipleData(), and LCD_IO_WriteReg().

static void SPIx_WriteReadData ( const uint8_t *  DataIn,
uint8_t *  DataOut,
uint16_t  DataLegnth 
) [static]

SPI Write a byte to device.

Parameters:
DataInvalue to be written
DataOutread value
DataLegnthdata length
Return values:
None

Definition at line 837 of file stm32072b_eval.c.

References heval_Spi, SPIx_Error(), and SpixTimeout.

Referenced by SD_IO_WriteByte(), and SD_IO_WriteReadData().

Generated on Wed Jul 5 2017 08:56:11 for STM32072B_EVAL BSP User Manual by   doxygen 1.7.6.1