nrfx 3.3
Macros | Enumerations | Functions
SPIS HAL

Hardware access layer for managing the SPIS peripheral. More...

Macros

#define NRF_SPIS_HAS_DMA_REG   1
 Symbol indicating whether dedicated DMA register is present.
 
#define NRF_SPIS_HAS_DMA_TASKS_EVENTS   1
 Symbol indicating whether SPIS DMA tasks and events are present.
 
#define NRF_SPIS_DMA_RX_PATTERN_MAX_COUNT   SPIS_DMA_RX_MATCH_CANDIDATE_MaxCount
 Maximum number of RX patterns.
 
#define NRF_SPIS_INST_GET(idx)   NRFX_CONCAT(NRF_, SPIS, idx)
 Macro getting pointer to the structure of registers of the SPIS peripheral.
 
#define NRF_SPIS_PIN_NOT_CONNECTED   0xFFFFFFFF
 This value can be used as a parameter for the nrf_spis_pins_set function to specify that a given SPI signal (SCK, MOSI, or MISO) shall not be connected to a physical pin.
 

Enumerations

enum  nrf_spis_task_t {
  NRF_SPIS_TASK_ACQUIRE = offsetof(NRF_SPIS_Type, TASKS_ACQUIRE) ,
  NRF_SPIS_TASK_RELEASE = offsetof(NRF_SPIS_Type, TASKS_RELEASE) ,
  NRF_SPIS_TASK_ENABLERXMATCH0 = offsetof(NRF_SPIS_Type, TASKS_DMA.RX.ENABLEMATCH[0]) ,
  NRF_SPIS_TASK_ENABLERXMATCH1 = offsetof(NRF_SPIS_Type, TASKS_DMA.RX.ENABLEMATCH[1]) ,
  NRF_SPIS_TASK_ENABLERXMATCH2 = offsetof(NRF_SPIS_Type, TASKS_DMA.RX.ENABLEMATCH[2]) ,
  NRF_SPIS_TASK_ENABLERXMATCH3 = offsetof(NRF_SPIS_Type, TASKS_DMA.RX.ENABLEMATCH[3]) ,
  NRF_SPIS_TASK_DISABLERXMATCH0 = offsetof(NRF_SPIS_Type, TASKS_DMA.RX.DISABLEMATCH[0]) ,
  NRF_SPIS_TASK_DISABLERXMATCH1 = offsetof(NRF_SPIS_Type, TASKS_DMA.RX.DISABLEMATCH[1]) ,
  NRF_SPIS_TASK_DISABLERXMATCH2 = offsetof(NRF_SPIS_Type, TASKS_DMA.RX.DISABLEMATCH[2]) ,
  NRF_SPIS_TASK_DISABLERXMATCH3 = offsetof(NRF_SPIS_Type, TASKS_DMA.RX.DISABLEMATCH[3])
}
 SPIS tasks. More...
 
enum  nrf_spis_event_t {
  NRF_SPIS_EVENT_RXSTARTED = offsetof(NRF_SPIS_Type, EVENTS_DMA.RX.READY) ,
  NRF_SPIS_EVENT_RXBUSERROR = offsetof(NRF_SPIS_Type, EVENTS_DMA.RX.BUSERROR) ,
  NRF_SPIS_EVENT_RXMATCH0 = offsetof(NRF_SPIS_Type, EVENTS_DMA.RX.MATCH[0]) ,
  NRF_SPIS_EVENT_RXMATCH1 = offsetof(NRF_SPIS_Type, EVENTS_DMA.RX.MATCH[1]) ,
  NRF_SPIS_EVENT_RXMATCH2 = offsetof(NRF_SPIS_Type, EVENTS_DMA.RX.MATCH[2]) ,
  NRF_SPIS_EVENT_RXMATCH3 = offsetof(NRF_SPIS_Type, EVENTS_DMA.RX.MATCH[3]) ,
  NRF_SPIS_EVENT_TXSTARTED = offsetof(NRF_SPIS_Type, EVENTS_DMA.TX.READY) ,
  NRF_SPIS_EVENT_TXBUSERROR = offsetof(NRF_SPIS_Type, EVENTS_DMA.TX.BUSERROR) ,
  NRF_SPIS_EVENT_ENDRX = offsetof(NRF_SPIS_Type, EVENTS_DMA.RX.END) ,
  NRF_SPIS_EVENT_ENDTX = offsetof(NRF_SPIS_Type, EVENTS_DMA.TX.END) ,
  NRF_SPIS_EVENT_END = offsetof(NRF_SPIS_Type, EVENTS_END) ,
  NRF_SPIS_EVENT_ACQUIRED = offsetof(NRF_SPIS_Type, EVENTS_ACQUIRED)
}
 SPIS events. More...
 
