nRF51 SDK
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SoC Library API

APIs for the SoC library. More...

Modules

 SoC Library Error Codes
 Error definitions for the SoC library.
 

Macros

#define SOC_SVC_BASE   0x20
 The number of the lowest SVC number reserved for the SoC library.
 
#define NRF_RADIO_NOTIFICATION_INACTIVE_GUARANTEED_TIME_US   (62)
 Guranteed time for application to process radio inactive notification.
 
#define SOC_ECB_KEY_LENGTH   (16)
 
#define SOC_ECB_CLEARTEXT_LENGTH   (16)
 
#define SOC_ECB_CIPHERTEXT_LENGTH   (SOC_ECB_CLEARTEXT_LENGTH)
 
#define SD_EVENT_IRQn   (SWI2_IRQn)
 
#define SD_EVENT_IRQHandler   (SWI2_IRQHandler)
 
#define RADIO_NOTIFICATION_IRQn   (SWI1_IRQn)
 
#define RADIO_NOTIFICATION_IRQHandler   (SWI1_IRQHandler)
 

Typedefs

typedef volatile uint8_t nrf_mutex_t
 Represents a mutex for use with the nrf_mutex functions. More...
 
typedef uint8_t nrf_power_mode_t
 Represents a power mode, used in power mode functions.
 
typedef uint8_t nrf_power_failure_threshold_t
 Represents a power failure threshold value.
 
typedef uint32_t nrf_power_dcdc_mode_t
 Represents a DCDC mode value.
 

Enumerations

enum  {
  SD_MUTEX_NEW = SOC_SVC_BASE,
  SD_MUTEX_ACQUIRE,
  SD_MUTEX_RELEASE,
  SD_NVIC_ENABLEIRQ,
  SD_NVIC_DISABLEIRQ,
  SD_NVIC_GETPENDINGIRQ,
  SD_NVIC_SETPENDINGIRQ,
  SD_NVIC_CLEARPENDINGIRQ,
  SD_NVIC_SETPRIORITY,
  SD_NVIC_GETPRIORITY,
  SD_NVIC_SYSTEMRESET,
  SD_NVIC_CRITICAL_REGION_ENTER,
  SD_NVIC_CRITICAL_REGION_EXIT,
  SD_RAND_APPLICATION_POOL_CAPACITY,
  SD_RAND_APPLICATION_BYTES_AVAILABLE,
  SD_RAND_APPLICATION_GET_VECTOR,
  SD_POWER_MODE_SET,
  SD_POWER_SYSTEM_OFF,
  SD_POWER_RESET_REASON_GET,
  SD_POWER_RESET_REASON_CLR,
  SD_POWER_POF_ENABLE,
  SD_POWER_POF_THRESHOLD_SET,
  SD_POWER_RAMON_SET,
  SD_POWER_RAMON_CLR,
  SD_POWER_RAMON_GET,
  SD_POWER_GPREGRET_SET,
  SD_POWER_GPREGRET_CLR,
  SD_POWER_GPREGRET_GET,
  SD_POWER_DCDC_MODE_SET,
  SD_APP_EVENT_WAIT,
  SD_CLOCK_HFCLK_REQUEST,
  SD_CLOCK_HFCLK_RELEASE,
  SD_CLOCK_HFCLK_IS_RUNNING,
  SD_PPI_CHANNEL_ENABLE_GET,
  SD_PPI_CHANNEL_ENABLE_SET,
  SD_PPI_CHANNEL_ENABLE_CLR,
  SD_PPI_CHANNEL_ASSIGN,
  SD_PPI_GROUP_TASK_ENABLE,
  SD_PPI_GROUP_TASK_DISABLE,
  SD_PPI_GROUP_ASSIGN,
  SD_PPI_GROUP_GET,
  SD_RADIO_NOTIFICATION_CFG_SET,
  SD_ECB_BLOCK_ENCRYPT,
  SD_EVENT_GET,
  SVC_SOC_LAST
}
 The SVC numbers used by the SVC functions in the SoC library.
 
