![]() |
nrfx 4.5.0
|
Hardware access layer with cache and barrier support for managing the TWIM peripheral. More...
Data Structures | |
| struct | nrfy_twim_pins_t |
| TWIM pins configuration structure. More... | |
| struct | nrfy_twim_config_t |
| TWIM configuration structure. More... | |
| struct | nrfy_twim_xfer_desc_t |
| Structure describing a TWIM transfer. More... | |
Macros | |
| #define | NRFY_TWIM_HAS_ARRAY_LIST 1 |
Functions | |
| NRFY_STATIC_INLINE void | nrfy_twim_periph_configure (NRF_TWIM_Type *p_reg, nrfy_twim_config_t const *p_config) |
| Function for configuring the TWIM. | |
| NRFY_STATIC_INLINE void | nrfy_twim_int_init (NRF_TWIM_Type *p_reg, uint32_t mask, uint8_t irq_priority, bool enable) |
| Function for initializing the specified TWIM interrupts. | |
| NRFY_STATIC_INLINE void | nrfy_twim_int_uninit (NRF_TWIM_Type *p_reg) |
| Function for uninitializing the TWIM interrupts. | |
| NRFY_STATIC_INLINE uint32_t | nrfy_twim_events_process (NRF_TWIM_Type *p_reg, uint32_t mask, nrfy_twim_xfer_desc_t const *p_xfer) |
| Function for processing the specified TWIM events. | |
| NRFY_STATIC_INLINE void | nrfy_twim_tx_buffer_set (NRF_TWIM_Type *p_reg, nrfy_twim_xfer_desc_t const *p_xfer) |
| Function for setting the TWIM transaction buffer. | |
| NRFY_STATIC_INLINE void | nrfy_twim_rx_buffer_set (NRF_TWIM_Type *p_reg, nrfy_twim_xfer_desc_t const *p_xfer) |
| Function for setting the TWIM reception buffer. | |
| NRFY_STATIC_INLINE void | nrfy_twim_tx_start (NRF_TWIM_Type *p_reg, nrfy_twim_xfer_desc_t const *p_xfer) |
| Function for starting TWIM transaction. | |
| NRFY_STATIC_INLINE void | nrfy_twim_rx_start (NRF_TWIM_Type *p_reg, nrfy_twim_xfer_desc_t const *p_xfer) |
| Function for starting TWIM reception. | |
| NRFY_STATIC_INLINE void | nrfy_twim_abort (NRF_TWIM_Type *p_reg, nrfy_twim_xfer_desc_t const *p_xfer) |
| Function for aborting the ongoing TWIM transaction. | |
| NRFY_STATIC_INLINE void | nrfy_twim_pins_get (NRF_TWIM_Type const *p_reg, nrfy_twim_pins_t *p_pins) |
| Function for getting TWIM pins configuration. | |
| NRFY_STATIC_INLINE void | nrfy_twim_stop (NRF_TWIM_Type *p_reg) |
| Function for disabling TWIM with all interrupts and shortcuts. | |
| NRFY_STATIC_INLINE void | nrfy_twim_tx_list_set (NRF_TWIM_Type *p_reg, bool enable) |
| Function for enabling or disabling the TX list feature. | |
| NRFY_STATIC_INLINE void | nrfy_twim_rx_list_set (NRF_TWIM_Type *p_reg, bool enable) |
| Function for enabling or disabling the RX list feature. | |
| NRFY_STATIC_INLINE void | nrfy_twim_pins_set (NRF_TWIM_Type *p_reg, nrfy_twim_pins_t const *p_pins) |
| Function for setting the TWIM pins configuration. | |
| NRFY_STATIC_INLINE void | nrfy_twim_task_trigger (NRF_TWIM_Type *p_reg, nrf_twim_task_t task) |
| NRFY_STATIC_INLINE uint32_t | nrfy_twim_task_address_get (NRF_TWIM_Type const *p_reg, nrf_twim_task_t task) |
| NRFY_STATIC_INLINE void | nrfy_twim_event_clear (NRF_TWIM_Type *p_reg, nrf_twim_event_t event) |
| NRFY_STATIC_INLINE bool | nrfy_twim_event_check (NRF_TWIM_Type const *p_reg, nrf_twim_event_t event) |
| NRFY_STATIC_INLINE uint32_t | nrfy_twim_event_address_get (NRF_TWIM_Type const *p_reg, nrf_twim_event_t event) |
| NRFY_STATIC_INLINE void | nrfy_twim_shorts_enable (NRF_TWIM_Type *p_reg, uint32_t mask) |
| NRFY_STATIC_INLINE void | nrfy_twim_shorts_disable (NRF_TWIM_Type *p_reg, uint32_t mask) |
| NRFY_STATIC_INLINE void | nrfy_twim_int_enable (NRF_TWIM_Type *p_reg, uint32_t mask) |
| NRFY_STATIC_INLINE void | nrfy_twim_int_disable (NRF_TWIM_Type *p_reg, uint32_t mask) |
| NRFY_STATIC_INLINE uint32_t | nrfy_twim_int_enable_check (NRF_TWIM_Type const *p_reg, uint32_t mask) |
| NRFY_STATIC_INLINE void | nrfy_twim_subscribe_set (NRF_TWIM_Type *p_reg, nrf_twim_task_t task, uint8_t channel) |
| NRFY_STATIC_INLINE void | nrfy_twim_subscribe_clear (NRF_TWIM_Type *p_reg, nrf_twim_task_t task) |
| NRFY_STATIC_INLINE void | nrfy_twim_publish_set (NRF_TWIM_Type *p_reg, nrf_twim_event_t event, uint8_t channel) |
| NRFY_STATIC_INLINE void | nrfy_twim_publish_clear (NRF_TWIM_Type *p_reg, nrf_twim_event_t event) |
| NRFY_STATIC_INLINE void | nrfy_twim_enable (NRF_TWIM_Type *p_reg) |
| NRFY_STATIC_INLINE void | nrfy_twim_disable (NRF_TWIM_Type *p_reg) |
| NRFY_STATIC_INLINE uint32_t | nrfy_twim_scl_pin_get (NRF_TWIM_Type const *p_reg) |
| NRFY_STATIC_INLINE uint32_t | nrfy_twim_sda_pin_get (NRF_TWIM_Type const *p_reg) |
| NRFY_STATIC_INLINE void | nrfy_twim_frequency_set (NRF_TWIM_Type *p_reg, nrf_twim_frequency_t frequency) |
| NRFY_STATIC_INLINE uint32_t | nrfy_twim_errorsrc_get_and_clear (NRF_TWIM_Type *p_reg) |
| NRFY_STATIC_INLINE void | nrfy_twim_address_set (NRF_TWIM_Type *p_reg, uint8_t address) |
| NRFY_STATIC_INLINE void | nrfy_twim_shorts_set (NRF_TWIM_Type *p_reg, uint32_t mask) |
| NRFY_STATIC_INLINE uint32_t | nrfy_twim_shorts_get (NRF_TWIM_Type const *p_reg) |
| NRFY_STATIC_INLINE size_t | nrfy_twim_txd_amount_get (NRF_TWIM_Type const *p_reg) |
| NRFY_STATIC_INLINE size_t | nrfy_twim_rxd_amount_get (NRF_TWIM_Type const *p_reg) |
| NRFY_STATIC_INLINE void | nrfy_twim_tx_list_enable (NRF_TWIM_Type *p_reg) |
| NRFY_STATIC_INLINE void | nrfy_twim_tx_list_disable (NRF_TWIM_Type *p_reg) |
| NRFY_STATIC_INLINE void | nrfy_twim_rx_list_enable (NRF_TWIM_Type *p_reg) |
| NRFY_STATIC_INLINE void | nrfy_twim_rx_list_disable (NRF_TWIM_Type *p_reg) |
Hardware access layer with cache and barrier support for managing the TWIM peripheral.
| #define NRFY_TWIM_HAS_ARRAY_LIST 1 |
| NRFY_STATIC_INLINE void nrfy_twim_abort | ( | NRF_TWIM_Type * | p_reg, |
| nrfy_twim_xfer_desc_t const * | p_xfer ) |
Function for aborting the ongoing TWIM transaction.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_xfer | Pointer to the structure containing reception buffer if the abort is to be blocking. NULL for non-blocking operation. |
| NRFY_STATIC_INLINE void nrfy_twim_address_set | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t | address ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | address | Address to be used in transfers. |
| NRFY_STATIC_INLINE void nrfy_twim_disable | ( | NRF_TWIM_Type * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_enable | ( | NRF_TWIM_Type * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE uint32_t nrfy_twim_errorsrc_get_and_clear | ( | NRF_TWIM_Type * | p_reg | ) |
The error flags are cleared after reading.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE uint32_t nrfy_twim_event_address_get | ( | NRF_TWIM_Type const * | p_reg, |
| nrf_twim_event_t | event ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | The specified event. |
| NRFY_STATIC_INLINE bool nrfy_twim_event_check | ( | NRF_TWIM_Type const * | p_reg, |
| nrf_twim_event_t | event ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event to be checked. |
| true | The event has been generated. |
| false | The event has not been generated. |
| NRFY_STATIC_INLINE void nrfy_twim_event_clear | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_event_t | event ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event to clear. |
| NRFY_STATIC_INLINE uint32_t nrfy_twim_events_process | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask, | ||
| nrfy_twim_xfer_desc_t const * | p_xfer ) |
Function for processing the specified TWIM events.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of events to be processed, created by NRFY_EVENT_TO_INT_BITMASK(); |
| [in] | p_xfer | Pointer to the structure containing buffer associated with the last reception. Can be NULL. |
| NRFY_STATIC_INLINE void nrfy_twim_frequency_set | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_frequency_t | frequency ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | frequency | TWI frequency. |
| NRFY_STATIC_INLINE void nrfy_twim_int_disable | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of interrupts to be disabled. Use nrf_twim_int_mask_t values for bit masking. |
| NRFY_STATIC_INLINE void nrfy_twim_int_enable | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of interrupts to be enabled. Use nrf_twim_int_mask_t values for bit masking. |
| NRFY_STATIC_INLINE uint32_t nrfy_twim_int_enable_check | ( | NRF_TWIM_Type const * | p_reg, |
| uint32_t | mask ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of interrupts to be checked. Use nrf_twim_int_mask_t values for bit masking. |
| NRFY_STATIC_INLINE void nrfy_twim_int_init | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask, | ||
| uint8_t | irq_priority, | ||
| bool | enable ) |
Function for initializing the specified TWIM interrupts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Mask of interrupts to be initialized. |
| [in] | irq_priority | Interrupt priority. |
| [in] | enable | True if interrupts associated with the event mask are to be enabled, false otherwise. |
| NRFY_STATIC_INLINE void nrfy_twim_int_uninit | ( | NRF_TWIM_Type * | p_reg | ) |
Function for uninitializing the TWIM interrupts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_periph_configure | ( | NRF_TWIM_Type * | p_reg, |
| nrfy_twim_config_t const * | p_config ) |
Function for configuring the TWIM.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_config | Pointer to the peripheral configuration structure. |
| NRFY_STATIC_INLINE void nrfy_twim_pins_get | ( | NRF_TWIM_Type const * | p_reg, |
| nrfy_twim_pins_t * | p_pins ) |
Function for getting TWIM pins configuration.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [out] | p_pins | Pointer to the structure to be filled with TWIM pins configuration. |
| NRFY_STATIC_INLINE void nrfy_twim_pins_set | ( | NRF_TWIM_Type * | p_reg, |
| nrfy_twim_pins_t const * | p_pins ) |
Function for setting the TWIM pins configuration.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [out] | p_pins | Pointer to the TWIM pin configurartion structure. |
| NRFY_STATIC_INLINE void nrfy_twim_publish_clear | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_event_t | event ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to clear the configuration. |
| NRFY_STATIC_INLINE void nrfy_twim_publish_set | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_event_t | event, | ||
| uint8_t | channel ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to set the configuration. |
| [in] | channel | Channel through which to publish the event. |
| NRFY_STATIC_INLINE void nrfy_twim_rx_buffer_set | ( | NRF_TWIM_Type * | p_reg, |
| nrfy_twim_xfer_desc_t const * | p_xfer ) |
Function for setting the TWIM reception buffer.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_xfer | Pointer to the structure containing reception buffer. |
| NRFY_STATIC_INLINE void nrfy_twim_rx_list_disable | ( | NRF_TWIM_Type * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_rx_list_enable | ( | NRF_TWIM_Type * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_rx_list_set | ( | NRF_TWIM_Type * | p_reg, |
| bool | enable ) |
Function for enabling or disabling the RX list feature.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | enable | True if RX list feature is to be enabled, false otherwise. |
| NRFY_STATIC_INLINE void nrfy_twim_rx_start | ( | NRF_TWIM_Type * | p_reg, |
| nrfy_twim_xfer_desc_t const * | p_xfer ) |
Function for starting TWIM reception.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_xfer | Pointer to the structure containing reception buffer. |
| NRFY_STATIC_INLINE size_t nrfy_twim_rxd_amount_get | ( | NRF_TWIM_Type const * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE uint32_t nrfy_twim_scl_pin_get | ( | NRF_TWIM_Type const * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE uint32_t nrfy_twim_sda_pin_get | ( | NRF_TWIM_Type const * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_shorts_disable | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be disabled. |
| NRFY_STATIC_INLINE void nrfy_twim_shorts_enable | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be enabled. |
| NRFY_STATIC_INLINE uint32_t nrfy_twim_shorts_get | ( | NRF_TWIM_Type const * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_shorts_set | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be set. |
| NRFY_STATIC_INLINE void nrfy_twim_stop | ( | NRF_TWIM_Type * | p_reg | ) |
Function for disabling TWIM with all interrupts and shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_subscribe_clear | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_task_t | task ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to clear the configuration. |
| NRFY_STATIC_INLINE void nrfy_twim_subscribe_set | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_task_t | task, | ||
| uint8_t | channel ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to set the configuration. |
| [in] | channel | Channel through which to subscribe events. |
| NRFY_STATIC_INLINE uint32_t nrfy_twim_task_address_get | ( | NRF_TWIM_Type const * | p_reg, |
| nrf_twim_task_t | task ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | The specified task. |
| NRFY_STATIC_INLINE void nrfy_twim_task_trigger | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_task_t | task ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task to be activated. |
| NRFY_STATIC_INLINE void nrfy_twim_tx_buffer_set | ( | NRF_TWIM_Type * | p_reg, |
| nrfy_twim_xfer_desc_t const * | p_xfer ) |
Function for setting the TWIM transaction buffer.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_xfer | Pointer to the structure containing transaction buffer. |
| NRFY_STATIC_INLINE void nrfy_twim_tx_list_disable | ( | NRF_TWIM_Type * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_tx_list_enable | ( | NRF_TWIM_Type * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRFY_STATIC_INLINE void nrfy_twim_tx_list_set | ( | NRF_TWIM_Type * | p_reg, |
| bool | enable ) |
Function for enabling or disabling the TX list feature.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | enable | True if TX list feature is to be enabled, false otherwise. |
| NRFY_STATIC_INLINE void nrfy_twim_tx_start | ( | NRF_TWIM_Type * | p_reg, |
| nrfy_twim_xfer_desc_t const * | p_xfer ) |
Function for starting TWIM transaction.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_xfer | Pointer to the structure containing transaction buffer. |
| NRFY_STATIC_INLINE size_t nrfy_twim_txd_amount_get | ( | NRF_TWIM_Type const * | p_reg | ) |
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |