![]() |
nrfx 4.5.0
|
Hardware access layer for managing the TWIM peripheral. More...
Macros | |
| #define | NRF_TWIM_INST_GET(idx) |
| Macro getting pointer to the structure of registers of the TWIM peripheral. | |
| #define | NRF_TWIM_HAS_1000_KHZ_FREQ 1 |
| Symbol indicating whether 1000 kHz clock frequency is available. | |
| #define | NRF_TWIM_HAS_ARRAY_LIST 1 |
| Symbol indicating whether EasyDMA array list feature is present. | |
| #define | NRF_TWIM_HAS_DMA_REG 1 |
| Symbol indicating whether dedicated DMA register is present. | |
| #define | NRF_TWIM_HAS_DMA_CURRENTAMOUNT_REG 1 |
| Symbol indicating whether DMA CURRENTAMOUNT registers are present. | |
| #define | NRF_TWIM_HAS_DMA_TASKS_EVENTS 1 |
| Symbol indicating whether TWIM DMA tasks and events are present. | |
| #define | NRF_TWIM_HAS_DMA_SHORTS 1 |
| Symbol indicating whether TWIM DMA shortcuts are present. | |
| #define | NRF_TWIM_HAS_BUS_ERROR_EVENTS 1 |
| Symbol indicating whether TWIM BUSERROR events are present. | |
| #define | NRF_TWIM_DMA_RX_PATTERN_MAX_COUNT TWIM_DMA_RX_MATCH_CANDIDATE_MaxCount |
| Max number of RX patterns. | |
| #define | NRF_TWIM_HAS_CUSTOM_FREQUENCIES 1 |
| Symbol indicating whether TWIM supports custom frequencies. | |
Enumerations | |
| enum | nrf_twim_task_t { NRF_TWIM_TASK_STARTRX = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.START) , NRF_TWIM_TASK_STOPRX = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.STOP) , NRF_TWIM_TASK_STARTTX = offsetof(NRF_TWIM_Type, TASKS_DMA.TX.START) , NRF_TWIM_TASK_STOPTX = offsetof(NRF_TWIM_Type, TASKS_DMA.TX.STOP) , NRF_TWIM_TASK_ENABLERXMATCH0 = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.ENABLEMATCH[0]) , NRF_TWIM_TASK_ENABLERXMATCH1 = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.ENABLEMATCH[1]) , NRF_TWIM_TASK_ENABLERXMATCH2 = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.ENABLEMATCH[2]) , NRF_TWIM_TASK_ENABLERXMATCH3 = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.ENABLEMATCH[3]) , NRF_TWIM_TASK_DISABLERXMATCH0 = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.DISABLEMATCH[0]) , NRF_TWIM_TASK_DISABLERXMATCH1 = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.DISABLEMATCH[1]) , NRF_TWIM_TASK_DISABLERXMATCH2 = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.DISABLEMATCH[2]) , NRF_TWIM_TASK_DISABLERXMATCH3 = offsetof(NRF_TWIM_Type, TASKS_DMA.RX.DISABLEMATCH[3]) , NRF_TWIM_TASK_STOP = offsetof(NRF_TWIM_Type, TASKS_STOP) , NRF_TWIM_TASK_SUSPEND = offsetof(NRF_TWIM_Type, TASKS_SUSPEND) , NRF_TWIM_TASK_RESUME = offsetof(NRF_TWIM_Type, TASKS_RESUME) } |
| TWIM tasks. More... | |
| enum | nrf_twim_event_t { NRF_TWIM_EVENT_STOPPED = offsetof(NRF_TWIM_Type, EVENTS_STOPPED) , NRF_TWIM_EVENT_ERROR = offsetof(NRF_TWIM_Type, EVENTS_ERROR) , NRF_TWIM_EVENT_SUSPENDED = offsetof(NRF_TWIM_Type, EVENTS_SUSPENDED) , NRF_TWIM_EVENT_ENDRX = offsetof(NRF_TWIM_Type, EVENTS_DMA.RX.END) , NRF_TWIM_EVENT_RXSTARTED = offsetof(NRF_TWIM_Type, EVENTS_DMA.RX.READY) , NRF_TWIM_EVENT_RXMATCH0 = offsetof(NRF_TWIM_Type, EVENTS_DMA.RX.MATCH[0]) , NRF_TWIM_EVENT_RXMATCH1 = offsetof(NRF_TWIM_Type, EVENTS_DMA.RX.MATCH[1]) , NRF_TWIM_EVENT_RXMATCH2 = offsetof(NRF_TWIM_Type, EVENTS_DMA.RX.MATCH[2]) , NRF_TWIM_EVENT_RXMATCH3 = offsetof(NRF_TWIM_Type, EVENTS_DMA.RX.MATCH[3]) , NRF_TWIM_EVENT_ENDTX = offsetof(NRF_TWIM_Type, EVENTS_DMA.TX.END) , NRF_TWIM_EVENT_TXSTARTED = offsetof(NRF_TWIM_Type, EVENTS_DMA.TX.READY) , NRF_TWIM_EVENT_RXBUSERROR = offsetof(NRF_TWIM_Type, EVENTS_DMA.RX.BUSERROR) , NRF_TWIM_EVENT_TXBUSERROR = offsetof(NRF_TWIM_Type, EVENTS_DMA.TX.BUSERROR) , NRF_TWIM_EVENT_LASTRX = offsetof(NRF_TWIM_Type, EVENTS_LASTRX) , NRF_TWIM_EVENT_LASTTX = offsetof(NRF_TWIM_Type, EVENTS_LASTTX) } |
| TWIM events. More... | |
| enum | nrf_twim_short_mask_t { NRF_TWIM_SHORT_LASTTX_SUSPEND_MASK = TWIM_SHORTS_LASTTX_SUSPEND_Msk , NRF_TWIM_SHORT_LASTTX_STOP_MASK = TWIM_SHORTS_LASTTX_STOP_Msk , NRF_TWIM_SHORT_LASTRX_STOP_MASK = TWIM_SHORTS_LASTRX_STOP_Msk , NRF_TWIM_SHORT_LASTTX_STARTRX_MASK = TWIM_SHORTS_LASTTX_DMA_RX_START_Msk , NRF_TWIM_SHORT_LASTRX_STARTTX_MASK = TWIM_SHORTS_LASTRX_DMA_TX_START_Msk , NRF_TWIM_SHORT_RXMATCH0_ENABLERXMATCH1_MASK = TWIM_SHORTS_DMA_RX_MATCH0_DMA_RX_ENABLEMATCH1_Msk , NRF_TWIM_SHORT_RXMATCH1_ENABLERXMATCH2_MASK = TWIM_SHORTS_DMA_RX_MATCH1_DMA_RX_ENABLEMATCH2_Msk , NRF_TWIM_SHORT_RXMATCH2_ENABLERXMATCH3_MASK = TWIM_SHORTS_DMA_RX_MATCH2_DMA_RX_ENABLEMATCH3_Msk , NRF_TWIM_SHORT_RXMATCH3_ENABLERXMATCH0_MASK = TWIM_SHORTS_DMA_RX_MATCH3_DMA_RX_ENABLEMATCH0_Msk , NRF_TWIM_SHORT_RXMATCH0_DISABLERXMATCH0_MASK = TWIM_SHORTS_DMA_RX_MATCH0_DMA_RX_DISABLEMATCH0_Msk , NRF_TWIM_SHORT_RXMATCH1_DISABLERXMATCH1_MASK = TWIM_SHORTS_DMA_RX_MATCH1_DMA_RX_DISABLEMATCH1_Msk , NRF_TWIM_SHORT_RXMATCH2_DISABLERXMATCH2_MASK = TWIM_SHORTS_DMA_RX_MATCH2_DMA_RX_DISABLEMATCH2_Msk , NRF_TWIM_SHORT_RXMATCH3_DISABLERXMATCH3_MASK = TWIM_SHORTS_DMA_RX_MATCH3_DMA_RX_DISABLEMATCH3_Msk , NRF_TWIM_ALL_SHORTS_MASK } |
| TWIM shortcuts. More... | |
| enum | nrf_twim_int_mask_t { NRF_TWIM_INT_STOPPED_MASK = TWIM_INTENSET_STOPPED_Msk , NRF_TWIM_INT_ERROR_MASK = TWIM_INTENSET_ERROR_Msk , NRF_TWIM_INT_SUSPENDED_MASK = TWIM_INTENSET_SUSPENDED_Msk , NRF_TWIM_INT_RXSTARTED_MASK = TWIM_INTENSET_DMARXREADY_Msk , NRF_TWIM_INT_TXSTARTED_MASK = TWIM_INTENSET_DMATXREADY_Msk , NRF_TWIM_INT_ENDRX_MASK = TWIM_INTENSET_DMARXEND_Msk , NRF_TWIM_INT_RXREADY_MASK = TWIM_INTENSET_DMARXREADY_Msk , NRF_TWIM_INT_RXBUSERROR_MASK = TWIM_INTENSET_DMARXBUSERROR_Msk , NRF_TWIM_INT_RXMATCH0_MASK = TWIM_INTENSET_DMARXMATCH0_Msk , NRF_TWIM_INT_RXMATCH1_MASK = TWIM_INTENSET_DMARXMATCH1_Msk , NRF_TWIM_INT_RXMATCH2_MASK = TWIM_INTENSET_DMARXMATCH2_Msk , NRF_TWIM_INT_RXMATCH3_MASK = TWIM_INTENSET_DMARXMATCH3_Msk , NRF_TWIM_INT_ENDTX_MASK = TWIM_INTENSET_DMATXEND_Msk , NRF_TWIM_INT_TXREADY_MASK = TWIM_INTENSET_DMATXREADY_Msk , NRF_TWIM_INT_TXBUSERROR_MASK = TWIM_INTENSET_DMATXBUSERROR_Msk , NRF_TWIM_INT_LASTRX_MASK = TWIM_INTENSET_LASTRX_Msk , NRF_TWIM_INT_LASTTX_MASK = TWIM_INTENSET_LASTTX_Msk , NRF_TWIM_ALL_INTS_MASK } |
| TWIM interrupts. More... | |
| enum | nrf_twim_frequency_t { NRF_TWIM_FREQ_100K = TWIM_FREQUENCY_FREQUENCY_K100 , NRF_TWIM_FREQ_250K = TWIM_FREQUENCY_FREQUENCY_K250 , NRF_TWIM_FREQ_400K = TWIM_FREQUENCY_FREQUENCY_K400 , NRF_TWIM_FREQ_1000K = TWIM_FREQUENCY_FREQUENCY_K1000 } |
| TWIM master clock frequency. More... | |
| enum | nrf_twim_error_t { NRF_TWIM_ERROR_ADDRESS_NACK = TWIM_ERRORSRC_ANACK_Msk , NRF_TWIM_ERROR_DATA_NACK = TWIM_ERRORSRC_DNACK_Msk , NRF_TWIM_ERROR_OVERRUN = TWIM_ERRORSRC_OVERRUN_Msk } |
| TWIM error source. More... | |
Functions | |
| NRF_STATIC_INLINE void | nrf_twim_task_trigger (NRF_TWIM_Type *p_reg, nrf_twim_task_t task) |
| Function for activating the specified TWIM task. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_task_address_get (NRF_TWIM_Type const *p_reg, nrf_twim_task_t task) |
| Function for getting the address of the specified TWIM task register. | |
| NRF_STATIC_INLINE void | nrf_twim_event_clear (NRF_TWIM_Type *p_reg, nrf_twim_event_t event) |
| Function for clearing the specified TWIM event. | |
| NRF_STATIC_INLINE bool | nrf_twim_event_check (NRF_TWIM_Type const *p_reg, nrf_twim_event_t event) |
| Function for retrieving the state of the TWIM event. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_event_address_get (NRF_TWIM_Type const *p_reg, nrf_twim_event_t event) |
| Function for getting the address of the specified TWIM event register. | |
| NRF_STATIC_INLINE void | nrf_twim_shorts_enable (NRF_TWIM_Type *p_reg, uint32_t mask) |
| Function for enabling the specified shortcuts. | |
| NRF_STATIC_INLINE void | nrf_twim_shorts_disable (NRF_TWIM_Type *p_reg, uint32_t mask) |
| Function for disabling the specified shortcuts. | |
| NRF_STATIC_INLINE void | nrf_twim_int_enable (NRF_TWIM_Type *p_reg, uint32_t mask) |
| Function for enabling the specified interrupts. | |
| NRF_STATIC_INLINE void | nrf_twim_int_disable (NRF_TWIM_Type *p_reg, uint32_t mask) |
| Function for disabling the specified interrupts. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_int_enable_check (NRF_TWIM_Type const *p_reg, uint32_t mask) |
| Function for checking if the specified interrupts are enabled. | |
| NRF_STATIC_INLINE void | nrf_twim_subscribe_set (NRF_TWIM_Type *p_reg, nrf_twim_task_t task, uint8_t channel) |
| Function for setting the subscribe configuration for a given TWIM task. | |
| NRF_STATIC_INLINE void | nrf_twim_subscribe_clear (NRF_TWIM_Type *p_reg, nrf_twim_task_t task) |
| Function for clearing the subscribe configuration for a given TWIM task. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_subscribe_get (NRF_TWIM_Type const *p_reg, nrf_twim_task_t task) |
| Function for getting the subscribe configuration for a given TWIM task. | |
| NRF_STATIC_INLINE void | nrf_twim_publish_set (NRF_TWIM_Type *p_reg, nrf_twim_event_t event, uint8_t channel) |
| Function for setting the publish configuration for a given TWIM event. | |
| NRF_STATIC_INLINE void | nrf_twim_publish_clear (NRF_TWIM_Type *p_reg, nrf_twim_event_t event) |
| Function for clearing the publish configuration for a given TWIM event. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_publish_get (NRF_TWIM_Type const *p_reg, nrf_twim_event_t event) |
| Function for getting the publish configuration for a given TWIM event. | |
| NRF_STATIC_INLINE void | nrf_twim_enable (NRF_TWIM_Type *p_reg) |
| Function for enabling the TWIM peripheral. | |
| NRF_STATIC_INLINE void | nrf_twim_disable (NRF_TWIM_Type *p_reg) |
| Function for disabling the TWIM peripheral. | |
| NRF_STATIC_INLINE void | nrf_twim_pins_set (NRF_TWIM_Type *p_reg, uint32_t scl_pin, uint32_t sda_pin) |
| Function for configuring TWI pins. | |
| NRF_STATIC_INLINE void | nrf_twim_scl_pin_set (NRF_TWIM_Type *p_reg, uint32_t pin) |
| Function for setting the SCL pin. | |
| NRF_STATIC_INLINE void | nrf_twim_sda_pin_set (NRF_TWIM_Type *p_reg, uint32_t pin) |
| Function for setting the SDA pin. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_scl_pin_get (NRF_TWIM_Type const *p_reg) |
| Function for retrieving the SCL pin selection. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_sda_pin_get (NRF_TWIM_Type const *p_reg) |
| Function for retrieving the SDA pin selection. | |
| NRF_STATIC_INLINE void | nrf_twim_frequency_set (NRF_TWIM_Type *p_reg, nrf_twim_frequency_t frequency) |
| Function for setting the TWI master clock frequency. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_errorsrc_get_and_clear (NRF_TWIM_Type *p_reg) |
| Function for checking the TWI error source. | |
| NRF_STATIC_INLINE void | nrf_twim_address_set (NRF_TWIM_Type *p_reg, uint8_t address) |
| Function for setting the address to be used in TWI transfers. | |
| NRF_STATIC_INLINE uint8_t | nrf_twim_address_get (NRF_TWIM_Type const *p_reg) |
| Function for getting the address to be used in TWI transfers. | |
| NRF_STATIC_INLINE void | nrf_twim_tx_ptr_set (NRF_TWIM_Type *p_reg, uint8_t const *p_buffer) |
| Function for setting the transmit buffer address. | |
| NRF_STATIC_INLINE void | nrf_twim_tx_maxcnt_set (NRF_TWIM_Type *p_reg, size_t length) |
| Function for setting the transmit buffer length. | |
| NRF_STATIC_INLINE void | nrf_twim_tx_buffer_set (NRF_TWIM_Type *p_reg, uint8_t const *p_buffer, size_t length) |
| Function for setting the transmit buffer. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_ptr_set (NRF_TWIM_Type *p_reg, uint8_t *p_buffer) |
| Function for setting the receive buffer address. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_maxcnt_set (NRF_TWIM_Type *p_reg, size_t length) |
| Function for setting the receive buffer length. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_buffer_set (NRF_TWIM_Type *p_reg, uint8_t *p_buffer, size_t length) |
| Function for setting the receive buffer. | |
| NRF_STATIC_INLINE void | nrf_twim_shorts_set (NRF_TWIM_Type *p_reg, uint32_t mask) |
| Function for setting the specified shortcuts. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_shorts_get (NRF_TWIM_Type const *p_reg) |
| Function for getting the shortcut setting. | |
| NRF_STATIC_INLINE size_t | nrf_twim_txd_amount_get (NRF_TWIM_Type const *p_reg) |
| Function for getting the amount of transmitted bytes. | |
| NRF_STATIC_INLINE size_t | nrf_twim_rxd_amount_get (NRF_TWIM_Type const *p_reg) |
| Function for getting the amount of received bytes in the last transaction. | |
| NRF_STATIC_INLINE size_t | nrf_twim_txd_curr_amount_get (NRF_TWIM_Type const *p_reg) |
| Function for getting the amount of transmitted bytes in the current transaction. | |
| NRF_STATIC_INLINE size_t | nrf_twim_rxd_curr_amount_get (NRF_TWIM_Type const *p_reg) |
| Function for getting the amount of received bytes in the current transaction. | |
| NRF_STATIC_INLINE void | nrf_twim_tx_list_enable (NRF_TWIM_Type *p_reg) |
| Function for enabling the TX list feature. | |
| NRF_STATIC_INLINE void | nrf_twim_tx_list_disable (NRF_TWIM_Type *p_reg) |
| Function for disabling the TX list feature. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_list_enable (NRF_TWIM_Type *p_reg) |
| Function for enabling the RX list feature. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_list_disable (NRF_TWIM_Type *p_reg) |
| Function for disabling the RX list feature. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_pattern_match_enable_set (NRF_TWIM_Type *p_reg, uint8_t index, bool enable) |
| Function for enabling individual pattern match filters. | |
| NRF_STATIC_INLINE bool | nrf_twim_rx_pattern_match_enable_check (NRF_TWIM_Type const *p_reg, uint8_t index) |
| Function for checking if the specified pattern match filter is enabled. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_pattern_match_one_shot_enable (NRF_TWIM_Type *p_reg, uint8_t index) |
| Function for enabling one-shot operation for the specified match filter. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_pattern_match_one_shot_disable (NRF_TWIM_Type *p_reg, uint8_t index) |
| Function for disabling one-shot operation for the specified match filter. | |
| NRF_STATIC_INLINE bool | nrf_twim_rx_pattern_match_one_shot_check (NRF_TWIM_Type const *p_reg, uint8_t index) |
| Function for checking if specified pattern match filter is configured as one-shot. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_pattern_match_candidate_set (NRF_TWIM_Type *p_reg, uint8_t index, uint32_t pattern) |
| Function for setting the pattern to be looked for by the specified match filter. | |
| NRF_STATIC_INLINE uint32_t | nrf_twim_rx_pattern_match_candidate_get (NRF_TWIM_Type const *p_reg, uint8_t index) |
| Function for getting the pattern that the specified match filter is looking for. | |
| NRF_STATIC_INLINE void | nrf_twim_rx_terminate_on_bus_error_enable_set (NRF_TWIM_Type *p_reg, bool enable) |
| Function for enabling RX transaction termination on the detection of a BUSERROR event. | |
| NRF_STATIC_INLINE bool | nrf_twim_rx_terminate_on_bus_error_check (NRF_TWIM_Type const *p_reg) |
| Function for checking if the RX transaction termination on the detection of a BUSERROR event is enabled. | |
| NRF_STATIC_INLINE void | nrf_twim_tx_terminate_on_bus_error_enable_set (NRF_TWIM_Type *p_reg, bool enable) |
| Function for enabling TX transaction termination on the detection of a BUSERROR event. | |
| NRF_STATIC_INLINE bool | nrf_twim_tx_terminate_on_bus_error_check (NRF_TWIM_Type const *p_reg) |
| Function for checking if the TX transaction termination on the detection of a BUSERROR event is enabled. | |
Hardware access layer for managing the TWIM peripheral.
| #define NRF_TWIM_INST_GET | ( | idx | ) |
Macro getting pointer to the structure of registers of the TWIM peripheral.
| [in] | idx | TWIM instance index. |
| enum nrf_twim_error_t |
TWIM error source.
| enum nrf_twim_event_t |
TWIM events.
| enum nrf_twim_frequency_t |
| enum nrf_twim_int_mask_t |
TWIM interrupts.
TWIM shortcuts.
| enum nrf_twim_task_t |
TWIM tasks.
| NRF_STATIC_INLINE uint8_t nrf_twim_address_get | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for getting the address to be used in TWI transfers.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_address_set | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t | address ) |
Function for setting the address to be used in TWI transfers.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | address | Address to be used in transfers. |
| NRF_STATIC_INLINE void nrf_twim_disable | ( | NRF_TWIM_Type * | p_reg | ) |
Function for disabling the TWIM peripheral.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_enable | ( | NRF_TWIM_Type * | p_reg | ) |
Function for enabling the TWIM peripheral.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE uint32_t nrf_twim_errorsrc_get_and_clear | ( | NRF_TWIM_Type * | p_reg | ) |
Function for checking the TWI error source.
The error flags are cleared after reading.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE uint32_t nrf_twim_event_address_get | ( | NRF_TWIM_Type const * | p_reg, |
| nrf_twim_event_t | event ) |
Function for getting the address of the specified TWIM event register.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | The specified event. |
| NRF_STATIC_INLINE bool nrf_twim_event_check | ( | NRF_TWIM_Type const * | p_reg, |
| nrf_twim_event_t | event ) |
Function for retrieving the state of the TWIM 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. |
| NRF_STATIC_INLINE void nrf_twim_event_clear | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_event_t | event ) |
Function for clearing the specified TWIM event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event to clear. |
| NRF_STATIC_INLINE void nrf_twim_frequency_set | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_frequency_t | frequency ) |
Function for setting the TWI master clock frequency.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | frequency | TWI frequency. |
| NRF_STATIC_INLINE void nrf_twim_int_disable | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
Function for disabling the specified interrupts.
| [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. |
| NRF_STATIC_INLINE void nrf_twim_int_enable | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
Function for enabling the specified interrupts.
| [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. |
| NRF_STATIC_INLINE uint32_t nrf_twim_int_enable_check | ( | NRF_TWIM_Type const * | p_reg, |
| uint32_t | mask ) |
Function for checking if the specified interrupts are enabled.
| [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. |
| NRF_STATIC_INLINE void nrf_twim_pins_set | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | scl_pin, | ||
| uint32_t | sda_pin ) |
Function for configuring TWI pins.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | scl_pin | SCL pin number. |
| [in] | sda_pin | SDA pin number. |
| NRF_STATIC_INLINE void nrf_twim_publish_clear | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_event_t | event ) |
Function for clearing the publish configuration for a given TWIM event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to clear the configuration. |
| NRF_STATIC_INLINE uint32_t nrf_twim_publish_get | ( | NRF_TWIM_Type const * | p_reg, |
| nrf_twim_event_t | event ) |
Function for getting the publish configuration for a given TWIM event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | event | Event for which to read the configuration. |
| NRF_STATIC_INLINE void nrf_twim_publish_set | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_event_t | event, | ||
| uint8_t | channel ) |
Function for setting the publish configuration for a given TWIM event.
| [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. |
| NRF_STATIC_INLINE void nrf_twim_rx_buffer_set | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t * | p_buffer, | ||
| size_t | length ) |
Function for setting the receive buffer.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_buffer | Pointer to the buffer for received data. |
| [in] | length | Maximum number of data bytes to receive. |
| NRF_STATIC_INLINE void nrf_twim_rx_list_disable | ( | NRF_TWIM_Type * | p_reg | ) |
Function for disabling the RX list feature.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_rx_list_enable | ( | NRF_TWIM_Type * | p_reg | ) |
Function for enabling the RX list feature.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_rx_maxcnt_set | ( | NRF_TWIM_Type * | p_reg, |
| size_t | length ) |
Function for setting the receive buffer length.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | length | Maximum number of data bytes to receive. |
| NRF_STATIC_INLINE uint32_t nrf_twim_rx_pattern_match_candidate_get | ( | NRF_TWIM_Type const * | p_reg, |
| uint8_t | index ) |
Function for getting the pattern that the specified match filter is looking for.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | index | Index of pattern match filter. |
| NRF_STATIC_INLINE void nrf_twim_rx_pattern_match_candidate_set | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t | index, | ||
| uint32_t | pattern ) |
Function for setting the pattern to be looked for by the specified match filter.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | index | Index of pattern match filter. |
| [in] | pattern | Pattern to be looked for. Match will trigger the corresponding event, if enabled. |
| NRF_STATIC_INLINE bool nrf_twim_rx_pattern_match_enable_check | ( | NRF_TWIM_Type const * | p_reg, |
| uint8_t | index ) |
Function for checking if the specified pattern match filter is enabled.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | index | Index of pattern match filter. |
| true | Pattern match filter is enabled. |
| false | Pattern match filter is disabled. |
| NRF_STATIC_INLINE void nrf_twim_rx_pattern_match_enable_set | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t | index, | ||
| bool | enable ) |
Function for enabling individual pattern match filters.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | index | Index of pattern match filter. |
| [in] | enable | True if pattern match filter is to be enabled, false otherwise. |
| NRF_STATIC_INLINE bool nrf_twim_rx_pattern_match_one_shot_check | ( | NRF_TWIM_Type const * | p_reg, |
| uint8_t | index ) |
Function for checking if specified pattern match filter is configured as one-shot.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | index | Index of pattern match filter. |
| true | Pattern match filter is configured as one-shot. |
| false | Pattern match filter is configured as continuous. |
| NRF_STATIC_INLINE void nrf_twim_rx_pattern_match_one_shot_disable | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t | index ) |
Function for disabling one-shot operation for the specified match filter.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | index | Index of pattern match filter. |
| NRF_STATIC_INLINE void nrf_twim_rx_pattern_match_one_shot_enable | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t | index ) |
Function for enabling one-shot operation for the specified match filter.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | index | Index of pattern match filter. |
| NRF_STATIC_INLINE void nrf_twim_rx_ptr_set | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t * | p_buffer ) |
Function for setting the receive buffer address.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_buffer | Pointer to the buffer for received data. |
| NRF_STATIC_INLINE bool nrf_twim_rx_terminate_on_bus_error_check | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for checking if the RX transaction termination on the detection of a BUSERROR event is enabled.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| true | Transaction termination on BUSERROR event is enabled. |
| false | Transaction termination on BUSERROR event is disabled. |
| NRF_STATIC_INLINE void nrf_twim_rx_terminate_on_bus_error_enable_set | ( | NRF_TWIM_Type * | p_reg, |
| bool | enable ) |
Function for enabling RX transaction termination on the detection of a BUSERROR event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | enable | True if the RX transaction termination is to be enabled, false otherwise. |
| NRF_STATIC_INLINE size_t nrf_twim_rxd_amount_get | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for getting the amount of received bytes in the last transaction.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE size_t nrf_twim_rxd_curr_amount_get | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for getting the amount of received bytes in the current transaction.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE uint32_t nrf_twim_scl_pin_get | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for retrieving the SCL pin selection.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_scl_pin_set | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | pin ) |
Function for setting the SCL pin.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | pin | SCL pin number. |
| NRF_STATIC_INLINE uint32_t nrf_twim_sda_pin_get | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for retrieving the SDA pin selection.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_sda_pin_set | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | pin ) |
Function for setting the SDA pin.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | pin | SDA pin number. |
| NRF_STATIC_INLINE void nrf_twim_shorts_disable | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
Function for disabling the specified shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be disabled. |
| NRF_STATIC_INLINE void nrf_twim_shorts_enable | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
Function for enabling the specified shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be enabled. |
| NRF_STATIC_INLINE uint32_t nrf_twim_shorts_get | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for getting the shortcut setting.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_shorts_set | ( | NRF_TWIM_Type * | p_reg, |
| uint32_t | mask ) |
Function for setting the specified shortcuts.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | mask | Shortcuts to be set. |
| NRF_STATIC_INLINE void nrf_twim_subscribe_clear | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_task_t | task ) |
Function for clearing the subscribe configuration for a given TWIM task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to clear the configuration. |
| NRF_STATIC_INLINE uint32_t nrf_twim_subscribe_get | ( | NRF_TWIM_Type const * | p_reg, |
| nrf_twim_task_t | task ) |
Function for getting the subscribe configuration for a given TWIM task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task for which to read the configuration. |
| NRF_STATIC_INLINE void nrf_twim_subscribe_set | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_task_t | task, | ||
| uint8_t | channel ) |
Function for setting the subscribe configuration for a given TWIM task.
| [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. |
| NRF_STATIC_INLINE uint32_t nrf_twim_task_address_get | ( | NRF_TWIM_Type const * | p_reg, |
| nrf_twim_task_t | task ) |
Function for getting the address of the specified TWIM task register.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | The specified task. |
| NRF_STATIC_INLINE void nrf_twim_task_trigger | ( | NRF_TWIM_Type * | p_reg, |
| nrf_twim_task_t | task ) |
Function for activating the specified TWIM task.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | task | Task to be activated. |
| NRF_STATIC_INLINE void nrf_twim_tx_buffer_set | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t const * | p_buffer, | ||
| size_t | length ) |
Function for setting the transmit buffer.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_buffer | Pointer to the buffer with data to send. |
| [in] | length | Maximum number of data bytes to transmit. |
| NRF_STATIC_INLINE void nrf_twim_tx_list_disable | ( | NRF_TWIM_Type * | p_reg | ) |
Function for disabling the TX list feature.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_tx_list_enable | ( | NRF_TWIM_Type * | p_reg | ) |
Function for enabling the TX list feature.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE void nrf_twim_tx_maxcnt_set | ( | NRF_TWIM_Type * | p_reg, |
| size_t | length ) |
Function for setting the transmit buffer length.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | length | Maximum number of data bytes to transmit. |
| NRF_STATIC_INLINE void nrf_twim_tx_ptr_set | ( | NRF_TWIM_Type * | p_reg, |
| uint8_t const * | p_buffer ) |
Function for setting the transmit buffer address.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | p_buffer | Pointer to the buffer with data to send. |
| NRF_STATIC_INLINE bool nrf_twim_tx_terminate_on_bus_error_check | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for checking if the TX transaction termination on the detection of a BUSERROR event is enabled.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| true | Transaction termination on BUSERROR event is enabled. |
| false | Transaction termination on BUSERROR event is disabled. |
| NRF_STATIC_INLINE void nrf_twim_tx_terminate_on_bus_error_enable_set | ( | NRF_TWIM_Type * | p_reg, |
| bool | enable ) |
Function for enabling TX transaction termination on the detection of a BUSERROR event.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| [in] | enable | True if the TX transaction termination is to be enabled, false otherwise. |
| NRF_STATIC_INLINE size_t nrf_twim_txd_amount_get | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for getting the amount of transmitted bytes.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |
| NRF_STATIC_INLINE size_t nrf_twim_txd_curr_amount_get | ( | NRF_TWIM_Type const * | p_reg | ) |
Function for getting the amount of transmitted bytes in the current transaction.
| [in] | p_reg | Pointer to the structure of registers of the peripheral. |