enum  nrf_spis_short_mask_t {
  NRF_SPIS_SHORT_END_ACQUIRE = SPIS_SHORTS_END_ACQUIRE_Msk ,
  NRF_SPIS_SHORT_RXMATCH0_ENABLERXMATCH1_MASK = SPIS_SHORTS_DMA_RX_MATCH0_DMA_RX_ENABLEMATCH1_Msk ,
  NRF_SPIS_SHORT_RXMATCH1_ENABLERXMATCH2_MASK = SPIS_SHORTS_DMA_RX_MATCH1_DMA_RX_ENABLEMATCH2_Msk ,
  NRF_SPIS_SHORT_RXMATCH2_ENABLERXMATCH3_MASK = SPIS_SHORTS_DMA_RX_MATCH2_DMA_RX_ENABLEMATCH3_Msk ,
  NRF_SPIS_SHORT_RXMATCH3_ENABLERXMATCH0_MASK = SPIS_SHORTS_DMA_RX_MATCH3_DMA_RX_ENABLEMATCH0_Msk ,
  NRF_SPIS_SHORT_RXMATCH0_DISABLERXMATCH0_MASK = SPIS_SHORTS_DMA_RX_MATCH0_DMA_RX_DISABLEMATCH0_Msk ,
  NRF_SPIS_SHORT_RXMATCH1_DISABLERXMATCH1_MASK = SPIS_SHORTS_DMA_RX_MATCH1_DMA_RX_DISABLEMATCH1_Msk ,
  NRF_SPIS_SHORT_RXMATCH2_DISABLERXMATCH2_MASK = SPIS_SHORTS_DMA_RX_MATCH2_DMA_RX_DISABLEMATCH2_Msk ,
  NRF_SPIS_SHORT_RXMATCH3_DISABLERXMATCH3_MASK = SPIS_SHORTS_DMA_RX_MATCH3_DMA_RX_DISABLEMATCH3_Msk ,
  NRF_SPIS_ALL_SHORTS_MASK
}
 SPIS shortcuts. More...
 
enum  nrf_spis_int_mask_t {
  NRF_SPIS_INT_END_MASK = SPIS_INTENSET_END_Msk ,
  NRF_SPIS_INT_ACQUIRED_MASK = SPIS_INTENSET_ACQUIRED_Msk ,
  NRF_SPIS_INT_RXREADY_MASK = SPIS_INTENSET_DMARXREADY_Msk ,
  NRF_SPIS_INT_RXBUSERROR_MASK = SPIS_INTENSET_DMARXBUSERROR_Msk ,
  NRF_SPIS_INT_RXMATCH0_MASK = SPIS_INTENSET_DMARXMATCH0_Msk ,
  NRF_SPIS_INT_RXMATCH1_MASK = SPIS_INTENSET_DMARXMATCH1_Msk ,
  NRF_SPIS_INT_RXMATCH2_MASK = SPIS_INTENSET_DMARXMATCH2_Msk ,
  NRF_SPIS_INT_RXMATCH3_MASK = SPIS_INTENSET_DMARXMATCH3_Msk ,
  NRF_SPIS_INT_TXREADY_MASK = SPIS_INTENSET_DMATXREADY_Msk ,
  NRF_SPIS_INT_TXBUSERROR_MASK = SPIS_INTENSET_DMATXBUSERROR_Msk ,
  NRF_SPIS_INT_ENDRX_MASK = SPIS_INTENSET_DMARXEND_Msk ,
  NRF_SPIS_INT_ENDTX_MASK = SPIS_INTENSET_DMATXEND_Msk ,
  NRF_SPIS_ALL_INTS_MASK
}
 SPIS interrupts. More...
 
enum  nrf_spis_mode_t {
  NRF_SPIS_MODE_0 ,
  NRF_SPIS_MODE_1 ,
  NRF_SPIS_MODE_2 ,
  NRF_SPIS_MODE_3
}
 SPI modes. More...
 
enum  nrf_spis_bit_order_t {
  NRF_SPIS_BIT_ORDER_MSB_FIRST = SPIS_CONFIG_ORDER_MsbFirst ,
  NRF_SPIS_BIT_ORDER_LSB_FIRST = SPIS_CONFIG_ORDER_LsbFirst
}
 SPI bit orders. More...
 
enum  nrf_spis_semstat_t {
  NRF_SPIS_SEMSTAT_FREE = 0 ,
  NRF_SPIS_SEMSTAT_CPU = 1 ,
  NRF_SPIS_SEMSTAT_SPIS = 2 ,
  NRF_SPIS_SEMSTAT_CPUPENDING = 3
}
 SPI semaphore status. More...
 
enum  nrf_spis_status_mask_t {
  NRF_SPIS_STATUS_OVERREAD = SPIS_STATUS_OVERREAD_Msk ,
  NRF_SPIS_STATUS_OVERFLOW = SPIS_STATUS_OVERFLOW_Msk
}
 SPIS status. More...
 

Functions

NRF_STATIC_INLINE void nrf_spis_task_trigger (NRF_SPIS_Type *p_reg, nrf_spis_task_t task)
 Function for activating the specified SPIS task.
 
