|
L14-Click 1.0
STM32WLE5CC LoRaWAN Sensor Platform
|
This file provides code for the configuration of the I2C instances. More...
#include "i2c.h"Go to the source code of this file.
Functions | |
| void | MX_I2C2_Init (void) |
| Initialise the I2C2 peripheral (hi2c2) as configured by STM32CubeMX. Sets clock speed, addressing mode, and timing registers for communication with all I2C-connected sensors (SHT45, TSL2591, ILPS22QS, BMP585, SCD41, SPS30, ST25DV16KC NFC tag). | |
| void | HAL_I2C_MspInit (I2C_HandleTypeDef *i2cHandle) |
| void | HAL_I2C_MspDeInit (I2C_HandleTypeDef *i2cHandle) |
| void | MX_I2C2_DeInit (void) |
| Deinitialize I2C2 peripheral for low power mode. | |
| HAL_StatusTypeDef | I2C_IsDeviceReadyMT (I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint32_t Trials, uint32_t Timeout) |
| Wrapper around HAL_I2C_IsDeviceReady() that recovers from a busy bus. If the HAL I2C bus is in a BUSY error state, the function resets the peripheral (DeInit / Init cycle) before retrying the device poll. | |
Variables | |
| I2C_HandleTypeDef | hi2c2 |
This file provides code for the configuration of the I2C instances.
Copyright (c) 2025 STMicroelectronics. All rights reserved.
This software is licensed under terms that can be found in the LICENSE file in the root directory of this software component. If no LICENSE file comes with this software, it is provided AS-IS.
Definition in file i2c.c.
| void HAL_I2C_MspDeInit | ( | I2C_HandleTypeDef * | i2cHandle | ) |
| void HAL_I2C_MspInit | ( | I2C_HandleTypeDef * | i2cHandle | ) |
Initializes the peripherals clocks
I2C2 GPIO Configuration PA11 ------> I2C2_SDA PA12 ------> I2C2_SCL
Definition at line 73 of file i2c.c.
References Error_Handler().
| HAL_StatusTypeDef I2C_IsDeviceReadyMT | ( | I2C_HandleTypeDef * | hi2c, |
| uint16_t | DevAddress, | ||
| uint32_t | Trials, | ||
| uint32_t | Timeout ) |
Wrapper around HAL_I2C_IsDeviceReady() that recovers from a busy bus. If the HAL I2C bus is in a BUSY error state, the function resets the peripheral (DeInit / Init cycle) before retrying the device poll.
| hi2c | Pointer to the I2C handle. |
| DevAddress | 7-bit or 10-bit device address (left-shifted by 1 for HAL). |
| Trials | Number of consecutive ACK attempts before giving up. |
| Timeout | Timeout in milliseconds for each trial. |
| HAL_OK | – device acknowledged within the given number of trials. |
| HAL_ERROR | – device not present or bus error after recovery attempt. |
| HAL_TIMEOUT | – device did not acknowledge within the timeout. |
Definition at line 158 of file i2c.c.
References HAL_Delay().
Referenced by amb_tsl2591_Init(), bar_bmp585_Init(), bar_ils22qs_Init(), nfc_st25dv16kc_Init(), scd41_Init(), sps30_Init(), tempHum_onOff(), and tmphm_sht45_Init().
| void MX_I2C2_DeInit | ( | void | ) |
Deinitialize I2C2 peripheral for low power mode.
Deinitialise the I2C2 peripheral to reduce current consumption in low-power mode. Call before entering STOP or OFF mode; call MX_I2C2_Init() again after wakeup.
Definition at line 150 of file i2c.c.
References hi2c2.
Referenced by i2c_OnOff().
| void MX_I2C2_Init | ( | void | ) |
Initialise the I2C2 peripheral (hi2c2) as configured by STM32CubeMX. Sets clock speed, addressing mode, and timing registers for communication with all I2C-connected sensors (SHT45, TSL2591, ILPS22QS, BMP585, SCD41, SPS30, ST25DV16KC NFC tag).
Configure Analogue filter
Configure Digital filter
Definition at line 30 of file i2c.c.
References Error_Handler(), and hi2c2.
Referenced by i2c_OnOff(), and main().
| I2C_HandleTypeDef hi2c2 |
Definition at line 27 of file i2c.c.
Referenced by checkResetRestart(), main(), MX_I2C2_DeInit(), and MX_I2C2_Init().