nrfx 2.5
Typedefs | Enumerations | Functions
TWIS HAL

Hardware access layer for managing the Two Wire Interface Slave with EasyDMA (TWIS) peripheral. More...

Typedefs

typedef uint8_t nrf_twis_address_t
 Smallest variable type to hold the TWI address. More...
 

Enumerations

enum  nrf_twis_task_t {
  NRF_TWIS_TASK_STOP = offsetof(NRF_TWIS_Type, TASKS_STOP),
  NRF_TWIS_TASK_SUSPEND = offsetof(NRF_TWIS_Type, TASKS_SUSPEND),
  NRF_TWIS_TASK_RESUME = offsetof(NRF_TWIS_Type, TASKS_RESUME),
  NRF_TWIS_TASK_PREPARERX = offsetof(NRF_TWIS_Type, TASKS_PREPARERX),
  NRF_TWIS_TASK_PREPARETX = offsetof(NRF_TWIS_Type, TASKS_PREPARETX)
}
 TWIS tasks. More...
 
enum  nrf_twis_event_t {
  NRF_TWIS_EVENT_STOPPED = offsetof(NRF_TWIS_Type, EVENTS_STOPPED),
  NRF_TWIS_EVENT_ERROR = offsetof(NRF_TWIS_Type, EVENTS_ERROR),
  NRF_TWIS_EVENT_RXSTARTED = offsetof(NRF_TWIS_Type, EVENTS_RXSTARTED),
  NRF_TWIS_EVENT_TXSTARTED = offsetof(NRF_TWIS_Type, EVENTS_TXSTARTED),
  NRF_TWIS_EVENT_WRITE = offsetof(NRF_TWIS_Type, EVENTS_WRITE),
  NRF_TWIS_EVENT_READ = offsetof(NRF_TWIS_Type, EVENTS_READ)
}
 TWIS events. More...
 
enum  nrf_twis_short_mask_t {
  NRF_TWIS_SHORT_WRITE_SUSPEND_MASK = TWIS_SHORTS_WRITE_SUSPEND_Msk,
  NRF_TWIS_SHORT_READ_SUSPEND_MASK = TWIS_SHORTS_READ_SUSPEND_Msk
}
 TWIS shortcuts. More...
 
enum  nrf_twis_int_mask_t {
  NRF_TWIS_INT_STOPPED_MASK = TWIS_INTEN_STOPPED_Msk,
  NRF_TWIS_INT_ERROR_MASK = TWIS_INTEN_ERROR_Msk,
  NRF_TWIS_INT_RXSTARTED_MASK = TWIS_INTEN_RXSTARTED_Msk,
  NRF_TWIS_INT_TXSTARTED_MASK = TWIS_INTEN_TXSTARTED_Msk,
  NRF_TWIS_INT_WRITE_MASK = TWIS_INTEN_WRITE_Msk,
  NRF_TWIS_INT_READ_MASK = TWIS_INTEN_READ_Msk
}
 TWIS interrupts. More...
 
enum  nrf_twis_error_t {
  NRF_TWIS_ERROR_OVERFLOW = TWIS_ERRORSRC_OVERFLOW_Msk,
  NRF_TWIS_ERROR_DATA_NACK = TWIS_ERRORSRC_DNACK_Msk,
  NRF_TWIS_ERROR_OVERREAD = TWIS_ERRORSRC_OVERREAD_Msk
}
 TWIS error source. More...
 
enum  nrf_twis_config_addr_mask_t {
  NRF_TWIS_CONFIG_ADDRESS0_MASK = TWIS_CONFIG_ADDRESS0_Msk,
  NRF_TWIS_CONFIG_ADDRESS1_MASK = TWIS_CONFIG_ADDRESS1_Msk,
  NRF_TWIS_CONFIG_ADDRESS01_MASK = TWIS_CONFIG_ADDRESS0_Msk | TWIS_CONFIG_ADDRESS1_Msk
}
 TWIS address matching configuration. More...
 

Functions

NRF_STATIC_INLINE void nrf_twis_task_trigger (NRF_TWIS_Type *p_reg, nrf_twis_task_t task)
 Function for activating the specified TWIS task. More...
 
NRF_STATIC_INLINE uint32_t nrf_twis_task_address_get (NRF_TWIS_Type const *p_reg, nrf_twis_task_t task)
 Function for returning the address of the specified TWIS task register. More...
 