NRF_STATIC_INLINE uint32_t nrf_spis_task_address_get (NRF_SPIS_Type const *p_reg, nrf_spis_task_t task)
 Function for getting the address of the specified SPIS task register.
 
NRF_STATIC_INLINE void nrf_spis_event_clear (NRF_SPIS_Type *p_reg, nrf_spis_event_t event)
 Function for clearing the specified SPIS event.
 
NRF_STATIC_INLINE bool nrf_spis_event_check (NRF_SPIS_Type const *p_reg, nrf_spis_event_t event)
 Function for retrieving the state of the SPIS event.
 
NRF_STATIC_INLINE uint32_t nrf_spis_event_address_get (NRF_SPIS_Type const *p_reg, nrf_spis_event_t event)
 Function for getting the address of the specified SPIS event register.
 
NRF_STATIC_INLINE void nrf_spis_shorts_enable (NRF_SPIS_Type *p_reg, uint32_t mask)
 Function for enabling the specified shortcuts.
 
NRF_STATIC_INLINE void nrf_spis_shorts_disable (NRF_SPIS_Type *p_reg, uint32_t mask)
 Function for disabling the specified shortcuts.
 
NRF_STATIC_INLINE void nrf_spis_int_enable (NRF_SPIS_Type *p_reg, uint32_t mask)
 Function for enabling the specified interrupts.
 
NRF_STATIC_INLINE void nrf_spis_int_disable (NRF_SPIS_Type *p_reg, uint32_t mask)
 Function for disabling the specified interrupts.
 
