Hardware access layer for managing the One Time Programmable Controller (OTPC) peripheral. More...
Data Structures | |
struct | nrf_otpc_config_t |
OTPC configuration structure. More... | |
struct | nrf_otpc_power_conf_t |
Mask for the various voltages supplies when switching power modes. More... | |
struct | nrf_otpc_region_config_t |
OTPC region configuration structure. More... | |
Macros | |
#define | NRF_OTPC_HAS_REGION 1 |
Symbol indicating whether REGION[n] registers are available. | |
#define | NRF_OTPC_HAS_REGIONLOCK 1 |
Symbol indicating whether REGIONLOCK register is available. | |
Enumerations | |
enum | nrf_otpc_event_t { NRF_OTPC_EVENT_READY = offsetof(NRF_OTPC_Type, EVENTS_READY) , NRF_OTPC_EVENT_READY_NEXT = offsetof(NRF_OTPC_Type, EVENTS_READYNEXT) } |
OTPC events. More... | |
enum | nrf_otpc_int_mask_t { NRF_OTPC_INT_READY_MASK = OTPC_INTENSET_READY_Msk , NRF_OTPC_INT_READY_NEXT_MASK = OTPC_INTENSET_READYNEXT_Msk } |
OTPC interrupts. More... | |
enum | nrf_otpc_mode_write_t { NRF_OTPC_MODE_WRITE_DISABLE = OTPC_CONFIG_WEN_DisableWrite , NRF_OTPC_MODE_WRITE_ENABLE = OTPC_CONFIG_WEN_EnableWrite } |
Write enable (WEN) settings. More... | |
enum | nrf_otpc_power_init_t { NRF_OTPC_POWER_INIT_MODE_UP = OTPC_POWER_INIT_MODE_PowerUp , NRF_OTPC_POWER_INIT_MODE_DOWN = OTPC_POWER_INIT_MODE_PowerDown } |
Power mode settings. More... | |
enum | nrf_otpc_power_status_t { NRF_OTPC_POWER_STATUS_OFF = OTPC_POWER_STATUS_STATE_Off , NRF_OTPC_POWER_STATUS_POWER_UP_SEQ = OTPC_POWER_STATUS_STATE_PowerUpSeq , NRF_OTPC_POWER_STATUS_STANDBY = OTPC_POWER_STATUS_STATE_Standby , NRF_OTPC_POWER_STATUS_ACTIVE = OTPC_POWER_STATUS_STATE_Active , NRF_OTPC_POWER_STATUS_POWER_DOWN_SEQ = OTPC_POWER_STATUS_STATE_PowerDownSeq } |
Power mode status. More... | |
enum | nrf_otpc_puf_lock_t { NRF_OTPC_PUF_LOCK_PENDING = OTPC_PUF_LOCK_LOCK_Pending , NRF_OTPC_PUF_LOCK_DISABLED = OTPC_PUF_LOCK_LOCK_Disabled , NRF_OTPC_PUF_LOCK_ENABLED = OTPC_PUF_LOCK_LOCK_Enabled } |
Status of the PUF write lock. More... | |
Functions | |
NRF_STATIC_INLINE void | nrf_otpc_event_clear (NRF_OTPC_Type *p_reg, nrf_otpc_event_t event) |
Function for clearing the specified OTPC event. | |
NRF_STATIC_INLINE bool | nrf_otpc_event_check (NRF_OTPC_Type const *p_reg, nrf_otpc_event_t event) |
Function for retrieving the state of the OTPC event. | |
NRF_STATIC_INLINE uint32_t | nrf_otpc_event_address_get (NRF_OTPC_Type const *p_reg, nrf_otpc_event_t event) |
Function for getting the address of the specified OTPC event register. | |
NRF_STATIC_INLINE void | nrf_otpc_int_enable (NRF_OTPC_Type *p_reg, uint32_t mask) |
Function for enabling the specified interrupts. | |
NRF_STATIC_INLINE void | nrf_otpc_int_disable (NRF_OTPC_Type *p_reg, uint32_t mask) |
Function for disabling the specified interrupts. | |
NRF_STATIC_INLINE uint32_t | nrf_otpc_int_enable_check (NRF_OTPC_Type const *p_reg, uint32_t mask) |
Function for checking if the specified interrupts are enabled. | |
NRF_STATIC_INLINE uint32_t | nrf_otpc_int_pending_get (NRF_OTPC_Type const *p_reg) |
Function for retrieving the state of pending interrupts. | |
NRF_STATIC_INLINE bool | nrf_otpc_ready_check (NRF_OTPC_Type const *p_reg) |
Function for checking current OTPC operation status. | |
NRF_STATIC_INLINE bool | nrf_otpc_write_ready_check (NRF_OTPC_Type const *p_reg) |
Function for checking whether OTPC is ready to accept a new write operation. | |
NRF_STATIC_INLINE void | nrf_otpc_config_set (NRF_OTPC_Type *p_reg, nrf_otpc_config_t const *p_config) |
Function for setting the OTPC peripheral configuration. | |
NRF_STATIC_INLINE void | nrf_otpc_config_get (NRF_OTPC_Type const *p_reg, nrf_otpc_config_t *p_config) |
Function for getting the OTPC peripheral configuration. | |
NRF_STATIC_INLINE void | nrf_otpc_waitstates_set (NRF_OTPC_Type *p_reg, uint32_t waitstate_num) |
Function for setting wait states number for the OTP read access. | |
NRF_STATIC_INLINE uint32_t | nrf_otpc_waitstates_get (NRF_OTPC_Type const *p_reg) |
Function for reading wait states for OTP read access. | |
NRF_STATIC_INLINE void | nrf_otpc_power_init_set (NRF_OTPC_Type *p_reg, nrf_otpc_power_init_t mode) |
Function for setting power mode switching sequence. | |
NRF_STATIC_INLINE nrf_otpc_power_init_t | nrf_otpc_power_init_get (NRF_OTPC_Type const *p_reg) |
Function for getting power mode switching sequence. | |
NRF_STATIC_INLINE void | nrf_otpc_power_mask_set (NRF_OTPC_Type *p_reg, nrf_otpc_power_conf_t const *p_data) |
Function for setting mask for the various voltages supplies when switching power modes. | |
NRF_STATIC_INLINE void | nrf_otpc_power_mask_get (NRF_OTPC_Type const *p_reg, nrf_otpc_power_conf_t *p_data) |
Function for getting mask for the various voltages supplies when switching power modes. | |
NRF_STATIC_INLINE nrf_otpc_power_status_t | nrf_otpc_power_status_get (NRF_OTPC_Type const *p_reg) |
Function for getting the power mode status. | |
NRF_STATIC_INLINE void | nrf_otpc_power_up_ack_get (NRF_OTPC_Type const *p_reg, nrf_otpc_power_conf_t *p_data) |
Function for getting status of the power control signals acknowledgement during power-up sequence. | |
NRF_STATIC_INLINE void | nrf_otpc_power_down_ack_get (NRF_OTPC_Type const *p_reg, nrf_otpc_power_conf_t *p_data) |
Function for getting status of the power control signals acknowledgement during power-down sequence. | |
NRF_STATIC_INLINE void | nrf_otpc_power_force_on_set (NRF_OTPC_Type *p_reg, nrf_otpc_power_conf_t const *p_data) |
Function for setting the configuration of force ON signal of the power supply. | |
NRF_STATIC_INLINE void | nrf_otpc_power_force_on_get (NRF_OTPC_Type const *p_reg, nrf_otpc_power_conf_t *p_data) |
Function for getting force ON the power supply. | |
NRF_STATIC_INLINE void | nrf_otpc_power_force_off_set (NRF_OTPC_Type *p_reg, nrf_otpc_power_conf_t const *p_data) |
Function for setting force OFF the power supply. | |
NRF_STATIC_INLINE void | nrf_otpc_power_force_off_get (NRF_OTPC_Type const *p_reg, nrf_otpc_power_conf_t *p_data) |
Function for getting force OFF the power supply. | |
NRF_STATIC_INLINE uint32_t | nrf_otpc_puf_read_get (NRF_OTPC_Type const *p_reg) |
Function for getting the PUF bits stream XORed with the PUF pad value. Function returns 0 if the PUF is locked. | |
NRF_STATIC_INLINE void | nrf_otpc_puf_pad_set (NRF_OTPC_Type *p_reg, uint32_t pad_val) |
Function for setting the PUF pad value used to XOR with the PUF word read. | |
NRF_STATIC_INLINE nrf_otpc_puf_lock_t | nrf_otpc_puf_lock_get (NRF_OTPC_Type const *p_reg) |
Function for getting the status of the PUF write lock. | |
NRF_STATIC_INLINE void | nrf_otpc_puf_lock_enable (NRF_OTPC_Type *p_reg) |
Function for enabling the PUF write lock. | |
NRF_STATIC_INLINE void | nrf_otpc_standby_timeout_set (NRF_OTPC_Type *p_reg, uint32_t timeout) |
Function for setting timeout to go into standby mode. | |
NRF_STATIC_INLINE uint32_t | nrf_otpc_standby_timeout_get (NRF_OTPC_Type const *p_reg) |
Function for getting timeout to go into standby mode. | |
NRF_STATIC_INLINE void | nrf_otpc_frequency_set (NRF_OTPC_Type *p_reg, uint32_t freq) |
Function for setting clock frequency of OTPC. This clock is used by the OTPC for timing OTP operations. OTPC rounds this value up internally to the nearest multiple of 20 MHz. | |
NRF_STATIC_INLINE uint32_t | nrf_otpc_frequency_get (NRF_OTPC_Type const *p_reg) |
Function for getting clock frequency of OTPC. This clock is used by the OTPC for timing OTP operations. OTPC rounds this value up internally to the nearest multiple of 20 MHz. | |
NRF_STATIC_INLINE void | nrf_otpc_region_config_set (NRF_OTPC_Type *p_reg, nrf_otpc_region_config_t const *p_config, uint32_t region) |
Function for setting the configuration of the specified region. | |
NRF_STATIC_INLINE void | nrf_otpc_region_config_get (NRF_OTPC_Type const *p_reg, nrf_otpc_region_config_t *p_config, uint32_t region) |
Function for getting the configuration of the specified region. | |
NRF_STATIC_INLINE void | nrf_otpc_region_config_lock_set (NRF_OTPC_Type *p_reg, uint32_t region, bool lock) |
Function for setting the configuration lock for the specified region. | |
NRF_STATIC_INLINE bool | nrf_otpc_region_config_lock_check (NRF_OTPC_Type const *p_reg, uint32_t region) |
Function for checking the configuration lock for the specified region. | |
NRF_STATIC_INLINE void | nrf_otpc_region_write_lock_set (NRF_OTPC_Type *p_reg, uint32_t region, bool lock) |
Function for setting the write lock for the specified region. | |
NRF_STATIC_INLINE bool | nrf_otpc_region_write_lock_check (NRF_OTPC_Type const *p_reg, uint32_t region) |
Function for checking if the write lock for the specified region is enabled. | |
Hardware access layer for managing the One Time Programmable Controller (OTPC) peripheral.
enum nrf_otpc_event_t |
enum nrf_otpc_int_mask_t |
Power mode status.
enum nrf_otpc_puf_lock_t |
NRF_STATIC_INLINE void nrf_otpc_config_get | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_config_t * | p_config | ||
) |
Function for getting the OTPC peripheral configuration.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_config | Pointer to the structure to be filled with OTPC configuration data. |
NRF_STATIC_INLINE void nrf_otpc_config_set | ( | NRF_OTPC_Type * | p_reg, |
nrf_otpc_config_t const * | p_config | ||
) |
Function for setting the OTPC peripheral configuration.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_config | Pointer to the structure containing configuration to be set. |
NRF_STATIC_INLINE uint32_t nrf_otpc_event_address_get | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_event_t | event | ||
) |
Function for getting the address of the specified OTPC event register.
[in] | p_reg | Pointer to the peripheral register structure. |
[in] | event | Requested event. |
NRF_STATIC_INLINE bool nrf_otpc_event_check | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_event_t | event | ||
) |
Function for retrieving the state of the OTPC event.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | event | Event to be checked. |
true | The event has been generated. |
false | The event has not been generated. |
NRF_STATIC_INLINE void nrf_otpc_event_clear | ( | NRF_OTPC_Type * | p_reg, |
nrf_otpc_event_t | event | ||
) |
Function for clearing the specified OTPC event.
[in] | p_reg | Pointer to the peripheral register structure. |
[in] | event | Event to be cleared. |
NRF_STATIC_INLINE uint32_t nrf_otpc_frequency_get | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for getting clock frequency of OTPC. This clock is used by the OTPC for timing OTP operations. OTPC rounds this value up internally to the nearest multiple of 20 MHz.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_otpc_frequency_set | ( | NRF_OTPC_Type * | p_reg, |
uint32_t | freq | ||
) |
Function for setting clock frequency of OTPC. This clock is used by the OTPC for timing OTP operations. OTPC rounds this value up internally to the nearest multiple of 20 MHz.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | freq | Frequency in MHz. |
NRF_STATIC_INLINE void nrf_otpc_int_disable | ( | NRF_OTPC_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for disabling the specified interrupts.
[in] | p_reg | Pointer to the peripheral register structure. |
[in] | mask | Mask of interrupts to be disabled. Use nrf_otpc_int_mask_t values for bit masking. |
NRF_STATIC_INLINE void nrf_otpc_int_enable | ( | NRF_OTPC_Type * | p_reg, |
uint32_t | mask | ||
) |
Function for enabling the specified interrupts.
[in] | p_reg | Pointer to the peripheral register structure. |
[in] | mask | Mask of interrupts to be enabled. Use nrf_otpc_int_mask_t values for bit masking. |
NRF_STATIC_INLINE uint32_t nrf_otpc_int_enable_check | ( | NRF_OTPC_Type const * | p_reg, |
uint32_t | mask | ||
) |
Function for checking if the specified interrupts are enabled.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mask | Mask of interrupts to be checked. Use nrf_otpc_int_mask_t values for bit masking. |
NRF_STATIC_INLINE uint32_t nrf_otpc_int_pending_get | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for retrieving the state of pending interrupts.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_otpc_power_down_ack_get | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_power_conf_t * | p_data | ||
) |
Function for getting status of the power control signals acknowledgement during power-down sequence.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_data | Pointer to the structure to be filled with information about status of the power control signals acknowledgement during power-down sequence. |
NRF_STATIC_INLINE void nrf_otpc_power_force_off_get | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_power_conf_t * | p_data | ||
) |
Function for getting force OFF the power supply.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_data | Pointer to the structure to be filled with information about force OFF power supply. |
NRF_STATIC_INLINE void nrf_otpc_power_force_off_set | ( | NRF_OTPC_Type * | p_reg, |
nrf_otpc_power_conf_t const * | p_data | ||
) |
Function for setting force OFF the power supply.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_data | Pointer to the structure filled with information about force OFF power supply. |
NRF_STATIC_INLINE void nrf_otpc_power_force_on_get | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_power_conf_t * | p_data | ||
) |
Function for getting force ON the power supply.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_data | Pointer to the structure to be filled with information about force ON power supply. |
NRF_STATIC_INLINE void nrf_otpc_power_force_on_set | ( | NRF_OTPC_Type * | p_reg, |
nrf_otpc_power_conf_t const * | p_data | ||
) |
Function for setting the configuration of force ON signal of the power supply.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_data | Pointer to the structure filled with information about force ON power supply. |
NRF_STATIC_INLINE nrf_otpc_power_init_t nrf_otpc_power_init_get | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for getting power mode switching sequence.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_otpc_power_init_set | ( | NRF_OTPC_Type * | p_reg, |
nrf_otpc_power_init_t | mode | ||
) |
Function for setting power mode switching sequence.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | mode | Power mode switching sequence. |
NRF_STATIC_INLINE void nrf_otpc_power_mask_get | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_power_conf_t * | p_data | ||
) |
Function for getting mask for the various voltages supplies when switching power modes.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_data | Pointer to the structure to be filled with information about various voltages supplies when switching power modes. |
NRF_STATIC_INLINE void nrf_otpc_power_mask_set | ( | NRF_OTPC_Type * | p_reg, |
nrf_otpc_power_conf_t const * | p_data | ||
) |
Function for setting mask for the various voltages supplies when switching power modes.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_data | Pointer to the structure filled with information about various voltages supplies when switching power modes. |
NRF_STATIC_INLINE nrf_otpc_power_status_t nrf_otpc_power_status_get | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for getting the power mode status.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_otpc_power_up_ack_get | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_power_conf_t * | p_data | ||
) |
Function for getting status of the power control signals acknowledgement during power-up sequence.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_data | Pointer to the structure to be filled with information about status of the power control signals acknowledgement during power-up sequence. |
NRF_STATIC_INLINE void nrf_otpc_puf_lock_enable | ( | NRF_OTPC_Type * | p_reg | ) |
Function for enabling the PUF write lock.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE nrf_otpc_puf_lock_t nrf_otpc_puf_lock_get | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for getting the status of the PUF write lock.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_otpc_puf_pad_set | ( | NRF_OTPC_Type * | p_reg, |
uint32_t | pad_val | ||
) |
Function for setting the PUF pad value used to XOR with the PUF word read.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | pad_val | PUF pad value. |
NRF_STATIC_INLINE uint32_t nrf_otpc_puf_read_get | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for getting the PUF bits stream XORed with the PUF pad value. Function returns 0 if the PUF is locked.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE bool nrf_otpc_ready_check | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for checking current OTPC operation status.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
true | Current operation is completed and OTPC is ready. |
false | OTPC is busy. |
NRF_STATIC_INLINE void nrf_otpc_region_config_get | ( | NRF_OTPC_Type const * | p_reg, |
nrf_otpc_region_config_t * | p_config, | ||
uint32_t | region | ||
) |
Function for getting the configuration of the specified region.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[out] | p_config | Pointer to the structure to be filled with region configuration data. |
[in] | region | Region. |
NRF_STATIC_INLINE bool nrf_otpc_region_config_lock_check | ( | NRF_OTPC_Type const * | p_reg, |
uint32_t | region | ||
) |
Function for checking the configuration lock for the specified region.
nrf_otpc_region_config_set
is ignored.[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | region | Region. |
true | Region is locked. |
false | Region is not locked. |
NRF_STATIC_INLINE void nrf_otpc_region_config_lock_set | ( | NRF_OTPC_Type * | p_reg, |
uint32_t | region, | ||
bool | lock | ||
) |
Function for setting the configuration lock for the specified region.
nrf_otpc_region_config_set
is ignored.[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | region | Region. |
[in] | lock | True if lock is to be enabled, false otherwise. |
NRF_STATIC_INLINE void nrf_otpc_region_config_set | ( | NRF_OTPC_Type * | p_reg, |
nrf_otpc_region_config_t const * | p_config, | ||
uint32_t | region | ||
) |
Function for setting the configuration of the specified region.
nrf_otpc_region_config_lock_check
to check the status of the configuration lock.[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | p_config | Pointer to the structure with region configuration to be set. |
[in] | region | Region. |
NRF_STATIC_INLINE bool nrf_otpc_region_write_lock_check | ( | NRF_OTPC_Type const * | p_reg, |
uint32_t | region | ||
) |
Function for checking if the write lock for the specified region is enabled.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | region | Region. |
true | Region is locked. |
false | Region is not locked. |
NRF_STATIC_INLINE void nrf_otpc_region_write_lock_set | ( | NRF_OTPC_Type * | p_reg, |
uint32_t | region, | ||
bool | lock | ||
) |
Function for setting the write lock for the specified region.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | region | Region. |
[in] | lock | True if lock is to be enabled, false otherwise. |
NRF_STATIC_INLINE uint32_t nrf_otpc_standby_timeout_get | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for getting timeout to go into standby mode.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_otpc_standby_timeout_set | ( | NRF_OTPC_Type * | p_reg, |
uint32_t | timeout | ||
) |
Function for setting timeout to go into standby mode.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | timeout | Timeout in terms of OTPC clock cycles, based on frequency. Allowed values 0-511. |
NRF_STATIC_INLINE uint32_t nrf_otpc_waitstates_get | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for reading wait states for OTP read access.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
NRF_STATIC_INLINE void nrf_otpc_waitstates_set | ( | NRF_OTPC_Type * | p_reg, |
uint32_t | waitstate_num | ||
) |
Function for setting wait states number for the OTP read access.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
[in] | waitstate_num | Number of wait states for the OTP read to be set. |
NRF_STATIC_INLINE bool nrf_otpc_write_ready_check | ( | NRF_OTPC_Type const * | p_reg | ) |
Function for checking whether OTPC is ready to accept a new write operation.
[in] | p_reg | Pointer to the structure of registers of the peripheral. |
true | OTPC is ready to accept a new write operation. |
false | OTPC cannot accept any write operation now. |