STM32L0xx_Nucleo_32 BSP User Manual
|
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 352 of file stm32l0xx_nucleo_32.c.
References heval_I2c1, and I2C1_Init().
Referenced by I2C1_Read(), I2C1_ReadBuffer(), I2C1_Write(), and I2C1_WriteBuffer().
void I2C1_Init | ( | void | ) |
I2C Bus initialization.
- Return values:
-
None
Definition at line 223 of file stm32l0xx_nucleo_32.c.
References BSP_I2C1, heval_I2c1, I2C1_MspInit(), and I2C1_TIMING.
Referenced by 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:
-
DevAddress,: Target device address Trials,: Number of trials
- Return values:
-
HAL status
Definition at line 319 of file stm32l0xx_nucleo_32.c.
References heval_I2c1, and I2c1Timeout.
void I2C1_MspInit | ( | I2C_HandleTypeDef * | hi2c | ) |
I2C MSP Initialization.
- Parameters:
-
hi2c,: I2C handle
- Return values:
-
None
Definition at line 366 of file stm32l0xx_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:
-
Addr,: I2C address Reg,: Register address
- Return values:
-
Read data
Definition at line 270 of file stm32l0xx_nucleo_32.c.
References heval_I2c1, and I2C1_Error().
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:
-
Addr : I2C Address Reg : Reg Address RegSize : The target register size (can be 8BIT or 16BIT) pBuffer : pointer to read data buffer Length : length of the data
- Return values:
-
0 if no problems to read multiple data
Definition at line 297 of file stm32l0xx_nucleo_32.c.
References heval_I2c1, I2C1_Error(), and I2c1Timeout.
void I2C1_Write | ( | uint8_t | Addr, |
uint8_t | Reg, | ||
uint8_t | Value | ||
) |
Writes a single data.
- Parameters:
-
Addr,: I2C address Reg,: Register address Value,: Data to be written
- Return values:
-
None
Definition at line 250 of file stm32l0xx_nucleo_32.c.
References heval_I2c1, and I2C1_Error().
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:
-
Addr,: Device address on BUS Bus. Reg,: The target register address to write RegSize,: The target register size (can be 8BIT or 16BIT) pBuffer,: The target register value to be written Length,: buffer size to be written
- Return values:
-
None
Definition at line 333 of file stm32l0xx_nucleo_32.c.
References heval_I2c1, I2C1_Error(), and I2c1Timeout.
Generated on Mon Aug 28 2017 14:48:51 for STM32L0xx_Nucleo_32 BSP User Manual by