NRF_STATIC_INLINE uint32_t nrf_spis_int_enable_check (NRF_SPIS_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled.
 
NRF_STATIC_INLINE void nrf_spis_subscribe_set (NRF_SPIS_Type *p_reg, nrf_spis_task_t task, uint8_t channel)
 Function for setting the subscribe configuration for a given SPIS task.
 
NRF_STATIC_INLINE void nrf_spis_subscribe_clear (NRF_SPIS_Type *p_reg, nrf_spis_task_t task)
 Function for clearing the subscribe configuration for a given SPIS task.
 
NRF_STATIC_INLINE void nrf_spis_publish_set (NRF_SPIS_Type *p_reg, nrf_spis_event_t event, uint8_t channel)
 Function for setting the publish configuration for a given SPIS event.
 
NRF_STATIC_INLINE void nrf_spis_publish_clear (NRF_SPIS_Type *p_reg, nrf_spis_event_t event)
 Function for clearing the publish configuration for a given SPIS event.
 
NRF_STATIC_INLINE void nrf_spis_enable (NRF_SPIS_Type *p_reg)
 Function for enabling the SPIS peripheral.
 
NRF_STATIC_INLINE void nrf_spis_disable (NRF_SPIS_Type *p_reg)
 Function for disabling the SPIS peripheral.
 
NRF_STATIC_INLINE bool nrf_spis_enable_check (NRF_SPIS_Type const *p_reg)
 Function for checking if the SPIS peripheral is enabled.
 
NRF_STATIC_INLINE nrf_spis_semstat_t nrf_spis_semaphore_status_get (NRF_SPIS_Type const *p_reg)
 Function for retrieving the SPIS semaphore status.
 
NRF_STATIC_INLINE nrf_spis_status_mask_t nrf_spis_status_get (NRF_SPIS_Type const *p_reg)
 Function for retrieving the SPIS status.
 
NRF_STATIC_INLINE void nrf_spis_pins_set (NRF_SPIS_Type *p_reg, uint32_t sck_pin, uint32_t mosi_pin, uint32_t miso_pin, uint32_t csn_pin)
 Function for configuring SPIS pins.
 
NRF_STATIC_INLINE uint32_t nrf_spis_sck_pin_get (NRF_SPIS_Type const *p_reg)
 Function for getting the SCK pin selection.
 
NRF_STATIC_INLINE uint32_t nrf_spis_mosi_pin_get (NRF_SPIS_Type const *p_reg)
 Function for getting the MOSI pin selection.
 
NRF_STATIC_INLINE uint32_t nrf_spis_miso_pin_get (NRF_SPIS_Type const *p_reg)
 Function for getting the MISO pin selection.
 
NRF_STATIC_INLINE uint32_t nrf_spis_csn_pin_get (NRF_SPIS_Type const *p_reg)
 Function for getting the CSN pin selection.
 
NRF_STATIC_INLINE void nrf_spis_tx_buffer_set (NRF_SPIS_Type *p_reg, uint8_t const *p_buffer, size_t length)
 Function for setting the transmit buffer.
 
NRF_STATIC_INLINE void nrf_spis_rx_buffer_set (NRF_SPIS_Type *p_reg, uint8_t *p_buffer, size_t length)
 Function for setting the receive buffer.
 
NRF_STATIC_INLINE size_t nrf_spis_tx_amount_get (NRF_SPIS_Type const *p_reg)
 Function for getting the number of bytes transmitted in the last granted transaction.
 
NRF_STATIC_INLINE size_t nrf_spis_rx_amount_get (NRF_SPIS_Type const *p_reg)
 Function for getting the number of bytes received in the last granted transaction.
 
NRF_STATIC_INLINE void nrf_spis_configure (NRF_SPIS_Type *p_reg, nrf_spis_mode_t spi_mode, nrf_spis_bit_order_t spi_bit_order)
 Function for setting the SPI configuration.
 
NRF_STATIC_INLINE void nrf_spis_def_set (NRF_SPIS_Type *p_reg, uint8_t def)
 Function for setting the default character.
 
NRF_STATIC_INLINE void nrf_spis_orc_set (NRF_SPIS_Type *p_reg, uint8_t orc)
 Function for setting the over-read character.
 
NRF_STATIC_INLINE void nrf_spis_tx_list_enable (NRF_SPIS_Type *p_reg)
 Function for enabling the TX list feature.
 
NRF_STATIC_INLINE void nrf_spis_tx_list_disable (NRF_SPIS_Type *p_reg)
 Function for disabling the TX list feature.
 
NRF_STATIC_INLINE void nrf_spis_rx_list_enable (NRF_SPIS_Type *p_reg)
 Function for enabling the RX list feature.
 
NRF_STATIC_INLINE void nrf_spis_rx_list_disable (NRF_SPIS_Type *p_reg)
 Function for disabling the RX list feature.
 
NRF_STATIC_INLINE void nrf_spis_rx_pattern_match_enable_set (NRF_SPIS_Type *p_reg, uint8_t index, bool enable)
 Function for enabling individual pattern match filters.
 
NRF_STATIC_INLINE bool nrf_spis_rx_pattern_match_enable_check (NRF_SPIS_Type const *p_reg, uint8_t index)
 Function for checking if the specified pattern match filter is enabled.
 
NRF_STATIC_INLINE void nrf_spis_rx_pattern_match_one_shot_enable (NRF_SPIS_Type *p_reg, uint8_t index)
 Function for enabling one-shot operation for the specified match filter.
 
NRF_STATIC_INLINE void nrf_spis_rx_pattern_match_one_shot_disable (NRF_SPIS_Type *p_reg, uint8_t index)
 Function for disabling one-shot operation for the specified match filter.
 
NRF_STATIC_INLINE bool nrf_spis_rx_pattern_match_one_shot_check (NRF_SPIS_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_spis_rx_pattern_match_candidate_set (NRF_SPIS_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_spis_rx_pattern_match_candidate_get (NRF_SPIS_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_spis_rx_terminate_on_bus_error_enable (NRF_SPIS_Type *p_reg)
 Function for enabling the termination of the RX transaction after detecting the BUSERROR event.
 
NRF_STATIC_INLINE void nrf_spis_rx_terminate_on_bus_error_disable (NRF_SPIS_Type *p_reg)
 Function for disabling the termination of the RX transaction after detecting the BUSERROR event.
 
NRF_STATIC_INLINE bool nrf_spis_rx_terminate_on_bus_error_check (NRF_SPIS_Type const *p_reg)
 Function for checking if RX transaction termination after detecting the BUSERROR event is enabled.
 
NRF_STATIC_INLINE void nrf_spis_tx_terminate_on_bus_error_enable (NRF_SPIS_Type *p_reg)
 Function for enabling the termination of the TX transaction after detecting the BUSERROR event.
 
NRF_STATIC_INLINE void nrf_spis_tx_terminate_on_bus_error_disable (NRF_SPIS_Type *p_reg)
 Function for disabling the termination of the TX transaction after detecting the BUSERROR event.
 
NRF_STATIC_INLINE bool nrf_spis_tx_terminate_on_bus_error_check (NRF_SPIS_Type const *p_reg)
 Function for checking if TX transaction termination after detecting the BUSERROR event is enabled.
 

Detailed Description

Hardware access layer for managing the SPIS peripheral.

Macro Definition Documentation

◆ NRF_SPIS_INST_GET

#define NRF_SPIS_INST_GET (   idx)    NRFX_CONCAT(NRF_, SPIS, idx)

Macro getting pointer to the structure of registers of the SPIS peripheral.

Parameters
[in]idxSPIS instance index.
Returns
Pointer to the structure of registers of the SPIS peripheral.

Enumeration Type Documentation

◆ nrf_spis_bit_order_t

SPI bit orders.

Enumerator
NRF_SPIS_BIT_ORDER_MSB_FIRST 

Most significant bit shifted out first.

NRF_SPIS_BIT_ORDER_LSB_FIRST 

Least significant bit shifted out first.

◆ nrf_spis_event_t

SPIS events.

Enumerator
NRF_SPIS_EVENT_RXSTARTED 

Receive sequence started.

NRF_SPIS_EVENT_RXBUSERROR 

Memory bus error occurred during the RX transfer.

NRF_SPIS_EVENT_RXMATCH0 

Pattern match for pattern 0 detected.

NRF_SPIS_EVENT_RXMATCH1 

Pattern match for pattern 1 detected.

NRF_SPIS_EVENT_RXMATCH2 

Pattern match for pattern 2 detected.

NRF_SPIS_EVENT_RXMATCH3 

Pattern match for pattern 3 detected.

NRF_SPIS_EVENT_TXSTARTED 

Transmit sequence started.

NRF_SPIS_EVENT_TXBUSERROR 

Memory bus error occurred during the TX transfer.

NRF_SPIS_EVENT_ENDRX 

End of RXD buffer reached.

NRF_SPIS_EVENT_ENDTX 

End of TXD buffer reached.

NRF_SPIS_EVENT_END 

Granted transaction completed.

NRF_SPIS_EVENT_ACQUIRED 

Semaphore acquired.

◆ nrf_spis_int_mask_t

SPIS interrupts.

Enumerator
NRF_SPIS_INT_END_MASK 

Interrupt on END event.

NRF_SPIS_INT_ACQUIRED_MASK 

Interrupt on ACQUIRED event.

NRF_SPIS_INT_RXREADY_MASK 

Interrupt on DMA.RX.READY event.

NRF_SPIS_INT_RXBUSERROR_MASK 

Interrupt on DMA.RX.BUSERROR event.

NRF_SPIS_INT_RXMATCH0_MASK 

Interrupt on DMA.RX.MATCH0 event.

NRF_SPIS_INT_RXMATCH1_MASK 

Interrupt on DMA.RX.MATCH1 event.

NRF_SPIS_INT_RXMATCH2_MASK 

Interrupt on DMA.RX.MATCH2 event.

NRF_SPIS_INT_RXMATCH3_MASK 

Interrupt on DMA.RX.MATCH3 event.

NRF_SPIS_INT_TXREADY_MASK 

Interrupt on DMA.TX.READY event.

NRF_SPIS_INT_TXBUSERROR_MASK 

Interrupt on DMA.TX.BUSERROR event.

NRF_SPIS_INT_ENDRX_MASK 

Interrupt on ENDRX event.

NRF_SPIS_INT_ENDTX_MASK 

Interrupt on ENDTX event.

NRF_SPIS_ALL_INTS_MASK 

All SPIS interrupts.

◆ nrf_spis_mode_t

SPI modes.

Enumerator
NRF_SPIS_MODE_0 

SCK active high, sample on leading edge of clock.

NRF_SPIS_MODE_1 

SCK active high, sample on trailing edge of clock.

NRF_SPIS_MODE_2 

SCK active low, sample on leading edge of clock.

NRF_SPIS_MODE_3 

SCK active low, sample on trailing edge of clock.

◆ nrf_spis_semstat_t

SPI semaphore status.

Enumerator
NRF_SPIS_SEMSTAT_FREE 

Semaphore is free.

NRF_SPIS_SEMSTAT_CPU 

Semaphore is assigned to the CPU.

NRF_SPIS_SEMSTAT_SPIS 

Semaphore is assigned to the SPI slave.

NRF_SPIS_SEMSTAT_CPUPENDING 

Semaphore is assigned to the SPI, but a handover to the CPU is pending.

◆ nrf_spis_short_mask_t

SPIS shortcuts.

Enumerator
NRF_SPIS_SHORT_END_ACQUIRE 

Shortcut between END event and ACQUIRE task.

NRF_SPIS_SHORT_RXMATCH0_ENABLERXMATCH1_MASK 

Shortcut between DMA.RX.MATCH0 event and DMA.RX.ENABLEMATCH1 task.

NRF_SPIS_SHORT_RXMATCH1_ENABLERXMATCH2_MASK 

Shortcut between DMA.RX.MATCH1 event and DMA.RX.ENABLEMATCH2 task.

NRF_SPIS_SHORT_RXMATCH2_ENABLERXMATCH3_MASK 

Shortcut between DMA.RX.MATCH2 event and DMA.RX.ENABLEMATCH3 task.

NRF_SPIS_SHORT_RXMATCH3_ENABLERXMATCH0_MASK 

Shortcut between DMA.RX.MATCH3 event and DMA.RX.ENABLEMATCH0 task.

NRF_SPIS_SHORT_RXMATCH0_DISABLERXMATCH0_MASK 

Shortcut between DMA.RX.MATCH0 event and DMA.RX.DISABLEMATCH0 task.

NRF_SPIS_SHORT_RXMATCH1_DISABLERXMATCH1_MASK 

Shortcut between DMA.RX.MATCH1 event and DMA.RX.DISABLEMATCH1 task.

NRF_SPIS_SHORT_RXMATCH2_DISABLERXMATCH2_MASK 

Shortcut between DMA.RX.MATCH2 event and DMA.RX.DISABLEMATCH2 task.

NRF_SPIS_SHORT_RXMATCH3_DISABLERXMATCH3_MASK 

Shortcut between DMA.RX.MATCH3 event and DMA.RX.DISABLEMATCH3 task.

NRF_SPIS_ALL_SHORTS_MASK 

All SPIS shortcuts.

◆ nrf_spis_status_mask_t

SPIS status.

Enumerator
NRF_SPIS_STATUS_OVERREAD 

TX buffer over-read detected and prevented.

NRF_SPIS_STATUS_OVERFLOW 

RX buffer overflow detected and prevented.

◆ nrf_spis_task_t

SPIS tasks.

Enumerator
NRF_SPIS_TASK_ACQUIRE 

Acquire SPI semaphore.

NRF_SPIS_TASK_RELEASE 

Release SPI semaphore, enabling the SPI slave to acquire it.

NRF_SPIS_TASK_ENABLERXMATCH0 

Enable SPI pattern matching functionality for pattern 0.

NRF_SPIS_TASK_ENABLERXMATCH1 

Enable SPI pattern matching functionality for pattern 1.

NRF_SPIS_TASK_ENABLERXMATCH2 

Enable SPI pattern matching functionality for pattern 2.

NRF_SPIS_TASK_ENABLERXMATCH3 

Enable SPI pattern matching functionality for pattern 3.

NRF_SPIS_TASK_DISABLERXMATCH0 

Disable SPI pattern matching functionality for pattern 0.

NRF_SPIS_TASK_DISABLERXMATCH1 

Disable SPI pattern matching functionality for pattern 1.

NRF_SPIS_TASK_DISABLERXMATCH2 

Disable SPI pattern matching functionality for pattern 2.

NRF_SPIS_TASK_DISABLERXMATCH3 

Disable SPI pattern matching functionality for pattern 3.

Function Documentation

◆ nrf_spis_configure()

NRF_STATIC_INLINE void nrf_spis_configure ( NRF_SPIS_Type *  p_reg,
nrf_spis_mode_t  spi_mode,
nrf_spis_bit_order_t  spi_bit_order 
)

Function for setting the SPI configuration.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]spi_modeSPI mode.
[in]spi_bit_orderSPI bit order.

◆ nrf_spis_csn_pin_get()

NRF_STATIC_INLINE uint32_t nrf_spis_csn_pin_get ( NRF_SPIS_Type const *  p_reg)

Function for getting the CSN pin selection.

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

◆ nrf_spis_def_set()

NRF_STATIC_INLINE void nrf_spis_def_set ( NRF_SPIS_Type *  p_reg,
uint8_t  def 
)

Function for setting the default character.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]defDefault character that is clocked out in case of an overflow of the RXD buffer.

◆ nrf_spis_disable()

NRF_STATIC_INLINE void nrf_spis_disable ( NRF_SPIS_Type *  p_reg)

Function for disabling the SPIS peripheral.

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

◆ nrf_spis_enable()

NRF_STATIC_INLINE void nrf_spis_enable ( NRF_SPIS_Type *  p_reg)

Function for enabling the SPIS peripheral.

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

◆ nrf_spis_enable_check()

NRF_STATIC_INLINE bool nrf_spis_enable_check ( NRF_SPIS_Type const *  p_reg)

Function for checking if the SPIS peripheral is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueThe SPIS is enabled.
falseThe SPIS is not enabled.

◆ nrf_spis_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_spis_event_address_get ( NRF_SPIS_Type const *  p_reg,
nrf_spis_event_t  event 
)

Function for getting the address of the specified SPIS event register.

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

◆ nrf_spis_event_check()

NRF_STATIC_INLINE bool nrf_spis_event_check ( NRF_SPIS_Type const *  p_reg,
nrf_spis_event_t  event 
)

Function for retrieving the state of the SPIS 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_spis_event_clear()

NRF_STATIC_INLINE void nrf_spis_event_clear ( NRF_SPIS_Type *  p_reg,
nrf_spis_event_t  event 
)

Function for clearing the specified SPIS event.

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

◆ nrf_spis_int_disable()

NRF_STATIC_INLINE void nrf_spis_int_disable ( NRF_SPIS_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. Use nrf_spis_int_mask_t values for bit masking.

◆ nrf_spis_int_enable()

NRF_STATIC_INLINE void nrf_spis_int_enable ( NRF_SPIS_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. Use nrf_spis_int_mask_t values for bit masking.

◆ nrf_spis_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_spis_int_enable_check ( NRF_SPIS_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. Use nrf_spis_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrf_spis_miso_pin_get()

NRF_STATIC_INLINE uint32_t nrf_spis_miso_pin_get ( NRF_SPIS_Type const *  p_reg)

Function for getting the MISO pin selection.

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

◆ nrf_spis_mosi_pin_get()

NRF_STATIC_INLINE uint32_t nrf_spis_mosi_pin_get ( NRF_SPIS_Type const *  p_reg)

Function for getting the MOSI pin selection.

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

◆ nrf_spis_orc_set()

NRF_STATIC_INLINE void nrf_spis_orc_set ( NRF_SPIS_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 that is clocked out in case of an over-read of the TXD buffer.

◆ nrf_spis_pins_set()

NRF_STATIC_INLINE void nrf_spis_pins_set ( NRF_SPIS_Type *  p_reg,
uint32_t  sck_pin,
uint32_t  mosi_pin,
uint32_t  miso_pin,
uint32_t  csn_pin 
)

Function for configuring SPIS pins.

If a given signal is not needed, pass the NRF_SPIS_PIN_NOT_CONNECTED value instead of its pin number.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]sck_pinSCK pin number.
[in]mosi_pinMOSI pin number.
[in]miso_pinMISO pin number.
[in]csn_pinCSN pin number.

◆ nrf_spis_publish_clear()

NRF_STATIC_INLINE void nrf_spis_publish_clear ( NRF_SPIS_Type *  p_reg,
nrf_spis_event_t  event 
)

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

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

◆ nrf_spis_publish_set()

NRF_STATIC_INLINE void nrf_spis_publish_set ( NRF_SPIS_Type *  p_reg,
nrf_spis_event_t  event,
uint8_t  channel 
)

Function for setting the publish configuration for a given SPIS 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_spis_rx_amount_get()

NRF_STATIC_INLINE size_t nrf_spis_rx_amount_get ( NRF_SPIS_Type const *  p_reg)

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

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Number of bytes received.

◆ nrf_spis_rx_buffer_set()

NRF_STATIC_INLINE void nrf_spis_rx_buffer_set ( NRF_SPIS_Type *  p_reg,
uint8_t *  p_buffer,
size_t  length 
)

Function for setting the receive buffer.

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

◆ nrf_spis_rx_list_disable()

NRF_STATIC_INLINE void nrf_spis_rx_list_disable ( NRF_SPIS_Type *  p_reg)

Function for disabling the RX list feature.

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

◆ nrf_spis_rx_list_enable()

NRF_STATIC_INLINE void nrf_spis_rx_list_enable ( NRF_SPIS_Type *  p_reg)

Function for enabling the RX list feature.

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

◆ nrf_spis_rx_pattern_match_candidate_get()

NRF_STATIC_INLINE uint32_t nrf_spis_rx_pattern_match_candidate_get ( NRF_SPIS_Type const *  p_reg,
uint8_t  index 
)

Function for getting the pattern that the specified match filter is looking for.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]indexIndex of pattern match filter.
Returns
Pattern that the specified match filter is looking for.

◆ nrf_spis_rx_pattern_match_candidate_set()

NRF_STATIC_INLINE void nrf_spis_rx_pattern_match_candidate_set ( NRF_SPIS_Type *  p_reg,
uint8_t  index,
uint32_t  pattern 
)

Function for setting the pattern to be looked for by the specified match filter.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]indexIndex of pattern match filter.
[in]patternPattern to be looked for. Match will trigger the corresponding event, if enabled.

◆ nrf_spis_rx_pattern_match_enable_check()

NRF_STATIC_INLINE bool nrf_spis_rx_pattern_match_enable_check ( NRF_SPIS_Type const *  p_reg,
uint8_t  index 
)

Function for checking if the specified pattern match filter is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]indexIndex of pattern match filter.
Return values
truePattern match filter is enabled.
falsePattern match filter is disabled.

◆ nrf_spis_rx_pattern_match_enable_set()

NRF_STATIC_INLINE void nrf_spis_rx_pattern_match_enable_set ( NRF_SPIS_Type *  p_reg,
uint8_t  index,
bool  enable 
)

Function for enabling individual pattern match filters.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]indexIndex of pattern match filter.
[in]enableTrue if pattern match filter is to be enabled, false otherwise.

◆ nrf_spis_rx_pattern_match_one_shot_check()

NRF_STATIC_INLINE bool nrf_spis_rx_pattern_match_one_shot_check ( NRF_SPIS_Type const *  p_reg,
uint8_t  index 
)

Function for checking if specified pattern match filter is configured as one-shot.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]indexIndex of pattern match filter.
Return values
truePattern match filter is configured as one-shot.
falsePattern match filter is configured as continuous.