enum  {
  NRF_MUTEX_FREE,
  NRF_MUTEX_TAKEN
}
 Possible values of a nrf_mutex_t.
 
enum  nrf_app_irq_priority_t {
  NRF_APP_PRIORITY_HIGH = 1,
  NRF_APP_PRIORITY_LOW = 3,
  NRF_APP_PRIORITY_HIGH = 1,
  NRF_APP_PRIORITY_LOW = 3
}
 The interrupt priorities available to the application while the softdevice is active.
 
enum  {
  NRF_POWER_MODE_CONSTLAT,
  NRF_POWER_MODE_LOWPWR
}
 Possible values of nrf_power_mode_t. More...
 
enum  {
  NRF_POWER_THRESHOLD_V21,
  NRF_POWER_THRESHOLD_V23,
  NRF_POWER_THRESHOLD_V25,
  NRF_POWER_THRESHOLD_V27
}
 Possible values of nrf_power_failure_threshold_t. More...
 
enum  {
  NRF_POWER_DCDC_MODE_OFF,
  NRF_POWER_DCDC_MODE_ON,
  NRF_POWER_DCDC_MODE_AUTOMATIC
}
 Possible values of nrf_power_dcdc_mode_t. More...
 
enum  nrf_radio_notification_distance_t {
  NRF_RADIO_NOTIFICATION_DISTANCE_NONE = 0,
  NRF_RADIO_NOTIFICATION_DISTANCE_800US,
  NRF_RADIO_NOTIFICATION_DISTANCE_1740US,
  NRF_RADIO_NOTIFICATION_DISTANCE_2680US,
  NRF_RADIO_NOTIFICATION_DISTANCE_3620US,
  NRF_RADIO_NOTIFICATION_DISTANCE_4560US,
  NRF_RADIO_NOTIFICATION_DISTANCE_5500US
}
 Radio notification distances. More...
 
enum  nrf_radio_notification_type_t {
  NRF_RADIO_NOTIFICATION_TYPE_NONE = 0,
  NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE,
  NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE,
  NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH
}
 Radio notification types. More...
 
enum  {
  NRF_EVENT_HFCLKSTARTED,
  NRF_EVENT_POWER_FAILURE_WARNING,
  NRF_EVENT_NUMBER_OF_EVENTS
}
 SoC Events. More...
 

Functions

uint32_t sd_mutex_new (nrf_mutex_t *p_mutex)
 Initialize a mutex. More...
 
uint32_t sd_mutex_acquire (nrf_mutex_t *p_mutex)
 Attempt to acquire a mutex. More...
 
uint32_t sd_mutex_release (nrf_mutex_t *p_mutex)
 Release a mutex. More...
 
uint32_t sd_nvic_EnableIRQ (IRQn_Type IRQn)
 Enable External Interrupt. More...
 
uint32_t sd_nvic_DisableIRQ (IRQn_Type IRQn)
 Disable External Interrupt. More...
 
uint32_t sd_nvic_GetPendingIRQ (IRQn_Type IRQn, uint32_t *p_pending_irq)
 Get Pending Interrupt. More...
 
uint32_t sd_nvic_SetPendingIRQ (IRQn_Type IRQn)
 Set Pending Interrupt. More...
 
uint32_t sd_nvic_ClearPendingIRQ (IRQn_Type IRQn)
 Clear Pending Interrupt. More...
 
uint32_t sd_nvic_SetPriority (IRQn_Type IRQn, nrf_app_irq_priority_t priority)
 Set Interrupt Priority. More...
 
uint32_t sd_nvic_GetPriority (IRQn_Type IRQn, nrf_app_irq_priority_t *p_priority)
 Get Interrupt Priority. More...
 
uint32_t sd_nvic_SystemReset (void)
 System Reset. More...
 
uint32_t sd_nvic_critical_region_enter (uint8_t *p_is_nested_critical_region)
 Enters critical region. More...
 