NRF_STATIC_INLINE void nrf_twis_event_clear (NRF_TWIS_Type *p_reg, nrf_twis_event_t event)
 Function for clearing the specified event. More...
 
NRF_STATIC_INLINE bool nrf_twis_event_check (NRF_TWIS_Type const *p_reg, nrf_twis_event_t event)
 Function for retrieving the state of the TWIS event. More...
 
NRF_STATIC_INLINE bool nrf_twis_event_get_and_clear (NRF_TWIS_Type *p_reg, nrf_twis_event_t event)
 Function for getting and clearing the state of the specified event. More...
 
NRF_STATIC_INLINE uint32_t nrf_twis_event_address_get (NRF_TWIS_Type const *p_reg, nrf_twis_event_t event)
 Function for returning the address of the specified TWIS event register. More...
 
NRF_STATIC_INLINE void nrf_twis_shorts_enable (NRF_TWIS_Type *p_reg, uint32_t mask)
 Function for setting a shortcut. More...
 
NRF_STATIC_INLINE void nrf_twis_shorts_disable (NRF_TWIS_Type *p_reg, uint32_t mask)
 Function for clearing shortcuts. More...
 
NRF_STATIC_INLINE uint32_t nrf_twis_shorts_get (NRF_TWIS_Type const *p_reg)
 Function for getting the shorts mask. More...
 
NRF_STATIC_INLINE void nrf_twis_int_enable (NRF_TWIS_Type *p_reg, uint32_t mask)
 Function for enabling the specified interrupts. More...
 