◆ nrf_spis_rx_pattern_match_one_shot_disable()

NRF_STATIC_INLINE void nrf_spis_rx_pattern_match_one_shot_disable ( NRF_SPIS_Type *  p_reg,
uint8_t  index 
)

Function for disabling one-shot operation for the specified match filter.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]indexIndex of pattern match filter.

◆ nrf_spis_rx_pattern_match_one_shot_enable()

NRF_STATIC_INLINE void nrf_spis_rx_pattern_match_one_shot_enable ( NRF_SPIS_Type *  p_reg,
uint8_t  index 
)

Function for enabling one-shot operation for the specified match filter.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]indexIndex of pattern match filter.

◆ nrf_spis_rx_terminate_on_bus_error_check()

NRF_STATIC_INLINE bool nrf_spis_rx_terminate_on_bus_error_check ( NRF_SPIS_Type const *  p_reg)

Function for checking if RX transaction termination after detecting the BUSERROR event is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueRX transaction termination after detecting a BUSERROR event is enabled.
falseRX transaction termination after detecting a BUSERROR event is disabled.

◆ nrf_spis_rx_terminate_on_bus_error_disable()

NRF_STATIC_INLINE void nrf_spis_rx_terminate_on_bus_error_disable ( NRF_SPIS_Type *  p_reg)

