|
| | CFN_HAL_VMT_CHECK (struct cfn_hal_i2c_api_s) |
| |
| | CFN_HAL_CREATE_DRIVER_TYPE (i2c, cfn_hal_i2c_config_t, cfn_hal_i2c_api_t, cfn_hal_i2c_phy_t, cfn_hal_i2c_callback_t) |
| |
| CFN_HAL_INLINE void | cfn_hal_i2c_populate (cfn_hal_i2c_t *driver, uint32_t peripheral_id, struct cfn_hal_clock_s *clock, void *dependency, const cfn_hal_i2c_api_t *api, const cfn_hal_i2c_phy_t *phy, const cfn_hal_i2c_config_t *config, cfn_hal_i2c_callback_t callback, void *user_arg) |
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_config_validate (const cfn_hal_i2c_t *driver, const cfn_hal_i2c_config_t *config) |
| | Validates the I2C configuration.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_init (cfn_hal_i2c_t *driver) |
| | Initializes the I2C driver.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_deinit (cfn_hal_i2c_t *driver) |
| | Deinitializes the I2C driver.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_config_set (cfn_hal_i2c_t *driver, const cfn_hal_i2c_config_t *config) |
| | Sets the I2C configuration.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_config_get (cfn_hal_i2c_t *driver, cfn_hal_i2c_config_t *config) |
| | Gets the current I2C configuration.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_callback_register (cfn_hal_i2c_t *driver, const cfn_hal_i2c_callback_t callback, void *user_arg) |
| | Registers a callback for I2C events and errors.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_power_state_set (cfn_hal_i2c_t *driver, cfn_hal_power_state_t state) |
| | Sets the I2C power state.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_event_enable (cfn_hal_i2c_t *driver, uint32_t event_mask) |
| | Enables one or more I2C nominal events.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_event_disable (cfn_hal_i2c_t *driver, uint32_t event_mask) |
| | Disables one or more I2C nominal events.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_event_get (cfn_hal_i2c_t *driver, uint32_t *event_mask) |
| | Retrieves the current I2C nominal event status.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_error_enable (cfn_hal_i2c_t *driver, uint32_t error_mask) |
| | Enables one or more I2C exception errors.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_error_disable (cfn_hal_i2c_t *driver, uint32_t error_mask) |
| | Disables one or more I2C exception errors.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_error_get (cfn_hal_i2c_t *driver, uint32_t *error_mask) |
| | Retrieves the current I2C exception error status.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_xfr_irq (cfn_hal_i2c_t *driver, const cfn_hal_i2c_transaction_t *xfr) |
| | Starts an I2C transaction using interrupts (non-blocking).
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_xfr_irq_abort (cfn_hal_i2c_t *driver) |
| | Aborts an ongoing non-blocking I2C transaction.
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_xfr_polling (cfn_hal_i2c_t *driver, const cfn_hal_i2c_transaction_t *xfr, uint32_t timeout) |
| | Executes an I2C transaction using polling (blocking).
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_mem_read (cfn_hal_i2c_t *driver, const cfn_hal_i2c_mem_transaction_t *mem_xfr, uint32_t timeout) |
| | Reads data from a specific memory address on an I2C device (blocking).
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_mem_write (cfn_hal_i2c_t *driver, const cfn_hal_i2c_mem_transaction_t *mem_xfr, uint32_t timeout) |
| | Writes data to a specific memory address on an I2C device (blocking).
|
| |
| CFN_HAL_INLINE cfn_hal_error_code_t | cfn_hal_i2c_xfr_dma (cfn_hal_i2c_t *driver, const cfn_hal_i2c_transaction_t *xfr) |
| | Starts an I2C transaction using DMA (non-blocking).
|
| |
| cfn_hal_error_code_t | cfn_hal_i2c_construct (cfn_hal_i2c_t *driver, const cfn_hal_i2c_config_t *config, const cfn_hal_i2c_phy_t *phy, struct cfn_hal_clock_s *clock, void *dependency, cfn_hal_i2c_callback_t callback, void *user_arg) |
| |
| cfn_hal_error_code_t | cfn_hal_i2c_destruct (cfn_hal_i2c_t *driver) |
| |
Inter-Integrated Circuit (I2C) HAL API.
Copyright (c) 2026 Hisham Moussa Daou https://www.whileone.me
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.