NRF_STATIC_INLINE uint32_t nrf_twis_int_enable_check (NRF_TWIS_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled. More...
 
NRF_STATIC_INLINE void nrf_twis_int_disable (NRF_TWIS_Type *p_reg, uint32_t mask)
 Function for disabling the specified interrupts. More...
 
NRF_STATIC_INLINE void nrf_twis_subscribe_set (NRF_TWIS_Type *p_reg, nrf_twis_task_t task, uint8_t channel)
 Function for setting the subscribe configuration for a given TWIS task. More...
 
NRF_STATIC_INLINE void nrf_twis_subscribe_clear (NRF_TWIS_Type *p_reg, nrf_twis_task_t task)
 Function for clearing the subscribe configuration for a given TWIS task. More...
 
NRF_STATIC_INLINE void nrf_twis_publish_set (NRF_TWIS_Type *p_reg, nrf_twis_event_t event, uint8_t channel)
 Function for setting the publish configuration for a given TWIS event. More...
 
NRF_STATIC_INLINE void nrf_twis_publish_clear (NRF_TWIS_Type *p_reg, nrf_twis_event_t event)
 Function for clearing the publish configuration for a given TWIS event. More...
 
NRF_STATIC_INLINE uint32_t nrf_twis_error_source_get_and_clear (NRF_TWIS_Type *p_reg)
 Function for retrieving and clearing the TWIS error source. More...
 
NRF_STATIC_INLINE uint_fast8_t nrf_twis_match_get (NRF_TWIS_Type const *p_reg)
 Function for getting information about which of the addresses matched. More...
 
NRF_STATIC_INLINE void nrf_twis_enable (NRF_TWIS_Type *p_reg)
 Function for enabling TWIS. More...
 
NRF_STATIC_INLINE void nrf_twis_disable (NRF_TWIS_Type *p_reg)
 Function for disabling TWIS. More...
 
NRF_STATIC_INLINE void nrf_twis_pins_set (NRF_TWIS_Type *p_reg, uint32_t scl, uint32_t sda)
 Function for configuring TWIS pins. More...
 
NRF_STATIC_INLINE uint32_t nrf_twis_scl_pin_get (NRF_TWIS_Type const *p_reg)
 Function for retrieving the SCL pin selection. More...
 
NRF_STATIC_INLINE uint32_t nrf_twis_sda_pin_get (NRF_TWIS_Type const *p_reg)
 Function for retrieving the SDA pin selection. More...
 
NRF_STATIC_INLINE void nrf_twis_rx_buffer_set (NRF_TWIS_Type *p_reg, uint8_t *p_buf, size_t length)
 Function for setting the receive buffer. More...
 
NRF_STATIC_INLINE void nrf_twis_rx_prepare (NRF_TWIS_Type *p_reg, uint8_t *p_buf, size_t length)
 Function that prepares TWIS for receiving. More...
 
NRF_STATIC_INLINE size_t nrf_twis_rx_amount_get (NRF_TWIS_Type const *p_reg)
 Function for getting number of bytes received in the last transaction. More...
 
NRF_STATIC_INLINE void nrf_twis_tx_buffer_set (NRF_TWIS_Type *p_reg, uint8_t const *p_buf, size_t length)
 Function for setting the transmit buffer. More...
 
NRF_STATIC_INLINE void nrf_twis_tx_prepare (NRF_TWIS_Type *p_reg, uint8_t const *p_buf, size_t length)
 Function for preparing TWIS for transmitting. More...
 
NRF_STATIC_INLINE size_t nrf_twis_tx_amount_get (NRF_TWIS_Type const *p_reg)
 Function for getting the number of bytes transmitted in the last transaction. More...
 
NRF_STATIC_INLINE void nrf_twis_address_set (NRF_TWIS_Type *p_reg, uint_fast8_t n, nrf_twis_address_t addr)
 Function for setting the slave address. More...
 
NRF_STATIC_INLINE nrf_twis_address_t nrf_twis_address_get (NRF_TWIS_Type const *p_reg, uint_fast8_t n)
 Function for retrieving configured slave address. More...
 
NRF_STATIC_INLINE void nrf_twis_config_address_set (NRF_TWIS_Type *p_reg, nrf_twis_config_addr_mask_t addr_mask)
 Function for setting the device address configuration. More...
 
NRF_STATIC_INLINE nrf_twis_config_addr_mask_t nrf_twis_config_address_get (NRF_TWIS_Type const *p_reg)
 Function for retrieving the device address configuration. More...
 
NRF_STATIC_INLINE void nrf_twis_orc_set (NRF_TWIS_Type *p_reg, uint8_t orc)
 Function for setting the over-read character. More...
 
NRF_STATIC_INLINE uint8_t nrf_twis_orc_get (NRF_TWIS_Type const *p_reg)
 Function for setting the over-read character. More...
 
NRF_STATIC_INLINE void nrf_twis_tx_list_enable (NRF_TWIS_Type *p_reg)
 Function for enabling the TX list feature. More...
 
NRF_STATIC_INLINE void nrf_twis_tx_list_disable (NRF_TWIS_Type *p_reg)
 Function for disabling the TX list feature. More...
 
NRF_STATIC_INLINE void nrf_twis_rx_list_enable (NRF_TWIS_Type *p_reg)
 Function for enabling the RX list feature. More...
 
NRF_STATIC_INLINE void nrf_twis_rx_list_disable (NRF_TWIS_Type *p_reg)
 Function for disabling the RX list feature. More...
 

Detailed Description

Hardware access layer for managing the Two Wire Interface Slave with EasyDMA (TWIS) peripheral.

Typedef Documentation

◆ nrf_twis_address_t

typedef uint8_t nrf_twis_address_t

Smallest variable type to hold the TWI address.

Variable of the minimum size that can hold a single TWI address.

Note
Defined to make it simple to change if the new TWI supports for example 10 bit addressing mode.

Enumeration Type Documentation

◆ nrf_twis_config_addr_mask_t

TWIS address matching configuration.

Enumerator
NRF_TWIS_CONFIG_ADDRESS0_MASK 

Enable or disable address matching on ADDRESS[0].

NRF_TWIS_CONFIG_ADDRESS1_MASK 

Enable or disable address matching on ADDRESS[1].

NRF_TWIS_CONFIG_ADDRESS01_MASK 

Enable both address matching.

◆ nrf_twis_error_t

TWIS error source.

Enumerator
NRF_TWIS_ERROR_OVERFLOW 

RX buffer overflow detected, and prevented.

NRF_TWIS_ERROR_DATA_NACK 

NACK sent after receiving a data byte.

NRF_TWIS_ERROR_OVERREAD 

TX buffer over-read detected, and prevented.

◆ nrf_twis_event_t

TWIS events.

Enumerator
NRF_TWIS_EVENT_STOPPED 

TWIS stopped.

NRF_TWIS_EVENT_ERROR 

TWIS error.

NRF_TWIS_EVENT_RXSTARTED 

Receive sequence started.

NRF_TWIS_EVENT_TXSTARTED 

Transmit sequence started.

NRF_TWIS_EVENT_WRITE 

Write command received.

NRF_TWIS_EVENT_READ 

Read command received.

◆ nrf_twis_int_mask_t

TWIS interrupts.

Enumerator
NRF_TWIS_INT_STOPPED_MASK 

Interrupt on STOPPED event.

NRF_TWIS_INT_ERROR_MASK 

Interrupt on ERROR event.

NRF_TWIS_INT_RXSTARTED_MASK 

Interrupt on RXSTARTED event.

NRF_TWIS_INT_TXSTARTED_MASK 

Interrupt on TXSTARTED event.

NRF_TWIS_INT_WRITE_MASK 

Interrupt on WRITE event.

NRF_TWIS_INT_READ_MASK 

Interrupt on READ event.

◆ nrf_twis_short_mask_t

TWIS shortcuts.

Enumerator
NRF_TWIS_SHORT_WRITE_SUSPEND_MASK 

Shortcut between WRITE event and SUSPEND task.

NRF_TWIS_SHORT_READ_SUSPEND_MASK 

Shortcut between READ event and SUSPEND task.

◆ nrf_twis_task_t

TWIS tasks.

Enumerator
NRF_TWIS_TASK_STOP 

Stop TWIS transaction.

NRF_TWIS_TASK_SUSPEND 

Suspend TWIS transaction.

NRF_TWIS_TASK_RESUME 

Resume TWIS transaction.

NRF_TWIS_TASK_PREPARERX 

Prepare the TWIS slave to respond to a write command.

NRF_TWIS_TASK_PREPARETX 

Prepare the TWIS slave to respond to a read command.

Function Documentation

◆ nrf_twis_address_get()

NRF_STATIC_INLINE nrf_twis_address_t nrf_twis_address_get ( NRF_TWIS_Type const *  p_reg,
uint_fast8_t  n 
)

Function for retrieving configured slave address.

Function gets the selected address for this TWI interface.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]nIndex of address to get.
Returns
Configured slave address.