uint32_t sd_nvic_critical_region_exit (uint8_t is_nested_critical_region)
 Exit critical region. More...
 
uint32_t sd_rand_application_pool_capacity_get (uint8_t *p_pool_capacity)
 Query the capacity of the application random pool. More...
 
uint32_t sd_rand_application_bytes_available_get (uint8_t *p_bytes_available)
 Get number of random bytes available to the application. More...
 
uint32_t sd_rand_application_vector_get (uint8_t *p_buff, uint8_t length)
 Get random bytes from the application pool. More...
 
uint32_t sd_power_reset_reason_get (uint32_t *p_reset_reason)
 Gets the reset reason register. More...
 
uint32_t sd_power_reset_reason_clr (uint32_t reset_reason_clr_msk)
 Clears the bits of the reset reason register. More...
 
uint32_t sd_power_mode_set (nrf_power_mode_t power_mode)
 Sets the power mode when in CPU sleep. More...
 
uint32_t sd_power_system_off (void)
 Puts the chip in System OFF mode. More...
 
uint32_t sd_power_pof_enable (uint8_t pof_enable)
 Enables or disables the power-fail comparator. More...
 
uint32_t sd_power_pof_threshold_set (nrf_power_failure_threshold_t threshold)
 Sets the power-fail threshold value. More...
 
uint32_t sd_power_ramon_set (uint32_t ramon)
 Sets bits in the NRF_POWER->RAMON register. More...
 
uint32_t sd_power_ramon_clr (uint32_t ramon)
 Clears bits in the NRF_POWER->RAMON register. More...
 
uint32_t sd_power_ramon_get (uint32_t *p_ramon)
 Get contents of NRF_POWER->RAMON register, indicates power status of ram blocks. More...
 
uint32_t sd_power_gpregret_set (uint32_t gpregret_msk)
 Set bits in the NRF_POWER->GPREGRET register. More...
 
uint32_t sd_power_gpregret_clr (uint32_t gpregret_msk)
 Clear bits in the NRF_POWER->GPREGRET register. More...
 
uint32_t sd_power_gpregret_get (uint32_t *p_gpregret)
 Get contents of the NRF_POWER->GPREGRET register. More...
 
uint32_t sd_power_dcdc_mode_set (nrf_power_dcdc_mode_t dcdc_mode)
 Sets the DCDC mode. More...
 
uint32_t sd_clock_hfclk_request (void)
 Request the high frequency crystal oscillator. More...
 
uint32_t sd_clock_hfclk_release (void)
 Releases the high frequency crystal oscillator. More...
 
uint32_t sd_clock_hfclk_is_running (uint32_t *p_is_running)
 Checks if the high frequency crystal oscillator is running. More...
 
uint32_t sd_app_event_wait (void)
 Waits for an application event. More...
 
uint32_t sd_ppi_channel_enable_get (uint32_t *p_channel_enable)
 Get PPI channel enable register contents. More...
 
uint32_t sd_ppi_channel_enable_set (uint32_t channel_enable_set_msk)
 Set PPI channel enable register. More...
 
uint32_t sd_ppi_channel_enable_clr (uint32_t channel_enable_clr_msk)
 Clear PPI channel enable register. More...
 
uint32_t sd_ppi_channel_assign (uint8_t channel_num, const volatile void *event_endpoint, const volatile void *task_endpoint)
 Assign endpoints to a PPI channel. More...
 
uint32_t sd_ppi_group_task_enable (uint8_t group_num)
 Task to enable a channel group. More...
 
uint32_t sd_ppi_group_task_disable (uint8_t group_num)
 Task to disable a channel group. More...
 
uint32_t sd_ppi_group_assign (uint8_t group_num, uint32_t channel_msk)
 Assign PPI channels to a channel group. More...
 
uint32_t sd_ppi_group_get (uint8_t group_num, uint32_t *p_channel_msk)
 Gets the PPI channels of a channel group. More...
 
