nrfx 4.5.0
Loading...
Searching...
No Matches
AAR HAL

Hardware access layer for managing the Accelerated Address Resolver (AAR) peripheral. More...

Macros

#define NRF_AAR_HAS_ERROR   1
 Presence of the ERROR event and ERRORSTATUS register.
 
#define NRF_AAR_HAS_OUT_AMOUNT   1
 Presence of the OUT.AMOUNT register.
 
#define NRF_AAR_HAS_NIRK   1
 Presence of the NIRK register.
 
#define NRF_AAR_HAS_IRKPTR   1
 Presence of the IRKPTR register.
 
#define NRF_AAR_HAS_IN_PTR   1
 Presence of the IN.PTR register.
 
#define NRF_AAR_HAS_OUT_PTR   1
 Presence of the OUT.PTR register.
 
#define NRF_AAR_HAS_ADDRPTR   1
 Presence of the ADDRPTR register.
 
#define NRF_AAR_HAS_SCRATCHPTR   1
 Presence of the SCRATCHPTR register.
 
#define NRF_AAR_HAS_STATUS   1
 Presence of the STATUS register.
 
#define NRF_AAR_HAS_MAXRESOLVED   1
 Presence of the MAXRESOLVED register.
 
#define NRF_AAR_HAS_PREMATUREOUTPTREND   1
 Presence of the error signalling premature end of the output pointer.
 

Enumerations

enum  nrf_aar_event_t {
  NRF_AAR_EVENT_END = offsetof(NRF_AAR_Type, EVENTS_END) ,
  NRF_AAR_EVENT_RESOLVED = offsetof(NRF_AAR_Type, EVENTS_RESOLVED) ,
  NRF_AAR_EVENT_NOTRESOLVED = offsetof(NRF_AAR_Type, EVENTS_NOTRESOLVED) ,
  NRF_AAR_EVENT_ERROR = offsetof(NRF_AAR_Type, EVENTS_ERROR)
}
 AAR events. More...
 
enum  nrf_aar_int_mask_t {
  NRF_AAR_INT_END_MASK = AAR_INTENSET_END_Msk ,
  NRF_AAR_INT_RESOLVED_MASK = AAR_INTENSET_RESOLVED_Msk ,
  NRF_AAR_INT_NOTRESOLVED_MASK = AAR_INTENSET_NOTRESOLVED_Msk ,
  NRF_AAR_INT_ERROR_MASK = AAR_INTENSET_ERROR_Msk
}
 AAR interrupts. More...
 
enum  nrf_aar_error_t {
  NRF_AAR_ERROR_NO_ERROR = AAR_ERRORSTATUS_ERRORSTATUS_NoError ,
  NRF_AAR_ERROR_PREMATURE_INPTR_END = AAR_ERRORSTATUS_ERRORSTATUS_PrematureInptrEnd ,
  NRF_AAR_ERROR_PREMATURE_OUTPTR_END = AAR_ERRORSTATUS_ERRORSTATUS_PrematureOutptrEnd ,
  NRF_AAR_ERROR_DMA_ERROR = AAR_ERRORSTATUS_ERRORSTATUS_DmaError
}
 AAR error status when ERROR event is generated. More...
 
enum  nrf_aar_task_t {
  NRF_AAR_TASK_START = offsetof(NRF_AAR_Type, TASKS_START) ,
  NRF_AAR_TASK_STOP = offsetof(NRF_AAR_Type, TASKS_STOP)
}
 AAR tasks. More...
 

Functions

NRF_STATIC_INLINE bool nrf_aar_event_check (NRF_AAR_Type const *p_reg, nrf_aar_event_t event)
 Function for retrieving the state of the AAR event.
 
NRF_STATIC_INLINE void nrf_aar_event_clear (NRF_AAR_Type *p_reg, nrf_aar_event_t event)
 Function for clearing the specified AAR event.
 
NRF_STATIC_INLINE uint32_t nrf_aar_event_address_get (NRF_AAR_Type const *p_reg, nrf_aar_event_t event)
 Function for getting the address of the specified AAR event register.
 
NRF_STATIC_INLINE void nrf_aar_int_enable (NRF_AAR_Type *p_reg, uint32_t mask)
 Function for enabling the specified interrupts.
 
NRF_STATIC_INLINE uint32_t nrf_aar_int_enable_check (NRF_AAR_Type const *p_reg, uint32_t mask)
 Function for checking if the specified interrupts are enabled.
 