Function for disabling the termination of the RX transaction after detecting the BUSERROR event.

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

◆ nrf_spis_rx_terminate_on_bus_error_enable()

NRF_STATIC_INLINE void nrf_spis_rx_terminate_on_bus_error_enable ( NRF_SPIS_Type *  p_reg)

Function for enabling the termination of the RX transaction after detecting the BUSERROR event.

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

◆ nrf_spis_sck_pin_get()

NRF_STATIC_INLINE uint32_t nrf_spis_sck_pin_get ( NRF_SPIS_Type const *  p_reg)

Function for getting the SCK pin selection.

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

◆ nrf_spis_semaphore_status_get()

NRF_STATIC_INLINE nrf_spis_semstat_t nrf_spis_semaphore_status_get ( NRF_SPIS_Type const *  p_reg)

Function for retrieving the SPIS semaphore status.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Current semaphore status.

◆ nrf_spis_shorts_disable()

NRF_STATIC_INLINE void nrf_spis_shorts_disable ( NRF_SPIS_Type *  p_reg,
uint32_t  mask 
)

Function for disabling the specified shortcuts.

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

◆ nrf_spis_shorts_enable()

NRF_STATIC_INLINE void nrf_spis_shorts_enable ( NRF_SPIS_Type *  p_reg,
uint32_t  mask 
)