uint32_t sd_radio_notification_cfg_set (nrf_radio_notification_type_t type, nrf_radio_notification_distance_t distance)
 Configures the Radio Notification signal. More...
 
uint32_t sd_ecb_block_encrypt (nrf_ecb_hal_data_t *p_ecb_data)
 Encrypts a block according to the specified parameters. More...
 
uint32_t sd_event_get (uint32_t *p_event)
 Gets any pending events generated by the SoC API. More...
 

Data Structures

struct  nrf_ecb_hal_data_t
 AES ECB data structure. More...
 

Detailed Description

Macro Definition Documentation

#define SOC_ECB_KEY_LENGTH   (16)

ECB key length.

#define SOC_ECB_CLEARTEXT_LENGTH   (16)

ECB cleartext length.

#define SOC_ECB_CIPHERTEXT_LENGTH   (SOC_ECB_CLEARTEXT_LENGTH)

ECB ciphertext length.

#define SD_EVENT_IRQn   (SWI2_IRQn)

SoftDevice Event IRQ number. Used for both protocol events and SoC events.

#define SD_EVENT_IRQHandler   (SWI2_IRQHandler)

SoftDevice Event IRQ handler. Used for both protocol events and SoC events.

#define RADIO_NOTIFICATION_IRQn   (SWI1_IRQn)

The radio notification IRQ number.

#define RADIO_NOTIFICATION_IRQHandler   (SWI1_IRQHandler)

The radio notification IRQ handler.

Typedef Documentation

typedef volatile uint8_t nrf_mutex_t
Note
Accessing the value directly is not safe, use the mutex functions!

Enumeration Type Documentation

anonymous enum
Enumerator
NRF_POWER_MODE_CONSTLAT 

Constant latency mode. See power management in the reference manual.

NRF_POWER_MODE_LOWPWR 

Low power mode. See power management in the reference manual.

anonymous enum
Enumerator
NRF_POWER_THRESHOLD_V21 

2.1 Volts power failure threshold.

NRF_POWER_THRESHOLD_V23 

2.3 Volts power failure threshold.

NRF_POWER_THRESHOLD_V25 

2.5 Volts power failure threshold.

NRF_POWER_THRESHOLD_V27 

2.7 Volts power failure threshold.

anonymous enum
Enumerator
NRF_POWER_DCDC_MODE_OFF 

The DCDC is always off.

NRF_POWER_DCDC_MODE_ON 

The DCDC is always on.

NRF_POWER_DCDC_MODE_AUTOMATIC 

The DCDC is automatically managed.

Enumerator
NRF_RADIO_NOTIFICATION_DISTANCE_NONE 

The event does not have a notification.

NRF_RADIO_NOTIFICATION_DISTANCE_800US 

The distance from the active notification to start of radio activity.

NRF_RADIO_NOTIFICATION_DISTANCE_1740US 

The distance from the active notification to start of radio activity.

NRF_RADIO_NOTIFICATION_DISTANCE_2680US 

The distance from the active notification to start of radio activity.

NRF_RADIO_NOTIFICATION_DISTANCE_3620US 

The distance from the active notification to start of radio activity.

NRF_RADIO_NOTIFICATION_DISTANCE_4560US 

The distance from the active notification to start of radio activity.

NRF_RADIO_NOTIFICATION_DISTANCE_5500US 

The distance from the active notification to start of radio activity.

Enumerator
NRF_RADIO_NOTIFICATION_TYPE_NONE 

The event does not have a radio notification signal.

NRF_RADIO_NOTIFICATION_TYPE_INT_ON_ACTIVE 

Using interrupt for notification when the radio will be enabled.

NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE 

Using interrupt for notification when the radio has been disabled.

NRF_RADIO_NOTIFICATION_TYPE_INT_ON_BOTH 

Using interrupt for notification both when the radio will be enabled and disabled.

anonymous enum
Enumerator
NRF_EVENT_HFCLKSTARTED 

