44#ifndef _HAL_I2C_MASTER_H_
45#define _HAL_I2C_MASTER_H_
void hal_i2c_master_configure_default(hal_i2c_master_config_t *config)
Configure I2C Master HAL configuration structure.
void hal_i2c_master_set_timeout(handle_t *handle, hal_i2c_master_config_t *config)
Set I2C master timeout value.
err_t hal_i2c_master_read(handle_t handle, uint8_t *read_data_buf, size_t len_read_data)
Read data from the I2C bus.
void hal_i2c_master_set_slave_address(handle_t *handle, hal_i2c_master_config_t *config)
Set I2C slave address.
err_t hal_i2c_master_write_then_read(handle_t handle, uint8_t *write_data_buf, size_t len_write_data, uint8_t *read_data_buf, size_t len_read_data)
Write data followed by read.
err_t hal_i2c_master_set_speed(handle_t *handle, hal_i2c_master_config_t *config)
Set I2C master module speed.
err_t hal_i2c_master_open(handle_t *handle, bool hal_obj_open_state)
Open the I2C Master HAL object.
err_t hal_i2c_master_write(handle_t handle, uint8_t *write_data_buf, size_t len_write_data)
Write data to the I2C bus.
err_t hal_i2c_master_close(handle_t *handle)
Closes I2C Master HAL object.
hal_i2c_master_timeout_t
Definition hal_i2c_master.h:83
@ HAL_I2C_MASTER_TIMEOUT_INIT
Definition hal_i2c_master.h:89
@ HAL_I2C_MASTER_ARBITRATION_LOST
Definition hal_i2c_master.h:88
@ HAL_I2C_MASTER_TIMEOUT_WRITE
Definition hal_i2c_master.h:86
@ HAL_I2C_MASTER_TIMEOUT_READ
Definition hal_i2c_master.h:87
@ HAL_I2C_MASTER_TIMEOUT_START
Definition hal_i2c_master.h:84
@ HAL_I2C_MASTER_TIMEOUT_STOP
Definition hal_i2c_master.h:85
hal_i2c_master_err_t
Definition hal_i2c_master.h:71
@ HAL_I2C_MASTER_ERROR
Definition hal_i2c_master.h:76
@ HAL_I2C_MASTER_MODULE_ERROR
Definition hal_i2c_master.h:74
@ HAL_I2C_MASTER_SUCCESS
Definition hal_i2c_master.h:72
@ HAL_I2C_MASTER_WRONG_PINS
Definition hal_i2c_master.h:73
hal_i2c_master_speed_t
Definition hal_i2c_master.h:96
@ HAL_I2C_MASTER_SPEED_STANDARD
Definition hal_i2c_master.h:97
@ HAL_I2C_MASTER_SPEED_FAST
Definition hal_i2c_master.h:99
@ HAL_I2C_MASTER_SPEED_FULL
Definition hal_i2c_master.h:98
HAL target macros and typedefs.
int32_t err_t
Definition hal_target.h:64
hal_ll_pin_name_t hal_pin_name_t
Definition hal_target.h:60
I2C Master HAL init configuration structure, consisted of the following fields :
Definition hal_i2c_master.h:126
uint32_t speed
Definition hal_i2c_master.h:132
uint8_t addr
Definition hal_i2c_master.h:127
hal_pin_name_t sda
Definition hal_i2c_master.h:129
hal_pin_name_t scl
Definition hal_i2c_master.h:130
uint16_t timeout_pass_count
Definition hal_i2c_master.h:133
Definition hal_i2c_master.h:61
handle_t * hal_i2c_master_handle
Definition hal_i2c_master.h:62
handle_t * drv_i2c_master_handle
Definition hal_i2c_master.h:63
bool init_state
Definition hal_i2c_master.h:64
I2C Master HAL context structure, consisted of the following fields :
Definition hal_i2c_master.h:150
hal_i2c_master_config_t config
Definition hal_i2c_master.h:152
handle_t handle
Definition hal_i2c_master.h:151