NRF_STATIC_INLINE void nrf_aar_int_disable (NRF_AAR_Type *p_reg, uint32_t mask)
 Function for disabling the specified interrupts.
 
NRF_STATIC_INLINE void nrf_aar_task_trigger (NRF_AAR_Type *p_reg, nrf_aar_task_t task)
 Function for starting an AAR task.
 
NRF_STATIC_INLINE uint32_t nrf_aar_task_address_get (NRF_AAR_Type const *p_reg, nrf_aar_task_t task)
 Function for getting the address of a specific AAR task register.
 
NRF_STATIC_INLINE void nrf_aar_enable (NRF_AAR_Type *p_reg)
 Function for enabling AAR.
 
NRF_STATIC_INLINE void nrf_aar_disable (NRF_AAR_Type *p_reg)
 Function for disabling AAR.
 
NRF_STATIC_INLINE nrf_aar_error_t nrf_aar_error_get (NRF_AAR_Type const *p_reg)
 Function for getting the error status when ERROR event is generated.
 
NRF_STATIC_INLINE void nrf_aar_irk_pointer_set (NRF_AAR_Type *p_reg, uint8_t const *irk_ptr)
 Function for setting the pointer to the Identity Resolving Keys (IRK) data structure.
 
NRF_STATIC_INLINE uint8_t const * nrf_aar_irk_pointer_get (NRF_AAR_Type const *p_reg)
 Function for getting the pointer to the Identity Resolving Keys data structure.
 
NRF_STATIC_INLINE void nrf_aar_irk_number_set (NRF_AAR_Type *p_reg, uint8_t irk_num)
 Function for setting the number of keys available in the Identity Resolving Keys data structure.
 
NRF_STATIC_INLINE uint8_t nrf_aar_irk_number_get (NRF_AAR_Type const *p_reg)
 Function for getting the number of keys available in the Identity Resolving Keys data structure.
 
NRF_STATIC_INLINE void nrf_aar_maxresolved_set (NRF_AAR_Type *p_reg, uint16_t maxresolved)
 Function for setting maximum number of Identity Resolving Keys to resolve.
 
NRF_STATIC_INLINE uint16_t nrf_aar_maxresolved_get (NRF_AAR_Type const *p_reg)
 Function for getting maximum number of Identity Resolving Keys to resolve.
 
NRF_STATIC_INLINE void nrf_aar_addr_pointer_set (NRF_AAR_Type *p_reg, uint8_t const *addr_ptr)
 Function for setting the pointer to the resolvable address.
 
NRF_STATIC_INLINE uint8_t const * nrf_aar_addr_pointer_get (NRF_AAR_Type const *p_reg)
 Function for getting the pointer to the resolvable address.
 
NRF_STATIC_INLINE void nrf_aar_out_ptr_set (NRF_AAR_Type *p_reg, nrf_vdma_job_t const *p_job)
 Function for setting the pointer to a job list containing description to store resolved addresses.
 
NRF_STATIC_INLINE nrf_vdma_job_tnrf_aar_out_ptr_get (NRF_AAR_Type const *p_reg)
 Function for getting the pointer to a job list containing description to store resolved addresses.
 
NRF_STATIC_INLINE void nrf_aar_in_ptr_set (NRF_AAR_Type *p_reg, nrf_vdma_job_t const *p_job)
 Function for setting the pointer to a job list containing both the Hash and Prand parts of the private resolvable address (DEVICEADDR) field from the Bluetooth packet, and a number of Identity Resolving Keys (IRK).
 
NRF_STATIC_INLINE nrf_vdma_job_tnrf_aar_in_ptr_get (NRF_AAR_Type const *p_reg)
 Function for getting the pointer to a job list containing both the Hash and Prand parts of the private resolvable address (DEVICEADDR) field from the Bluetooth packet, and a number of Identity Resolving Keys (IRK).
 
NRF_STATIC_INLINE uint32_t nrf_aar_out_amount_get (NRF_AAR_Type const *p_reg)
 Function for getting number of bytes available in the output data, not including the job list structure.
 
NRF_STATIC_INLINE void nrf_aar_scratch_pointer_set (NRF_AAR_Type *p_reg, uint8_t *scratch_ptr)
 Function for setting the pointer to the scratch data area.
 