◆ nrf_twis_address_set()

NRF_STATIC_INLINE void nrf_twis_address_set ( NRF_TWIS_Type *  p_reg,
uint_fast8_t  n,
nrf_twis_address_t  addr 
)

Function for setting the slave address.

Function sets the selected address for this TWI interface.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]nIndex of address to be set.
[in]addrAddres to be set.
See also
nrf_twis_config_address_set
nrf_twis_config_address_get

◆ nrf_twis_config_address_get()

NRF_STATIC_INLINE nrf_twis_config_addr_mask_t nrf_twis_config_address_get ( NRF_TWIS_Type const *  p_reg)

Function for retrieving the device address configuration.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Mask of address indexes of what device should answer to.

◆ nrf_twis_config_address_set()

NRF_STATIC_INLINE void nrf_twis_config_address_set ( NRF_TWIS_Type *  p_reg,
nrf_twis_config_addr_mask_t  addr_mask 
)

Function for setting the device address configuration.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]addr_maskMask of address indexes of what device should answer to.
See also
nrf_twis_address_set

◆ nrf_twis_disable()

NRF_STATIC_INLINE void nrf_twis_disable ( NRF_TWIS_Type *  p_reg)

Function for disabling TWIS.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_twis_enable()

NRF_STATIC_INLINE void nrf_twis_enable ( NRF_TWIS_Type *  p_reg)

Function for enabling TWIS.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_twis_error_source_get_and_clear()

NRF_STATIC_INLINE uint32_t nrf_twis_error_source_get_and_clear ( NRF_TWIS_Type *  p_reg)

Function for retrieving and clearing the TWIS error source.

Attention
Error sources are cleared after read.
Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Error source mask with values from nrf_twis_error_t.

◆ nrf_twis_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_twis_event_address_get ( NRF_TWIS_Type const *  p_reg,
nrf_twis_event_t  event 
)

Function for returning the address of the specified TWIS event register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent.
Returns
Address.

◆ nrf_twis_event_check()

NRF_STATIC_INLINE bool nrf_twis_event_check ( NRF_TWIS_Type const *  p_reg,
nrf_twis_event_t  event 
)

Function for retrieving the state of the TWIS event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueThe event has been generated.
falseThe event has not been generated.