Event indicating that the HFCLK has started.

NRF_EVENT_POWER_FAILURE_WARNING 

Event indicating that a power failure warning has occurred.

Function Documentation

uint32_t sd_mutex_new ( nrf_mutex_t p_mutex)
Parameters
[in]p_mutexPointer to the mutex to initialize.
Returns
NRF_SUCCESS
uint32_t sd_mutex_acquire ( nrf_mutex_t p_mutex)
Parameters
[in]p_mutexPointer to the mutex to acquire.
Returns
NRF_SUCCESS - if mutex was successfully acquired.
NRF_ERROR_SOC_MUTEX_ALREADY_TAKEN - if mutex could not be acquired.
uint32_t sd_mutex_release ( nrf_mutex_t p_mutex)
Parameters
[in]p_mutexPointer to the mutex to release.
Returns
NRF_SUCCESS
uint32_t sd_nvic_EnableIRQ ( IRQn_Type  IRQn)
Note
Corresponds to NVIC_EnableIRQ in CMSIS.
Precondition
{IRQn is valid and not reserved by the stack}
Parameters
[in]IRQnSee the NVIC_EnableIRQ documentation in CMSIS.
Returns
NRF_SUCCESS - if the interrupt was enabled.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - if the interrupt is not available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED - if the interrupt has a priority not available for the application.
uint32_t sd_nvic_DisableIRQ ( IRQn_Type  IRQn)
Note
Corresponds to NVIC_DisableIRQ in CMSIS.
Precondition
{IRQn is valid and not reserved by the stack}
Parameters
[in]IRQnSee the NVIC_DisableIRQ documentation in CMSIS
Returns
NRF_SUCCESS - if the interrupt was disabled.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - if the interrupt is not available for the application.
uint32_t sd_nvic_GetPendingIRQ ( IRQn_Type  IRQn,
uint32_t *  p_pending_irq 
)
Note
Corresponds to NVIC_GetPendingIRQ in CMSIS.
Precondition
{IRQn is valid and not reserved by the stack}
Parameters
[in]IRQnSee the NVIC_GetPendingIRQ documentation in CMSIS.
[out]p_pending_irqReturn value from NVIC_GetPendingIRQ.
Returns
NRF_SUCCESS - if the interrupt is available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - if IRQn is not available for the application.
uint32_t sd_nvic_SetPendingIRQ ( IRQn_Type  IRQn)
Note
Corresponds to NVIC_SetPendingIRQ in CMSIS.
Precondition
{IRQn is valid and not reserved by the stack}
Parameters
[in]IRQnSee the NVIC_SetPendingIRQ documentation in CMSIS.
Returns
NRF_SUCCESS - if the interrupt is available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - if IRQn is not available for the application.
uint32_t sd_nvic_ClearPendingIRQ ( IRQn_Type  IRQn)
Note
Corresponds to NVIC_ClearPendingIRQ in CMSIS.
Precondition
{IRQn is valid and not reserved by the stack}
Parameters
[in]IRQnSee the NVIC_ClearPendingIRQ documentation in CMSIS.
Returns
NRF_SUCCESS - if the interrupt is available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - if IRQn is not available for the application.
uint32_t sd_nvic_SetPriority ( IRQn_Type  IRQn,
nrf_app_irq_priority_t  priority 
)
Note
Corresponds to NVIC_SetPriority in CMSIS.
Precondition
{IRQn is valid and not reserved by the stack}
{priority is valid and not reserved by the stack}
Parameters
[in]IRQnSee the NVIC_SetPriority documentation in CMSIS.
[in]priorityA valid IRQ priority for use by the application.
Returns
NRF_SUCCESS - if the interrupt and priority level is available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - if IRQn is not available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_PRIORITY_NOT_ALLOWED - if priority is not available for the application.
uint32_t sd_nvic_GetPriority ( IRQn_Type  IRQn,
nrf_app_irq_priority_t p_priority 
)
Note
Corresponds to NVIC_GetPriority in CMSIS.
Precondition
{IRQn is valid and not reserved by the stack}
Parameters
[in]IRQnSee the NVIC_GetPriority documentation in CMSIS.
[out]p_priorityReturn value from NVIC_GetPriority.
Returns
NRF_SUCCESS - if the interrupt is available for the application.
NRF_ERROR_SOC_NVIC_INTERRUPT_NOT_AVAILABLE - if IRQn is not available for the application.
uint32_t sd_nvic_SystemReset ( void  )
Note
Corresponds to NVIC_SystemReset in CMSIS.
Returns
NRF_ERROR_SOC_NVIC_SHOULD_NOT_RETURN
uint32_t sd_nvic_critical_region_enter ( uint8_t *  p_is_nested_critical_region)
Postcondition
Application interrupts will be disabled.
See Also
sd_nvic_critical_region_exit
Parameters
[out]p_is_nested_critical_region1: If in a nested critical region. 0: Otherwise.
Returns
NRF_SUCCESS
uint32_t sd_nvic_critical_region_exit ( uint8_t  is_nested_critical_region)
Precondition
Application has entered a critical region using sd_nvic_critical_region_enter.
Postcondition
If not in a nested critical region, the application interrupts will restored to the state before sd_nvic_critical_region_enter was called.
Parameters
[in]is_nested_critical_regionIf this is set to 1, the critical region won't be exited.
See Also
sd_nvic_critical_region_enter.
Returns
NRF_SUCCESS
uint32_t sd_rand_application_pool_capacity_get ( uint8_t *  p_pool_capacity)
Parameters
[out]p_pool_capacityThe capacity of the pool.
Returns
NRF_SUCCESS
uint32_t sd_rand_application_bytes_available_get ( uint8_t *  p_bytes_available)
Parameters
[out]p_bytes_availableThe number of bytes currently available in the pool.
Returns
NRF_SUCCESS
uint32_t sd_rand_application_vector_get ( uint8_t *  p_buff,
uint8_t  length 
)
Parameters
[out]p_buffPointer to unit8_t buffer for storing the bytes.
[in]lengthNumber of bytes to take from pool and place in p_buff.
Returns
NRF_SUCCESS - if the requested bytes were written to p_buff.
NRF_ERROR_SOC_RAND_NOT_ENOUGH_VALUES - if no bytes were written, because there were not enough bytes available.
uint32_t sd_power_reset_reason_get ( uint32_t *  p_reset_reason)
Parameters
[out]p_reset_reasonContents of the NRF_POWER->RESETREAS register.
Returns
NRF_SUCCESS
uint32_t sd_power_reset_reason_clr ( uint32_t  reset_reason_clr_msk)
Parameters
[in]reset_reason_clr_mskContains the bits to clear from the reset reason register.
Returns
NRF_SUCCESS
uint32_t sd_power_mode_set ( nrf_power_mode_t  power_mode)
Parameters
[in]power_modeThe power mode to use when in CPU sleep.
See Also
sd_app_event_wait
Returns
NRF_SUCCESS - if the power mode was set.
NRF_ERROR_SOC_POWER_MODE_UNKNOWN - if the power mode was unknown.
uint32_t sd_power_system_off ( void  )
uint32_t sd_power_pof_enable ( uint8_t  pof_enable)

