STM32F3xx_Nucleo_32 BSP User Manual: Bus Operation functions

STM32F3xx Nucleo 32 BSP Drivers

STM32F3xx_Nucleo_32 BSP User Manual
Bus Operation functions

Functions

void I2C1_Init (void)
 I2C Bus initialization.
void I2C1_Error (void)
 Manages error callback by re-initializing I2C.
void I2C1_MspInit (I2C_HandleTypeDef *hi2c)
 I2C MSP Initialization.
void I2C1_Write (uint8_t Addr, uint8_t Reg, uint8_t Value)
 Writes a single data.
uint8_t I2C1_Read (uint8_t Addr, uint8_t Reg)
 Reads a single data.
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.
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.
HAL_StatusTypeDef I2C1_IsDeviceReady (uint16_t DevAddress, uint32_t Trials)
 Checks if target device is ready for communication.

Function Documentation

void I2C1_Error ( void  )

Manages error callback by re-initializing I2C.

Return values:
None

Definition at line 336 of file stm32f3xx_nucleo_32.c.

References I2C1_Init(), and nucleo32_I2c1.

Referenced by I2C1_Read(), I2C1_ReadBuffer(), I2C1_Write(), and I2C1_WriteBuffer().

void I2C1_Init ( void  )

I2C Bus initialization.

Return values:
None

Definition at line 209 of file stm32f3xx_nucleo_32.c.

References BSP_I2C1, I2C1_MspInit(), I2C1_TIMING, and nucleo32_I2c1.

Referenced by BSP_DIGIT4_SEG7_Init(), and I2C1_Error().

HAL_StatusTypeDef I2C1_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 303 of file stm32f3xx_nucleo_32.c.

References I2c1Timeout, and nucleo32_I2c1.

void I2C1_MspInit ( I2C_HandleTypeDef *  hi2c)

I2C MSP Initialization.

Parameters:
hi2cI2C handle
Return values:
None

Definition at line 350 of file stm32f3xx_nucleo_32.c.

References BSP_I2C1_CLK_ENABLE, BSP_I2C1_FORCE_RESET, BSP_I2C1_GPIO_CLK_ENABLE, BSP_I2C1_GPIO_PORT, BSP_I2C1_RELEASE_RESET, BSP_I2C1_SCL_PIN, BSP_I2C1_SCL_SDA_AF, and BSP_I2C1_SDA_PIN.

Referenced by I2C1_Init().

uint8_t I2C1_Read ( uint8_t  Addr,
uint8_t  Reg 
)

Reads a single data.

Parameters:
AddrI2C address
RegRegister address
Return values:
Readdata

Definition at line 256 of file stm32f3xx_nucleo_32.c.

References I2C1_Error(), and nucleo32_I2c1.

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.

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 281 of file stm32f3xx_nucleo_32.c.

References I2C1_Error(), I2c1Timeout, and nucleo32_I2c1.

void I2C1_Write ( uint8_t  Addr,
uint8_t  Reg,
uint8_t  Value 
)

Writes a single data.

Parameters:
AddrI2C address
RegRegister address
ValueData to be written
Return values:
None

Definition at line 236 of file stm32f3xx_nucleo_32.c.

References I2C1_Error(), and nucleo32_I2c1.

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.

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 317 of file stm32f3xx_nucleo_32.c.

References I2C1_Error(), I2c1Timeout, and nucleo32_I2c1.

Referenced by BSP_DIGIT4_SEG7_Display(), and BSP_DIGIT4_SEG7_Init().

Generated on Wed May 31 2017 11:09:08 for STM32F3xx_Nucleo_32 BSP User Manual by   doxygen 1.7.6.1