◆ nrf_twis_event_clear()

NRF_STATIC_INLINE void nrf_twis_event_clear ( NRF_TWIS_Type *  p_reg,
nrf_twis_event_t  event 
)

Function for clearing the specified event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventThe specified event.

◆ nrf_twis_event_get_and_clear()

NRF_STATIC_INLINE bool nrf_twis_event_get_and_clear ( NRF_TWIS_Type *  p_reg,
nrf_twis_event_t  event 
)

Function for getting and clearing the state of the specified event.

This function checks the state of the event and clears it.

Parameters
[in,out]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent.
Return values
trueThe event was set.
falseThe event was not set.

◆ nrf_twis_int_disable()

NRF_STATIC_INLINE void nrf_twis_int_disable ( NRF_TWIS_Type *  p_reg,
uint32_t  mask 
)

Function for disabling the specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be disabled.

◆ nrf_twis_int_enable()

NRF_STATIC_INLINE void nrf_twis_int_enable ( NRF_TWIS_Type *  p_reg,
uint32_t  mask 
)

Function for enabling the specified interrupts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be enabled.

◆ nrf_twis_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_twis_int_enable_check ( NRF_TWIS_Type const *  p_reg,
uint32_t  mask 
)

Function for checking if the specified interrupts are enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of interrupts to be checked.
Returns
Mask of enabled interrupts.

◆ nrf_twis_match_get()

NRF_STATIC_INLINE uint_fast8_t nrf_twis_match_get ( NRF_TWIS_Type const *  p_reg)

Function for getting information about which of the addresses matched.

Function returns index in the address table that points to the address that already matched.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Index of matched address.

◆ nrf_twis_orc_get()

NRF_STATIC_INLINE uint8_t nrf_twis_orc_get ( NRF_TWIS_Type const *  p_reg)

Function for setting the over-read character.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Over-read character configured for selected instance.

◆ nrf_twis_orc_set()

NRF_STATIC_INLINE void nrf_twis_orc_set ( NRF_TWIS_Type *  p_reg,
uint8_t  orc 
)

Function for setting the over-read character.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]orcOver-read character. Character clocked out in case of over-read of the TXD buffer.

◆ nrf_twis_pins_set()

NRF_STATIC_INLINE void nrf_twis_pins_set ( NRF_TWIS_Type *  p_reg,
uint32_t  scl,
uint32_t  sda 
)

Function for configuring TWIS pins.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]sclSCL pin number.
[in]sdaSDA pin number.

◆ nrf_twis_publish_clear()

NRF_STATIC_INLINE void nrf_twis_publish_clear ( NRF_TWIS_Type *  p_reg,
nrf_twis_event_t  event 
)

Function for clearing the publish configuration for a given TWIS event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to clear the configuration.

◆ nrf_twis_publish_set()

NRF_STATIC_INLINE void nrf_twis_publish_set ( NRF_TWIS_Type *  p_reg,
nrf_twis_event_t  event,
uint8_t  channel 
)

Function for setting the publish configuration for a given TWIS event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to set the configuration.
[in]channelChannel through which to publish the event.

◆ nrf_twis_rx_amount_get()

NRF_STATIC_INLINE size_t nrf_twis_rx_amount_get ( NRF_TWIS_Type const *  p_reg)

Function for getting number of bytes received in the last transaction.

Parameters
[in]p_regTWIS instance.
Returns
Amount of bytes received.

◆ nrf_twis_rx_buffer_set()

NRF_STATIC_INLINE void nrf_twis_rx_buffer_set ( NRF_TWIS_Type *  p_reg,
uint8_t *  p_buf,
size_t  length 
)

Function for setting the receive buffer.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufPointer to the buffer for received data.
[in]lengthMaximum number of data bytes to receive.

◆ nrf_twis_rx_list_disable()

NRF_STATIC_INLINE void nrf_twis_rx_list_disable ( NRF_TWIS_Type *  p_reg)

Function for disabling the RX list feature.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_twis_rx_list_enable()

NRF_STATIC_INLINE void nrf_twis_rx_list_enable ( NRF_TWIS_Type *  p_reg)

Function for enabling the RX list feature.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_twis_rx_prepare()