Enabling this will give a softdevice event (NRF_EVENT_POWER_FAILURE_WARNING) when the power failure warning occurs. The event can be retrived with sd_event_get();

Parameters
[in]pof_enableTrue if the power-fail comparator should be enabled, false if it should be disabled.
Returns
NRF_SUCCESS
uint32_t sd_power_pof_threshold_set ( nrf_power_failure_threshold_t  threshold)
Parameters
[in]thresholdThe power-fail threshold value to use.
Returns
NRF_SUCCESS - if the threshold was set.
NRF_ERROR_SOC_POWER_POF_THRESHOLD_UNKNOWN - if the threshold is unknown.
uint32_t sd_power_ramon_set ( uint32_t  ramon)
Parameters
[in]ramonContains the bits needed to be set in the NRF_POWER->RAMON register.
Returns
NRF_SUCCESS
uint32_t sd_power_ramon_clr ( uint32_t  ramon)
Parameters
ramonContains the bits needed to be cleared in the NRF_POWER->RAMON register.
Returns
NRF_SUCCESS
uint32_t sd_power_ramon_get ( uint32_t *  p_ramon)
Parameters
[out]p_ramonContent of NRF_POWER->RAMON register.
Returns
NRF_SUCCESS
uint32_t sd_power_gpregret_set ( uint32_t  gpregret_msk)
Parameters
[in]gpregret_mskBits to be set in the GPREGRET register.
Returns
NRF_SUCCESS
uint32_t sd_power_gpregret_clr ( uint32_t  gpregret_msk)
Parameters
[in]gpregret_mskBits to be clear in the GPREGRET register.
Returns
NRF_SUCCESS
uint32_t sd_power_gpregret_get ( uint32_t *  p_gpregret)
Parameters
[out]p_gpregretContents of the GPREGRET register.
Returns
NRF_SUCCESS
uint32_t sd_power_dcdc_mode_set ( nrf_power_dcdc_mode_t  dcdc_mode)