Function for enabling the specified shortcuts.

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

◆ nrf_spis_status_get()

NRF_STATIC_INLINE nrf_spis_status_mask_t nrf_spis_status_get ( NRF_SPIS_Type const *  p_reg)

Function for retrieving the SPIS status.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Current SPIS status.

◆ nrf_spis_subscribe_clear()

NRF_STATIC_INLINE void nrf_spis_subscribe_clear ( NRF_SPIS_Type *  p_reg,
nrf_spis_task_t  task 
)

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

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

◆ nrf_spis_subscribe_set()

NRF_STATIC_INLINE void nrf_spis_subscribe_set ( NRF_SPIS_Type *  p_reg,
nrf_spis_task_t  task,
uint8_t  channel 
)

Function for setting the subscribe configuration for a given SPIS 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_spis_task_address_get()

NRF_STATIC_INLINE uint32_t nrf_spis_task_address_get ( NRF_SPIS_Type const *  p_reg,
nrf_spis_task_t  task 
)

Function for getting the address of the specified SPIS task register.

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

◆ nrf_spis_task_trigger()

NRF_STATIC_INLINE void nrf_spis_task_trigger ( NRF_SPIS_Type *  p_reg,
nrf_spis_task_t  task 
)

Function for activating the specified SPIS task.

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

