|
SmartSnippets DA1459x SDK
|
Go to the documentation of this file.
44 #if dg_configUSE_HW_SYS
52 #define SW_BSR_HW_BSR_MASK (0x3)
58 HW_BSR_MASTER_NONE = 0,
59 HW_BSR_MASTER_SYSCPU = 2,
60 HW_BSR_MASTER_CMAC = 3,
69 HW_BSR_POWER_CTRL_POS = 28,
70 HW_BSR_WAKEUP_CONFIG_POS = 30,
77 SW_BSR_MASTER_NONE = 1 << HW_BSR_MASTER_NONE,
78 SW_BSR_MASTER_SYSCPU = 1 << HW_BSR_MASTER_SYSCPU,
79 SW_BSR_MASTER_CMAC = 1 << HW_BSR_MASTER_CMAC,
83 BSR_PERIPH_ID_SPI = 1,
84 BSR_PERIPH_ID_UART1 = 2,
85 BSR_PERIPH_ID_UART2 = 3,
86 BSR_PERIPH_ID_I2C = 4,
87 BSR_PERIPH_ID_GPADC = 5,
88 BSR_PERIPH_ID_SDADC = 6,
89 BSR_PERIPH_ID_MAX = 14,
90 } HW_SYS_BSR_PERIPH_ID;
104 extern __RETAINED uint32_t hw_sys_sw_bsr[BSR_PERIPH_ID_MAX];
107 HW_SYS_REMAP_ADDRESS_0_TO_ROM,
108 HW_SYS_REMAP_ADDRESS_0_TO_EFLASH,
109 HW_SYS_REMAP_ADDRESS_0_TO_QSPI_FLASH,
110 HW_SYS_REMAP_ADDRESS_0_TO_RAM,
111 } HW_SYS_REMAP_ADDRESS_0;
113 __STATIC_INLINE
void hw_sys_set_memory_remapping(HW_SYS_REMAP_ADDRESS_0 value)
116 REG_SETF(CRG_TOP, SYS_CTRL_REG, REMAP_ADR0, value);
120 __STATIC_INLINE HW_SYS_REMAP_ADDRESS_0 hw_sys_get_memory_remapping(
void)
122 HW_SYS_REMAP_ADDRESS_0 value;
124 value =
REG_GETF(CRG_TOP, SYS_CTRL_REG, REMAP_ADR0);
162 CRG_TOP->RAM_PWR_CTRL_REG = RETMEM_RETAIN_NONE;
171 CRG_TOP->RESET_STAT_REG = 0;
182 REG_SET_BIT(CRG_TOP, PMU_CTRL_REG, RESET_ON_WAKEUP);
212 REG_SET_BIT(CRG_TOP, SYS_CTRL_REG, DEBUGGER_ENABLE);
223 REG_CLR_BIT(CRG_TOP, SYS_CTRL_REG, DEBUGGER_ENABLE);
235 return (
REG_GETF(CRG_TOP, SYS_STAT_REG, DBG_IS_ACTIVE) != 0);
246 REG_SET_BIT(CRG_TOP, HIBERN_CTRL_REG, HIBERNATION_ENABLE);
260 REG_SET_BIT(CRG_TOP, CLK_RADIO_REG, CMAC_CLK_ENABLE);
271 REG_CLR_BIT(CRG_TOP, CLK_RADIO_REG, CMAC_CLK_ENABLE);
321 ASSERT_WARNING(time <= (
REG_MSK(CRG_TOP, POR_TIMER_REG, POR_TIME)
322 >>
REG_POS(CRG_TOP, POR_TIMER_REG, POR_TIME)));
323 REG_SETF(CRG_TOP, POR_TIMER_REG, POR_TIME, time);
#define REG_POS(base, reg, field)
Access register field position.
Definition: sdk_defs.h:591
__STATIC_INLINE void hw_sys_setup_retmem(void)
Setup the Retention Memory configuration.
Definition: hw_sys.h:145
#define REG_SETF(base, reg, field, new_val)
Set the value of a register field.
Definition: sdk_defs.h:738
HW_PD
Hardware power domains.
Definition: hw_pd.h:54
#define REG_CLR_BIT(base, reg, field)
Clear a bit of a register.
Definition: sdk_defs.h:781
void hw_sys_hw_bsr_unlock(HW_BSR_MASTER_ID hw_bsr_master_id, HW_BSR_POS pos)
Unlock a BSR entry.
__STATIC_INLINE void hw_sys_enable_reset_on_wup(void)
Activate the "Reset on wake-up" functionality.
Definition: hw_sys.h:179
#define REG_SET_BIT(base, reg, field)
Set a bit of a register.
Definition: sdk_defs.h:766
#define __RETAINED
Zero-initialized data retained memory attribute.
Definition: sdk_defs.h:312
__STATIC_FORCEINLINE bool hw_sys_is_debugger_attached(void)
Check if the debugger is attached.
Definition: hw_sys.h:233
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.
__STATIC_INLINE void hw_sys_no_retmem(void)
Disable memory retention.
Definition: hw_sys.h:158
__ALWAYS_RETAINED_CODE void hw_sys_assert_trigger_gpio(void)
Trigger a GPIO when ASSERT_WARNING() or ASSERT_ERROR() hits.
__STATIC_FORCEINLINE void hw_pd_power_up_rad(void)
Power up the Radio Power Domain.
Definition: hw_pd.h:111
Definition of API for the Memory Controller Low Level Driver.
Central include header file with platform definitions.
#define dg_configMEM_RETENTION_MODE
Retention memory configuration.
Definition: bsp_memory_defaults_da1459x.h:216
__IO uint32_t * addr
Register address.
Definition: hw_sys.h:97
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.
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 (CMA...
__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_get_num_of_config_entries(void)
Get the number of entries in the system register configuration table.
void hw_sys_apply_default_values(void)
Checks whether there are register entries in CS for the following registers.
#define __IO
Definition: core_cm0.h:169
void hw_sys_setup_sw_cursor(void)
Set the GPIO used for the SW cursor to High-Z.
void hw_sys_sw_bsr_init(void)
Initializes the software busy status register.
void hw_sys_pd_com_enable(void)
Enables the COM power domain.
void hw_sys_pd_periph_enable(void)
Enables the PERIPH power domain.
void hw_sys_enable_cmac_mem_protection(void)
Enables read only protection in CMAC code and data.
#define REG_MSK(base, reg, field)
Access register field mask.
Definition: sdk_defs.h:583
void hw_sys_enable_ivt_mem_protection(void)
Enables "Read-only by any privilege level" and "execute_never" memory protection of IVT.
__STATIC_FORCEINLINE void hw_sys_disable_debugger(void)
Disable the debugger.
Definition: hw_sys.h:220
__STATIC_FORCEINLINE void hw_sys_enable_hibernation(void)
Enable hibernation mode.
Definition: hw_sys.h:243
Register configuration.
Definition: hw_sys.h:96
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 (...
void hw_sys_reg_modify_config(uint32_t index, __IO uint32_t *addr, uint32_t value)
Modify a register configuration entry.
void hw_sys_set_preferred_values(HW_PD pd)
Set the preferred settings of a power domain.
Power Domain Driver header file.
__STATIC_INLINE void hw_pd_power_down_rad(void)
Power down the Radio Power Domain.
Definition: hw_pd.h:127
#define GLOBAL_INT_RESTORE()
Macro to restore all interrupts.
Definition: sdk_defs.h:477
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.
uint32_t value
Register value.
Definition: hw_sys.h:98
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.
void hw_sys_trigger_sw_cursor(void)
Triggers the GPIO used for the SW cursor.
__STATIC_INLINE void hw_sys_set_cache_retained(void)
Enable Cache retainability.
Definition: hw_sys.h:133
#define REG_GETF(base, reg, field)
Return the value of a register field.
Definition: sdk_defs.h:711
void hw_sys_pd_periph_disable(void)
Disables the PERIPH power domain. If it has not been enabled by any other modules,...
__STATIC_FORCEINLINE void hw_sys_set_por_timer(uint8_t time)
Set POR-trigger minimum duration.
Definition: hw_sys.h:319
__STATIC_FORCEINLINE void hw_sys_disable_cmac_cache_ram(void)
Disable CMAC cache RAM.
Definition: hw_sys.h:269
__RETAINED_CODE void hw_sys_reg_apply_config(void)
Apply system register configuration.
__RETAINED_CODE void hw_sys_pd_audio_enable(void)
Enables the AUDIO power domain.
__STATIC_FORCEINLINE void hw_sys_enable_debugger(void)
Enable the debugger.
Definition: hw_sys.h:209
__STATIC_FORCEINLINE void hw_sys_track_reset_type(void)
Prepare RESET type tracking.
Definition: hw_sys.h:169
hw_sys_reg_config_t * hw_sys_reg_get_config(uint32_t index)
Get a register configuration entry.
#define GLOBAL_INT_DISABLE()
Macro to disable all interrupts.
Definition: sdk_defs.h:452
__STATIC_FORCEINLINE void hw_sys_enable_cmac_cache_ram(void)
Enable CMAC cache RAM.
Definition: hw_sys.h:257