NRF_STATIC_INLINE void nrf_twis_rx_prepare ( NRF_TWIS_Type *  p_reg,
uint8_t *  p_buf,
size_t  length 
)

Function that prepares TWIS for receiving.

This function sets receive buffer and then sets NRF_TWIS_TASK_PREPARERX task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufPointer to the buffer for received data.
[in]lengthMaximum number of data bytes to receive.

◆ nrf_twis_scl_pin_get()

NRF_STATIC_INLINE uint32_t nrf_twis_scl_pin_get ( NRF_TWIS_Type const *  p_reg)

Function for retrieving the SCL pin selection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
SCL pin selection.

◆ nrf_twis_sda_pin_get()

NRF_STATIC_INLINE uint32_t nrf_twis_sda_pin_get ( NRF_TWIS_Type const *  p_reg)

Function for retrieving the SDA pin selection.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
SDA pin selection.

◆ nrf_twis_shorts_disable()

NRF_STATIC_INLINE void nrf_twis_shorts_disable ( NRF_TWIS_Type *  p_reg,
uint32_t  mask 
)

Function for clearing shortcuts.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts to be disabled.

◆ nrf_twis_shorts_enable()

NRF_STATIC_INLINE void nrf_twis_shorts_enable ( NRF_TWIS_Type *  p_reg,
uint32_t  mask 
)

Function for setting a shortcut.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maskMask of shortcuts to be enabled.

◆ nrf_twis_shorts_get()

NRF_STATIC_INLINE uint32_t nrf_twis_shorts_get ( NRF_TWIS_Type const *  p_reg)

Function for getting the shorts mask.

Function returns shorts register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Flags of currently enabled shortcuts

◆ nrf_twis_subscribe_clear()

NRF_STATIC_INLINE void nrf_twis_subscribe_clear ( NRF_TWIS_Type *  p_reg,
nrf_twis_task_t  task 
)

Function for clearing the subscribe configuration for a given TWIS task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to clear the configuration.

◆ nrf_twis_subscribe_set()

NRF_STATIC_INLINE void nrf_twis_subscribe_set ( NRF_TWIS_Type *  p_reg,
nrf_twis_task_t  task,
uint8_t  channel 
)

Function for setting the subscribe configuration for a given TWIS task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to set the configuration.
[in]channelChannel through which to subscribe events.

◆ nrf_twis_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_twis_task_address_get ( NRF_TWIS_Type const *  p_reg,
nrf_twis_task_t  task 
)

Function for returning the address of the specified TWIS task register.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskThe specified task.
Returns
Task address.

◆ nrf_twis_task_trigger()

NRF_STATIC_INLINE void nrf_twis_task_trigger ( NRF_TWIS_Type *  p_reg,
nrf_twis_task_t  task 
)

Function for activating the specified TWIS task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask to be activated.

◆ nrf_twis_tx_amount_get()

NRF_STATIC_INLINE size_t nrf_twis_tx_amount_get ( NRF_TWIS_Type const *  p_reg)

Function for getting the number of bytes transmitted in the last transaction.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Amount of bytes transmitted.

◆ nrf_twis_tx_buffer_set()

NRF_STATIC_INLINE void nrf_twis_tx_buffer_set ( NRF_TWIS_Type *  p_reg,
uint8_t const *  p_buf,
size_t  length 
)

Function for setting the transmit buffer.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufPointer to the buffer with data to send.
[in]lengthMaximum number of data bytes to transmit.

◆ nrf_twis_tx_list_disable()

NRF_STATIC_INLINE void nrf_twis_tx_list_disable ( NRF_TWIS_Type *  p_reg)

Function for disabling the TX list feature.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_twis_tx_list_enable()

NRF_STATIC_INLINE void nrf_twis_tx_list_enable ( NRF_TWIS_Type *  p_reg)

Function for enabling the TX list feature.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.

◆ nrf_twis_tx_prepare()

NRF_STATIC_INLINE void nrf_twis_tx_prepare ( NRF_TWIS_Type *  p_reg,
uint8_t const *  p_buf,
size_t  length 
)

Function for preparing TWIS for transmitting.

This function sets transmit buffer and then sets NRF_TWIS_TASK_PREPARETX task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufPointer to the buffer with data to send.
[in]lengthMaximum number of data bytes to transmit.

Documentation feedback | Developer Zone | Subscribe | Updated