◆ nrf_spis_tx_amount_get()

NRF_STATIC_INLINE size_t nrf_spis_tx_amount_get ( NRF_SPIS_Type const *  p_reg)

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

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

◆ nrf_spis_tx_buffer_set()

NRF_STATIC_INLINE void nrf_spis_tx_buffer_set ( NRF_SPIS_Type *  p_reg,
uint8_t const *  p_buffer,
size_t  length 
)

Function for setting the transmit buffer.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_bufferPointer to the buffer that contains the data to send.
[in]lengthMaximum number of data bytes to transmit.

◆ nrf_spis_tx_list_disable()

NRF_STATIC_INLINE void nrf_spis_tx_list_disable ( NRF_SPIS_Type *  p_reg)

Function for disabling the TX list feature.

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

◆ nrf_spis_tx_list_enable()

NRF_STATIC_INLINE void nrf_spis_tx_list_enable ( NRF_SPIS_Type *  p_reg)

Function for enabling the TX list feature.

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

◆ nrf_spis_tx_terminate_on_bus_error_check()

NRF_STATIC_INLINE bool nrf_spis_tx_terminate_on_bus_error_check ( NRF_SPIS_Type const *  p_reg)

Function for checking if TX transaction termination after detecting the BUSERROR event is enabled.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
trueTX transaction termination after detecting a BUSERROR event is enabled.
falseTX transaction termination after detecting a BUSERROR event is disabled.

◆ nrf_spis_tx_terminate_on_bus_error_disable()

NRF_STATIC_INLINE void nrf_spis_tx_terminate_on_bus_error_disable ( NRF_SPIS_Type *  p_reg)

Function for disabling the termination of the TX transaction after detecting the BUSERROR event.

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

◆ nrf_spis_tx_terminate_on_bus_error_enable()

NRF_STATIC_INLINE void nrf_spis_tx_terminate_on_bus_error_enable ( NRF_SPIS_Type *  p_reg)

Function for enabling the termination of the TX transaction after detecting the BUSERROR event.

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

Documentation feedback | Developer Zone | Subscribe | Updated