Depending on the internal state of the SoftDevice, the mode change may not happen immediately. The DCDC mode switch will be blocked when occuring in close proximity to radio transmissions. When the radio transmission is done, the last mode will be used.

Parameters
[in]dcdc_modeThe mode of the DCDC.
Returns
NRF_SUCCESS
NRF_ERROR_INVALID_PARAM - If the DCDC mode is invalid.
uint32_t sd_clock_hfclk_request ( void  )

Will start the high frequency crystal oscillator, the startup time of the crystal varies and the sd_clock_hfclk_is_running function can be polled to check if it has started.

See Also
sd_clock_hfclk_is_running
sd_clock_hfclk_release
Returns
NRF_SUCCESS
uint32_t sd_clock_hfclk_release ( void  )

Will stop the high frequency crystal oscillator, this happens immediately.

See Also
sd_clock_hfclk_is_running
sd_clock_hfclk_request
Returns
NRF_SUCCESS
uint32_t sd_clock_hfclk_is_running ( uint32_t *  p_is_running)
See Also
sd_clock_hfclk_request
sd_clock_hfclk_release
Parameters
[out]p_is_running1 if the external crystal oscillator is running, 0 if not.
Returns
NRF_SUCCESS
uint32_t sd_app_event_wait ( void  )

An application event is either an application interrupt or a pended interrupt when the interrupt is disabled. When the interrupt is enabled it will be taken immediately since this function will wait in thread mode, then the execution will return in the application's main thread. When an interrupt is disabled and gets pended it will return to the application's thread main. The application must ensure that the pended flag is cleared using sd_nvic_ClearPendingIRQ in order to sleep using this function. This is only necessary for disabled interrupts, as the interrupt handler will clear the pending flag automatically for enabled interrupts.

In order to wake up from disabled interrupts, the SEVONPEND flag has to be set in the Cortex-M0 System Control Register (SCR).

