Peripheral State, Mode and Error functions.
More...
Peripheral State, Mode and Error functions.
===============================================================================
##### Peripheral State, Mode and Error functions #####
===============================================================================
[..]
This subsection permit to get in run-time the status of the peripheral
and the data flow.
◆ hal_i2c_get_error()
Return the I2C error code.
- Parameters
-
[in] | p_i2c | Pointer to an I2C handle which contains the configuration information for the specified I2C. |
- Returns
- I2C Error Code
◆ hal_i2c_get_mode()
Returns the I2C Master, Slave, Memory or no mode.
- Parameters
-
[in] | p_i2c | Pointer to an I2C handle which contains the configuration information for the specified I2C. |
- Return values
-
◆ hal_i2c_get_state()
Return the I2C handle state.
- Parameters
-
[in] | p_i2c | Pointer to an I2C handle which contains the configuration information for the specified I2C. |
- Return values
-
◆ hal_i2c_resume_reg()
Restore some registers related to I2C configuration after sleep. This function must be used in conjunction with the hal_i2c_suspend_reg().
- Parameters
-
[in] | p_i2c | Pointer to a I2C handle which contains the configuration information for the specified I2C module. |
- Return values
-
◆ hal_i2c_sda_at_low_is_not_recovered()
uint32_t hal_i2c_sda_at_low_is_not_recovered |
( |
i2c_handle_t * |
p_i2c | ) |
|
Return i2c sda at low is not recovered flag.
- Parameters
-
[in] | p_i2c | Pointer to an I2C handle which contains the configuration information for the specified I2C. |
- Return values
-
1 | i2c sda at low is not recovered. |
0 | i2c sda at low is recovered. |
◆ hal_i2c_speed_config()
hal_status_t hal_i2c_speed_config |
( |
i2c_handle_t * |
p_i2c, |
|
|
uint32_t |
speed, |
|
|
uint32_t |
scl_fall_time, |
|
|
uint32_t |
scl_rise_time |
|
) |
| |
Configure the I2C transmit rate for I2C.
- Parameters
-
[in] | p_i2c | Pointer to a I2C handle which contains the configuration information for the specified I2C module. |
[in] | speed | The transmit rate of I2C. |
[in] | scl_fall_time | The fall time of scl. |
[in] | scl_rise_time | The rise time of scl. |
- Return values
-
◆ hal_i2c_suspend_reg()
Suspend some registers related to I2C configuration before sleep.
- Parameters
-
[in] | p_i2c | Pointer to a I2C handle which contains the configuration information for the specified I2C module. |
- Return values
-
◆ hal_i2c_timing_adjust()
Adjust I2C timing value to adapt to real load.
- Parameters
-
[in] | p_i2c | Pointer to a I2C handle which contains the configuration information for the specified I2C module. |
[in] | timing_type | Timing type. See I2C_Timing_type. |
[in] | delta | timing change value(unit: I2C work clock cycles). |
- Return values
-
◆ hal_i2c_timing_get()
Get the I2C timing value.
- Parameters
-
[in] | p_i2c | Pointer to a I2C handle which contains the configuration information for the specified I2C module. |
[in] | timing_type | Timing type. See I2C_Timing_type. |
[in] | p_timing_value | Pointer of I2C timing value(unit: I2C work clock cycles). |
- Return values
-