NRF_STATIC_INLINE uint8_t * nrf_aar_scratch_pointer_get (NRF_AAR_Type const *p_reg)
 Function for getting the pointer to the scratch data area.
 
NRF_STATIC_INLINE uint8_t nrf_aar_resolution_status_get (NRF_AAR_Type const *p_reg)
 Function for getting the index of the Identity Resolving Key that was used the last time an address was resolved.
 
NRF_STATIC_INLINE void nrf_aar_subscribe_set (NRF_AAR_Type *p_reg, nrf_aar_task_t task, uint8_t channel)
 Function for setting the subscribe configuration for a given AAR task.
 
NRF_STATIC_INLINE void nrf_aar_subscribe_clear (NRF_AAR_Type *p_reg, nrf_aar_task_t task)
 Function for clearing the subscribe configuration for a given AAR task.
 
NRF_STATIC_INLINE uint32_t nrf_aar_subscribe_get (NRF_AAR_Type const *p_reg, nrf_aar_task_t task)
 Function for getting the subscribe configuration for a given AAR task.
 
NRF_STATIC_INLINE void nrf_aar_publish_set (NRF_AAR_Type *p_reg, nrf_aar_event_t event, uint8_t channel)
 Function for setting the publish configuration for a given AAR event.
 
NRF_STATIC_INLINE void nrf_aar_publish_clear (NRF_AAR_Type *p_reg, nrf_aar_event_t event)
 Function for clearing the publish configuration for a given AAR event.
 
NRF_STATIC_INLINE uint32_t nrf_aar_publish_get (NRF_AAR_Type const *p_reg, nrf_aar_event_t event)
 Function for getting the publish configuration for a given AAR event.
 

Detailed Description

Hardware access layer for managing the Accelerated Address Resolver (AAR) peripheral.

Enumeration Type Documentation

◆ nrf_aar_error_t

AAR error status when ERROR event is generated.

Enumerator
NRF_AAR_ERROR_NO_ERROR 

No errors have occurred.

NRF_AAR_ERROR_PREMATURE_INPTR_END 

End of INPTR job list before data structure was read.

NRF_AAR_ERROR_PREMATURE_OUTPTR_END 

End of OUTPTR job list before data structure was read.

NRF_AAR_ERROR_DMA_ERROR 

Bus error during DMA access.

◆ nrf_aar_event_t

AAR events.

Enumerator
NRF_AAR_EVENT_END 

Address resolution procedure complete.

NRF_AAR_EVENT_RESOLVED 

Address resolved.

NRF_AAR_EVENT_NOTRESOLVED 

Address not resolved.

NRF_AAR_EVENT_ERROR 

Address resolution procedure aborted due to STOP task or error.

◆ nrf_aar_int_mask_t

AAR interrupts.

Enumerator
NRF_AAR_INT_END_MASK 

Interrupt on END event.

NRF_AAR_INT_RESOLVED_MASK 

Interrupt on RESOLVED event.

NRF_AAR_INT_NOTRESOLVED_MASK 

Interrupt on NOTRESOLVED event.

NRF_AAR_INT_ERROR_MASK 

Interrupt on NOTRESOLVED event.

◆ nrf_aar_task_t

AAR tasks.

Enumerator
NRF_AAR_TASK_START 

Start address resolution procedure.

NRF_AAR_TASK_STOP 

Stop address resolution procedure.

Function Documentation

◆ nrf_aar_addr_pointer_get()

NRF_STATIC_INLINE uint8_t const * nrf_aar_addr_pointer_get ( NRF_AAR_Type const * p_reg)

Function for getting the pointer to the resolvable address.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Pointer to the address to resolve.

◆ nrf_aar_addr_pointer_set()

NRF_STATIC_INLINE void nrf_aar_addr_pointer_set ( NRF_AAR_Type * p_reg,
uint8_t const * addr_ptr )

Function for setting the pointer to the resolvable address.

The resolvable address must consist of 6 bytes.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]addr_ptrPointer to the address to resolve using the available IRK keys. Must point to the Data RAM region.

◆ nrf_aar_disable()

NRF_STATIC_INLINE void nrf_aar_disable ( NRF_AAR_Type * p_reg)

Function for disabling AAR.

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

◆ nrf_aar_enable()

NRF_STATIC_INLINE void nrf_aar_enable ( NRF_AAR_Type * p_reg)

Function for enabling AAR.

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