See Also
CMSIS_SCB
Note
If an application interrupt has happened since the last time sd_app_event_wait was called this function will return immediately and not go to sleep. This is to avoid race conditions that can occur when a flag is updated in the interrupt handler and processed in the main loop.
Postcondition
An application interrupt has happened or a interrupt pending flag is set.
Returns
NRF_SUCCESS
uint32_t sd_ppi_channel_enable_get ( uint32_t *  p_channel_enable)
Parameters
[out]p_channel_enableThe contents of the PPI CHEN register.
Returns
NRF_SUCCESS
uint32_t sd_ppi_channel_enable_set ( uint32_t  channel_enable_set_msk)
Parameters
[in]channel_enable_set_mskMask containing the bits to set in the PPI CHEN register.
Returns
NRF_SUCCESS
uint32_t sd_ppi_channel_enable_clr ( uint32_t  channel_enable_clr_msk)
Parameters
[in]channel_enable_clr_mskMask containing the bits to clear in the PPI CHEN register.
Returns
NRF_SUCCESS
uint32_t sd_ppi_channel_assign ( uint8_t  channel_num,
const volatile void *  event_endpoint,
const volatile void *  task_endpoint 
)
Parameters
[in]channel_numNumber of the PPI channel to assign.
[in]event_endpointEvent endpoint of the PPI channel.
[in]task_endpointTask endpoint of the PPI channel.
Returns
NRF_ERROR_SOC_PPI_INVALID_CHANNEL - If the channel number is invalid.
NRF_SUCCESS - On success.
uint32_t sd_ppi_group_task_enable ( uint8_t  group_num)
Parameters
[in]group_numNumber of the channel group.
Returns
NRF_ERROR_SOC_PPI_INVALID_GROUP - If the group number is invalid
NRF_SUCCESS - On success
uint32_t sd_ppi_group_task_disable ( uint8_t  group_num)
Parameters
[in]group_numNumber of the PPI group.
Returns
NRF_ERROR_SOC_PPI_INVALID_GROUP - If the group number is invalid.
NRF_SUCCESS - On success.
uint32_t sd_ppi_group_assign ( uint8_t  group_num,
uint32_t  channel_msk 
)
Parameters
[in]group_numNumber of the channel group.
[in]channel_mskMask of the channels to assign to the group.
Returns
NRF_ERROR_SOC_PPI_INVALID_GROUP - If the group number is invalid.
NRF_SUCCESS - On success.
uint32_t sd_ppi_group_get ( uint8_t  group_num,
uint32_t *  p_channel_msk 
)
Parameters
[in]group_numNumber of the channel group.
[out]p_channel_mskMask of the channels assigned to the group.
Returns
NRF_ERROR_SOC_PPI_INVALID_GROUP - If the group number is invalid.
NRF_SUCCESS - On success.
uint32_t sd_radio_notification_cfg_set ( nrf_radio_notification_type_t  type,
nrf_radio_notification_distance_t  distance 
)
Note
  • The notification signal latency depends on the interrupt priority settings of SWI used for notification signal.
  • In the period between the ACTIVE signal and the start of the Radio Event, the SoftDevice will interrupt the application to do Radio Event preparation.
  • Using the Radio Notification feature may limit the bandwidth, as the SoftDevice may have to shorten the connection events to have time for the Radio Notification signals.
Parameters
[in]typeType of notification signal. NRF_RADIO_NOTIFICATION_TYPE_NONE shall be used to turn off radio notification. Using NRF_RADIO_NOTIFICATION_DISTANCE_NONE is recommended (but not required) to be used with NRF_RADIO_NOTIFICATION_TYPE_NONE.
[in]distanceDistance between the notification signal and start of radio activity. This parameter is ignored when NRF_RADIO_NOTIFICATION_TYPE_NONE or NRF_RADIO_NOTIFICATION_TYPE_INT_ON_INACTIVE is used.
Returns
NRF_ERROR_INVALID_PARAM - If the group number is invalid.
NRF_SUCCESS - On success.
uint32_t sd_ecb_block_encrypt ( nrf_ecb_hal_data_t p_ecb_data)

128-bit AES encryption.

Parameters
[in,out]p_ecb_dataPointer to the ECB paramters' struct (two input parameters and one output parameter).
Returns
NRF_SUCCESS
uint32_t sd_event_get ( uint32_t *  p_event)

The application should keep calling this function to get events, until NRF_ERROR_NOT_FOUND is returned.

Parameters
[out]p_eventSet to the event number, if any events are pending.
Returns
NRF_SUCCESS - If an event is pending. The event number is written in the p_event paramer.
NRF_ERROR_NOT_FOUND - If there are no pending events.