SmartSnippets DA1459x SDK
Files | Data Structures | Functions

System Driver. More...

Files

file  hw_sys.h
 System Driver header file.
 

Data Structures

struct  hw_sys_reg_config_t
 Register configuration. More...
 

Functions

__STATIC_INLINE void hw_sys_set_cache_retained (void)
 Enable Cache retainability. More...
 
__STATIC_INLINE void hw_sys_setup_retmem (void)
 Setup the Retention Memory configuration. More...
 
__STATIC_INLINE void hw_sys_no_retmem (void)
 Disable memory retention. More...
 
__STATIC_FORCEINLINE void hw_sys_track_reset_type (void)
 Prepare RESET type tracking.
 
__STATIC_INLINE void hw_sys_enable_reset_on_wup (void)
 Activate the "Reset on wake-up" functionality. More...
 
void hw_sys_set_preferred_values (HW_PD pd)
 Set the preferred settings of a power domain. More...
 
void hw_sys_setup_sw_cursor (void)
 Set the GPIO used for the SW cursor to High-Z. More...
 
void hw_sys_trigger_sw_cursor (void)
 Triggers the GPIO used for the SW cursor. More...
 
__STATIC_FORCEINLINE void hw_sys_enable_debugger (void)
 Enable the debugger. More...
 
__STATIC_FORCEINLINE void hw_sys_disable_debugger (void)
 Disable the debugger. More...
 
__STATIC_FORCEINLINE bool hw_sys_is_debugger_attached (void)
 Check if the debugger is attached. More...
 
__STATIC_FORCEINLINE void hw_sys_enable_hibernation (void)
 Enable hibernation mode. More...
 
__STATIC_FORCEINLINE void hw_sys_enable_cmac_cache_ram (void)
 Enable CMAC cache RAM. More...
 
__STATIC_FORCEINLINE void hw_sys_disable_cmac_cache_ram (void)
 Disable CMAC cache RAM. More...
 
__ALWAYS_RETAINED_CODE void hw_sys_assert_trigger_gpio (void)
 Trigger a GPIO when ASSERT_WARNING() or ASSERT_ERROR() hits. More...
 
void hw_sys_enable_cmac_mem_protection (void)
 Enables read only protection in CMAC code and data. More...
 
void hw_sys_enable_ivt_mem_protection (void)
 Enables "Read-only by any privilege level" and "execute_never" memory protection of IVT. More...
 
__STATIC_FORCEINLINE void hw_sys_set_por_timer (uint8_t time)
 Set POR-trigger minimum duration. More...
 
bool hw_sys_hw_bsr_try_lock (HW_BSR_MASTER_ID hw_bsr_master_id, HW_BSR_POS pos)
 Try to lock a BSR entry. More...
 
void hw_sys_hw_bsr_unlock (HW_BSR_MASTER_ID hw_bsr_master_id, HW_BSR_POS pos)
 Unlock a BSR entry. More...
 
void hw_sys_sw_bsr_init (void)
 Initializes the software busy status register.
 
bool hw_sys_sw_bsr_try_acquire (SW_BSR_MASTER_ID sw_bsr_master_id, uint32_t periph_id)
 Tries to acquire exclusive access to a specific peripheral when it is also used by other masters (CMAC). More...
 
bool hw_sys_sw_bsr_acquired (SW_BSR_MASTER_ID sw_bsr_master_id, uint32_t periph_id)
 Checks if exclusive access to a specific peripheral has been acquired from a given master. More...
 
void hw_sys_sw_bsr_release (SW_BSR_MASTER_ID sw_bsr_master_id, uint32_t periph_id)
 Releases the exclusive access from a specific peripheral so it it can be also used by other masters (CMAC). More...
 
void hw_sys_pd_com_enable (void)
 Enables the COM power domain. More...
 
void hw_sys_pd_com_disable (void)
 Disables the COM power domain. If it has not been enabled by any other modules, it will be disabled.
 
void hw_sys_pd_periph_enable (void)
 Enables the PERIPH power domain. More...
 
void hw_sys_pd_periph_disable (void)
 Disables the PERIPH power domain. If it has not been enabled by any other modules, it will be disabled.
 
__RETAINED_CODE void hw_sys_pd_audio_enable (void)
 Enables the AUDIO power domain. More...
 
__RETAINED_CODE void hw_sys_pd_audio_disable (void)
 Disables the AUDIO power domain. If it has not been enabled by any other modules, it will be disabled.
 
uint32_t hw_sys_reg_add_config (const hw_sys_reg_config_t *config, uint32_t num_of_entries)
 Add register configuration entries in the system register configuration table. More...
 
hw_sys_reg_config_thw_sys_reg_get_config (uint32_t index)
 Get a register configuration entry. More...
 