◆ nrf_aar_error_get()

NRF_STATIC_INLINE nrf_aar_error_t nrf_aar_error_get ( NRF_AAR_Type const * p_reg)

Function for getting the error status when ERROR event is generated.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Return values
Errorstatus when the ERROR event is generated.

◆ nrf_aar_event_address_get()

NRF_STATIC_INLINE uint32_t nrf_aar_event_address_get ( NRF_AAR_Type const * p_reg,
nrf_aar_event_t event )

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

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

◆ nrf_aar_event_check()

NRF_STATIC_INLINE bool nrf_aar_event_check ( NRF_AAR_Type const * p_reg,
nrf_aar_event_t event )

Function for retrieving the state of the AAR event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent to be checked.
Return values
trueEvent is set.
falseEvent is not set.

◆ nrf_aar_event_clear()

NRF_STATIC_INLINE void nrf_aar_event_clear ( NRF_AAR_Type * p_reg,
nrf_aar_event_t event )

Function for clearing the specified AAR event.

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

◆ nrf_aar_in_ptr_get()

NRF_STATIC_INLINE nrf_vdma_job_t * nrf_aar_in_ptr_get ( NRF_AAR_Type const * p_reg)

Function for getting the pointer to a job list containing both the Hash and Prand parts of the private resolvable address (DEVICEADDR) field from the Bluetooth packet, and a number of Identity Resolving Keys (IRK).

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Pointer to the job list.

◆ nrf_aar_in_ptr_set()

NRF_STATIC_INLINE void nrf_aar_in_ptr_set ( NRF_AAR_Type * p_reg,
nrf_vdma_job_t const * p_job )

Function for setting the pointer to a job list containing both the Hash and Prand parts of the private resolvable address (DEVICEADDR) field from the Bluetooth packet, and a number of Identity Resolving Keys (IRK).

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_jobPointer to a job list.

◆ nrf_aar_int_disable()

NRF_STATIC_INLINE void nrf_aar_int_disable ( NRF_AAR_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_aar_int_mask_t values for bit masking.

◆ nrf_aar_int_enable()

NRF_STATIC_INLINE void nrf_aar_int_enable ( NRF_AAR_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_aar_int_mask_t values for bit masking.

◆ nrf_aar_int_enable_check()

NRF_STATIC_INLINE uint32_t nrf_aar_int_enable_check ( NRF_AAR_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_aar_int_mask_t values for bit masking.
Returns
Mask of enabled interrupts.

◆ nrf_aar_irk_number_get()

NRF_STATIC_INLINE uint8_t nrf_aar_irk_number_get ( NRF_AAR_Type const * p_reg)

Function for getting the number of keys available in the Identity Resolving Keys data structure.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Number of keys in the IRK data structure.

◆ nrf_aar_irk_number_set()

NRF_STATIC_INLINE void nrf_aar_irk_number_set ( NRF_AAR_Type * p_reg,
uint8_t irk_num )

Function for setting the number of keys available in the Identity Resolving Keys data structure.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]irk_numNumber of keys available in the IRK data structure. Maximum is 16. Must correspond to the size of the provided IRK data structure.
See also
nrf_aar_irk_pointer_set

◆ nrf_aar_irk_pointer_get()

NRF_STATIC_INLINE uint8_t const * nrf_aar_irk_pointer_get ( NRF_AAR_Type const * p_reg)

Function for getting the pointer to the Identity Resolving Keys data structure.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Pointer to the IRK data structure.

◆ nrf_aar_irk_pointer_set()

NRF_STATIC_INLINE void nrf_aar_irk_pointer_set ( NRF_AAR_Type * p_reg,
uint8_t const * irk_ptr )

Function for setting the pointer to the Identity Resolving Keys (IRK) data structure.

The size of the provided data structure must correspond to the number of keys available. Each key occupies 16 bytes.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]irk_ptrPointer to the IRK data structure. Must point to the Data RAM region.
See also
nrf_aar_irk_number_set

◆ nrf_aar_maxresolved_get()

NRF_STATIC_INLINE uint16_t nrf_aar_maxresolved_get ( NRF_AAR_Type const * p_reg)

Function for getting maximum number of Identity Resolving Keys to resolve.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Maximum number of Identity Resolving Keys to resolve.

◆ nrf_aar_maxresolved_set()

NRF_STATIC_INLINE void nrf_aar_maxresolved_set ( NRF_AAR_Type * p_reg,
uint16_t maxresolved )

Function for setting maximum number of Identity Resolving Keys to resolve.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]maxresolvedMaximum number of Identity Resolving Keys to resolve.
See also
nrf_aar_irk_pointer_set