void hw_sys_reg_modify_config (uint32_t index, __IO uint32_t *addr, uint32_t value)
 Modify a register configuration entry. More...
 
uint32_t * hw_sys_reg_get_num_of_config_entries (void)
 Get the number of entries in the system register configuration table. More...
 
__RETAINED_CODE void hw_sys_reg_apply_config (void)
 Apply system register configuration. More...
 
void hw_sys_apply_default_values (void)
 Checks whether there are register entries in CS for the following registers. More...
 

Detailed Description

System Driver.

Function Documentation

◆ hw_sys_apply_default_values()

void hw_sys_apply_default_values ( void  )

Checks whether there are register entries in CS for the following registers.

  • CLK_RC32M_REG
  • XTAL32M_START_REG
  • XTAL32M_TRIM_REG For each register that there is no register entry the function applies the default values for specific fields of this register
  • CLK_RC32M_REG: RC32M_BIAS, RC32M_RANGE, RC32M_COSC
  • XTAL32M_START_REG: XTAL32M_TRIM
  • XTAL32M_TRIM_REG: XTAL32M_TRIM_REG

◆ hw_sys_assert_trigger_gpio()

__ALWAYS_RETAINED_CODE void hw_sys_assert_trigger_gpio ( void  )

Trigger a GPIO when ASSERT_WARNING() or ASSERT_ERROR() hits.

◆ hw_sys_disable_cmac_cache_ram()

__STATIC_FORCEINLINE void hw_sys_disable_cmac_cache_ram ( void  )

Disable CMAC cache RAM.

Warning
To be called only prior to BLE initialization, after processing a memory block that falls into the CMAC cache RAM range.
See also
hw_sys_enable_cmac_cache_ram.

◆ hw_sys_disable_debugger()

__STATIC_FORCEINLINE void hw_sys_disable_debugger ( void  )

Disable the debugger.

◆ hw_sys_enable_cmac_cache_ram()

__STATIC_FORCEINLINE void hw_sys_enable_cmac_cache_ram ( void  )

Enable CMAC cache RAM.

Warning
To be called only prior to BLE initialization. After processing the respected memory block that falls into the CMAC cache RAM range, it should be disabled.
See also
hw_sys_disable_cmac_cache_ram.

◆ hw_sys_enable_cmac_mem_protection()

void hw_sys_enable_cmac_mem_protection ( void  )

Enables read only protection in CMAC code and data.

◆ hw_sys_enable_debugger()

__STATIC_FORCEINLINE void hw_sys_enable_debugger ( void  )

Enable the debugger.

◆ hw_sys_enable_hibernation()

__STATIC_FORCEINLINE void hw_sys_enable_hibernation ( void  )

Enable hibernation mode.

◆ hw_sys_enable_ivt_mem_protection()

void hw_sys_enable_ivt_mem_protection ( void  )

Enables "Read-only by any privilege level" and "execute_never" memory protection of IVT.

◆ hw_sys_enable_reset_on_wup()

__STATIC_INLINE void hw_sys_enable_reset_on_wup ( void  )

Activate the "Reset on wake-up" functionality.

◆ hw_sys_hw_bsr_try_lock()

bool hw_sys_hw_bsr_try_lock ( HW_BSR_MASTER_ID  hw_bsr_master_id,
HW_BSR_POS  pos 
)

Try to lock a BSR entry.

Parameters
[in]hw_bsr_master_idThe HW BSR ID of the relevant master
[in]posThe position of the entry in BSR. Valid positions are provided in HW_BSR_POS.
Returns
true if the BSR entry has been acquired, else false.

◆ hw_sys_hw_bsr_unlock()

void hw_sys_hw_bsr_unlock ( HW_BSR_MASTER_ID  hw_bsr_master_id,
HW_BSR_POS  pos 
)

Unlock a BSR entry.

Parameters
[in]hw_bsr_master_idThe HW BSR ID of the relevant master
[in]posThe position of the entry in BSR. Valid positions are provided in HW_BSR_POS.

◆ hw_sys_is_debugger_attached()

__STATIC_FORCEINLINE bool hw_sys_is_debugger_attached ( void  )

Check if the debugger is attached.

Returns
true, if the debugger is attached, else false.

◆ hw_sys_no_retmem()

__STATIC_INLINE void hw_sys_no_retmem ( void  )

Disable memory retention.

◆ hw_sys_pd_audio_enable()

__RETAINED_CODE void hw_sys_pd_audio_enable ( void  )

Enables the AUDIO power domain.

◆ hw_sys_pd_com_enable()

void hw_sys_pd_com_enable ( void  )

Enables the COM power domain.

◆ hw_sys_pd_periph_enable()

void hw_sys_pd_periph_enable ( void  )

Enables the PERIPH power domain.

◆ hw_sys_reg_add_config()

uint32_t hw_sys_reg_add_config ( const hw_sys_reg_config_t config,
uint32_t  num_of_entries 
)

Add register configuration entries in the system register configuration table.

Parameters
[in]configpointer to the structure containing the register configuration
[in]num_of_entriesthe number of entries in the register configuration structure
Returns
the index of the first entry in the configuration table

◆ hw_sys_reg_apply_config()

__RETAINED_CODE void hw_sys_reg_apply_config ( void  )

Apply system register configuration.

Configure non-retained system registers using the entries in the system register configuration table.

◆ hw_sys_reg_get_config()

hw_sys_reg_config_t* hw_sys_reg_get_config ( uint32_t  index)

Get a register configuration entry.

Parameters
[in]indexthe index of the entry in the register configuration table
Returns
a pointer to the register configuration entry

◆ hw_sys_reg_get_num_of_config_entries()

uint32_t* hw_sys_reg_get_num_of_config_entries ( void  )

Get the number of entries in the system register configuration table.

Returns
a pointer to the number of entries

◆ hw_sys_reg_modify_config()

void hw_sys_reg_modify_config ( uint32_t  index,
__IO uint32_t *  addr,
uint32_t  value 
)

Modify a register configuration entry.

Parameters
[in]indexthe index of the entry in the register configuration table
[in]addrthe new register address
[in]valuethe new register value

◆ hw_sys_set_cache_retained()

__STATIC_INLINE void hw_sys_set_cache_retained ( void  )

Enable Cache retainability.

◆ hw_sys_set_por_timer()

__STATIC_FORCEINLINE void hw_sys_set_por_timer ( uint8_t  time)

Set POR-trigger minimum duration.

The function configures the Power-On-Reset (POR) timer, which defines how long the nRST or the POR-configured GPIO pin should be asserted in order to trigger a POR.

Parameters
[in]timetime in 4096 * {RCLP@32kHz period} units (~ 0.128 sec). Should be less than 128 (~16.2 sec).
Note
In case of triggering a POR from a GPIO, hw_gpio_configure_por_pin() should also be used.
Setting time to 0 disables POR generation completely (even for nRST).
Default (reset) value is 0x18 (~3 sec).
If a POR is successfully triggered, the POR timer is re-set (at startup) to its default value (Of course, later, the application may set it again to a different value, as desired).
See also
hw_gpio_configure_por_pin()

◆ hw_sys_set_preferred_values()

void hw_sys_set_preferred_values ( HW_PD  pd)

Set the preferred settings of a power domain.

Parameters
[in]pdpower domain

◆ hw_sys_setup_retmem()

__STATIC_INLINE void hw_sys_setup_retmem ( void  )

Setup the Retention Memory configuration.

◆ hw_sys_setup_sw_cursor()

void hw_sys_setup_sw_cursor ( void  )

Set the GPIO used for the SW cursor to High-Z.

◆ hw_sys_sw_bsr_acquired()

bool hw_sys_sw_bsr_acquired ( SW_BSR_MASTER_ID  sw_bsr_master_id,
uint32_t  periph_id 
)

Checks if exclusive access to a specific peripheral has been acquired from a given master.

Parameters
[in]sw_bsr_master_idThe SW BSR ID of the relevant master
[in]periph_idThe peripheral id for which exclusive access will be checked. Valid range is (0 - BSR_PERIPH_ID_MAX). Check HW_SYS_BSR_PERIPH_ID.
Returns
true if peripheral exclusive access has been acquired from the specific master, else false.

◆ hw_sys_sw_bsr_release()

void hw_sys_sw_bsr_release ( SW_BSR_MASTER_ID  sw_bsr_master_id,
uint32_t  periph_id 
)

Releases the exclusive access from a specific peripheral so it it can be also used by other masters (CMAC).

Parameters
[in]sw_bsr_master_idThe SW BSR ID of the relevant master
[in]periph_idThe peripheral id for which exclusive access must be released. Valid range is (0 - BSR_PERIPH_ID_MAX). Check HW_SYS_BSR_PERIPH_ID.

◆ hw_sys_sw_bsr_try_acquire()

bool hw_sys_sw_bsr_try_acquire ( SW_BSR_MASTER_ID  sw_bsr_master_id,
uint32_t  periph_id 
)

Tries to acquire exclusive access to a specific peripheral when it is also used by other masters (CMAC).

Parameters
[in]sw_bsr_master_idThe SW BSR ID of the relevant master
[in]periph_idThe peripheral id for which exclusive access must be granted. Valid range is (0 - BSR_PERIPH_ID_MAX). Check HW_SYS_BSR_PERIPH_ID.
Returns
true if peripheral exclusive access has been acquired, else false.

◆ hw_sys_trigger_sw_cursor()

void hw_sys_trigger_sw_cursor ( void  )

Triggers the GPIO used for the SW cursor.