◆ nrf_aar_out_amount_get()

NRF_STATIC_INLINE uint32_t nrf_aar_out_amount_get ( NRF_AAR_Type const * p_reg)

Function for getting number of bytes available in the output data, not including the job list structure.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Number of bytes available in the output data.

◆ nrf_aar_out_ptr_get()

NRF_STATIC_INLINE nrf_vdma_job_t * nrf_aar_out_ptr_get ( NRF_AAR_Type const * p_reg)

Function for getting the pointer to a job list containing description to store resolved addresses.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Pointer to the job list.

◆ nrf_aar_out_ptr_set()

NRF_STATIC_INLINE void nrf_aar_out_ptr_set ( NRF_AAR_Type * p_reg,
nrf_vdma_job_t const * p_job )

Function for setting the pointer to a job list containing description to store resolved addresses.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]p_jobPointer to a job list.

◆ nrf_aar_publish_clear()

NRF_STATIC_INLINE void nrf_aar_publish_clear ( NRF_AAR_Type * p_reg,
nrf_aar_event_t event )

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

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

◆ nrf_aar_publish_get()

NRF_STATIC_INLINE uint32_t nrf_aar_publish_get ( NRF_AAR_Type const * p_reg,
nrf_aar_event_t event )

Function for getting the publish configuration for a given AAR event.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]eventEvent for which to read the configuration.
Returns
AAR publish configuration.

◆ nrf_aar_publish_set()

NRF_STATIC_INLINE void nrf_aar_publish_set ( NRF_AAR_Type * p_reg,
nrf_aar_event_t event,
uint8_t channel )

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

NRF_STATIC_INLINE uint8_t nrf_aar_resolution_status_get ( NRF_AAR_Type const * p_reg)

Function for getting the index of the Identity Resolving Key that was used the last time an address was resolved.

This function can be used to get the IRK index that matched the resolvable address, provided that NRF_AAR_EVENT_RESOLVED occured. Otherwise, it will return the index of the last IRK stored in the IRK data structure.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
The index of the IRK that was used the last time an address was resolved.

◆ nrf_aar_scratch_pointer_get()

NRF_STATIC_INLINE uint8_t * nrf_aar_scratch_pointer_get ( NRF_AAR_Type const * p_reg)

Function for getting the pointer to the scratch data area.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
Returns
Pointer to the scratch data area.

◆ nrf_aar_scratch_pointer_set()

NRF_STATIC_INLINE void nrf_aar_scratch_pointer_set ( NRF_AAR_Type * p_reg,
uint8_t * scratch_ptr )

Function for setting the pointer to the scratch data area.

The scratch data area is used for temporary storage during the address resolution procedure. A space of minimum 3 bytes must be reserved for the scratch data area.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]scratch_ptrPointer to the scratch data area. Must point to the Data RAM region.

◆ nrf_aar_subscribe_clear()

NRF_STATIC_INLINE void nrf_aar_subscribe_clear ( NRF_AAR_Type * p_reg,
nrf_aar_task_t task )

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

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

◆ nrf_aar_subscribe_get()

NRF_STATIC_INLINE uint32_t nrf_aar_subscribe_get ( NRF_AAR_Type const * p_reg,
nrf_aar_task_t task )

Function for getting the subscribe configuration for a given AAR task.

Parameters
[in]p_regPointer to the structure of registers of the peripheral.
[in]taskTask for which to read the configuration.
Returns
AAR subscribe configuration.

◆ nrf_aar_subscribe_set()

NRF_STATIC_INLINE void nrf_aar_subscribe_set ( NRF_AAR_Type * p_reg,
nrf_aar_task_t task,
uint8_t channel )

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

NRF_STATIC_INLINE uint32_t nrf_aar_task_address_get ( NRF_AAR_Type const * p_reg,
nrf_aar_task_t task )

Function for getting the address of a specific AAR task register.

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

◆ nrf_aar_task_trigger()

NRF_STATIC_INLINE void nrf_aar_task_trigger ( NRF_AAR_Type * p_reg,
nrf_aar_task_t task )

Function for starting an AAR task.

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