mirror of
https://github.com/espressif/esp-idf.git
synced 2025-09-30 19:19:21 +00:00
Merge branch 'refactor/timer_group-reg_file-update' into 'master'
refactor/timer_group update reg headers for c3 and s2 Closes IDF-3690 See merge request espressif/esp-idf!14761
This commit is contained in:
@@ -42,6 +42,13 @@ _Static_assert(WDT_RESET_SIG_LENGTH_800ns == TIMG_WDT_RESET_LENGTH_800_NS, "Add
|
||||
_Static_assert(WDT_RESET_SIG_LENGTH_1_6us == TIMG_WDT_RESET_LENGTH_1600_NS, "Add mapping to LL watchdog timeout behavior, since it's no longer naturally compatible with wdt_reset_sig_length_t");
|
||||
_Static_assert(WDT_RESET_SIG_LENGTH_3_2us == TIMG_WDT_RESET_LENGTH_3200_NS, "Add mapping to LL watchdog timeout behavior, since it's no longer naturally compatible with wdt_reset_sig_length_t");
|
||||
|
||||
#define FORCE_MODIFY_WHOLE_REG(i, j, k) \
|
||||
{ \
|
||||
typeof(i) temp_reg = (i); \
|
||||
temp_reg.j = (k); \
|
||||
(i) = temp_reg; \
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable the MWDT
|
||||
*
|
||||
@@ -49,7 +56,7 @@ _Static_assert(WDT_RESET_SIG_LENGTH_3_2us == TIMG_WDT_RESET_LENGTH_3200_NS, "Add
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_enable(timg_dev_t *hw)
|
||||
{
|
||||
hw->wdt_config0.en = 1;
|
||||
hw->wdtconfig0.wdt_en = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -62,7 +69,7 @@ FORCE_INLINE_ATTR void mwdt_ll_enable(timg_dev_t *hw)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_disable(timg_dev_t *hw)
|
||||
{
|
||||
hw->wdt_config0.en = 0;
|
||||
hw->wdtconfig0.wdt_en = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,7 +80,7 @@ FORCE_INLINE_ATTR void mwdt_ll_disable(timg_dev_t *hw)
|
||||
*/
|
||||
FORCE_INLINE_ATTR bool mwdt_ll_check_if_enabled(timg_dev_t *hw)
|
||||
{
|
||||
return (hw->wdt_config0.en) ? true : false;
|
||||
return (hw->wdtconfig0.wdt_en) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -88,20 +95,20 @@ FORCE_INLINE_ATTR void mwdt_ll_config_stage(timg_dev_t *hw, wdt_stage_t stage, u
|
||||
{
|
||||
switch (stage) {
|
||||
case WDT_STAGE0:
|
||||
hw->wdt_config0.stg0 = behavior;
|
||||
hw->wdt_config2 = timeout;
|
||||
hw->wdtconfig0.wdt_stg0 = behavior;
|
||||
hw->wdtconfig2.wdt_stg0_hold = timeout;
|
||||
break;
|
||||
case WDT_STAGE1:
|
||||
hw->wdt_config0.stg1 = behavior;
|
||||
hw->wdt_config3 = timeout;
|
||||
hw->wdtconfig0.wdt_stg1 = behavior;
|
||||
hw->wdtconfig3.wdt_stg1_hold = timeout;
|
||||
break;
|
||||
case WDT_STAGE2:
|
||||
hw->wdt_config0.stg2 = behavior;
|
||||
hw->wdt_config4 = timeout;
|
||||
hw->wdtconfig0.wdt_stg2 = behavior;
|
||||
hw->wdtconfig4.wdt_stg2_hold = timeout;
|
||||
break;
|
||||
case WDT_STAGE3:
|
||||
hw->wdt_config0.stg3 = behavior;
|
||||
hw->wdt_config5 = timeout;
|
||||
hw->wdtconfig0.wdt_stg3 = behavior;
|
||||
hw->wdtconfig5.wdt_stg3_hold = timeout;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -118,16 +125,16 @@ FORCE_INLINE_ATTR void mwdt_ll_disable_stage(timg_dev_t *hw, uint32_t stage)
|
||||
{
|
||||
switch (stage) {
|
||||
case WDT_STAGE0:
|
||||
hw->wdt_config0.stg0 = WDT_STAGE_ACTION_OFF;
|
||||
hw->wdtconfig0.wdt_stg0 = WDT_STAGE_ACTION_OFF;
|
||||
break;
|
||||
case WDT_STAGE1:
|
||||
hw->wdt_config0.stg1 = WDT_STAGE_ACTION_OFF;
|
||||
hw->wdtconfig0.wdt_stg1 = WDT_STAGE_ACTION_OFF;
|
||||
break;
|
||||
case WDT_STAGE2:
|
||||
hw->wdt_config0.stg2 = WDT_STAGE_ACTION_OFF;
|
||||
hw->wdtconfig0.wdt_stg2 = WDT_STAGE_ACTION_OFF;
|
||||
break;
|
||||
case WDT_STAGE3:
|
||||
hw->wdt_config0.stg3 = WDT_STAGE_ACTION_OFF;
|
||||
hw->wdtconfig0.wdt_stg3 = WDT_STAGE_ACTION_OFF;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -142,7 +149,7 @@ FORCE_INLINE_ATTR void mwdt_ll_disable_stage(timg_dev_t *hw, uint32_t stage)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_set_edge_intr(timg_dev_t *hw, bool enable)
|
||||
{
|
||||
hw->wdt_config0.edge_int_en = (enable) ? 1 : 0;
|
||||
hw->wdtconfig0.wdt_edge_int_en = (enable) ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -153,7 +160,7 @@ FORCE_INLINE_ATTR void mwdt_ll_set_edge_intr(timg_dev_t *hw, bool enable)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_set_level_intr(timg_dev_t *hw, bool enable)
|
||||
{
|
||||
hw->wdt_config0.level_int_en = (enable) ? 1 : 0;
|
||||
hw->wdtconfig0.wdt_level_int_en = (enable) ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -164,7 +171,7 @@ FORCE_INLINE_ATTR void mwdt_ll_set_level_intr(timg_dev_t *hw, bool enable)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_set_cpu_reset_length(timg_dev_t *hw, wdt_reset_sig_length_t length)
|
||||
{
|
||||
hw->wdt_config0.cpu_reset_length = length;
|
||||
hw->wdtconfig0.wdt_cpu_reset_length = length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,7 +182,7 @@ FORCE_INLINE_ATTR void mwdt_ll_set_cpu_reset_length(timg_dev_t *hw, wdt_reset_si
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_set_sys_reset_length(timg_dev_t *hw, wdt_reset_sig_length_t length)
|
||||
{
|
||||
hw->wdt_config0.sys_reset_length = length;
|
||||
hw->wdtconfig0.wdt_sys_reset_length = length;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +197,7 @@ FORCE_INLINE_ATTR void mwdt_ll_set_sys_reset_length(timg_dev_t *hw, wdt_reset_si
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_set_flashboot_en(timg_dev_t* hw, bool enable)
|
||||
{
|
||||
hw->wdt_config0.flashboot_mod_en = (enable) ? 1 : 0;
|
||||
hw->wdtconfig0.wdt_flashboot_mod_en = (enable) ? 1 : 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -201,7 +208,9 @@ FORCE_INLINE_ATTR void mwdt_ll_set_flashboot_en(timg_dev_t* hw, bool enable)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_set_prescaler(timg_dev_t *hw, uint32_t prescaler)
|
||||
{
|
||||
hw->wdt_config1.clk_prescale = prescaler;
|
||||
// In case the compiler optimise a 32bit instruction (e.g. s32i) into 8/16bit instruction (e.g. s8i, which is not allowed to access a register)
|
||||
// We take care of the "read-modify-write" procedure by ourselves.
|
||||
FORCE_MODIFY_WHOLE_REG(hw->wdtconfig1, wdt_clk_prescaler, prescaler);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -213,7 +222,7 @@ FORCE_INLINE_ATTR void mwdt_ll_set_prescaler(timg_dev_t *hw, uint32_t prescaler)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_feed(timg_dev_t *hw)
|
||||
{
|
||||
hw->wdt_feed = 1;
|
||||
hw->wdtfeed.wdt_feed = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -225,7 +234,7 @@ FORCE_INLINE_ATTR void mwdt_ll_feed(timg_dev_t *hw)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_write_protect_enable(timg_dev_t *hw)
|
||||
{
|
||||
hw->wdt_wprotect = 0;
|
||||
hw->wdtwprotect.wdt_wkey = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -235,7 +244,7 @@ FORCE_INLINE_ATTR void mwdt_ll_write_protect_enable(timg_dev_t *hw)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_write_protect_disable(timg_dev_t *hw)
|
||||
{
|
||||
hw->wdt_wprotect = TIMG_WDT_WKEY_VALUE;
|
||||
hw->wdtwprotect.wdt_wkey = TIMG_WDT_WKEY_VALUE;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -245,7 +254,7 @@ FORCE_INLINE_ATTR void mwdt_ll_write_protect_disable(timg_dev_t *hw)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_clear_intr_status(timg_dev_t* hw)
|
||||
{
|
||||
hw->int_clr.wdt = 1;
|
||||
hw->int_clr_timers.wdt_int_clr = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -256,7 +265,7 @@ FORCE_INLINE_ATTR void mwdt_ll_clear_intr_status(timg_dev_t* hw)
|
||||
*/
|
||||
FORCE_INLINE_ATTR void mwdt_ll_set_intr_enable(timg_dev_t* hw, bool enable)
|
||||
{
|
||||
hw->int_ena.wdt = (enable) ? 1 : 0;
|
||||
hw->int_ena_timers.wdt_int_ena = (enable) ? 1 : 0;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@@ -48,10 +48,10 @@ static inline void timer_ll_set_divider(timg_dev_t *hw, timer_idx_t timer_num, u
|
||||
if (divider >= 65536) {
|
||||
divider = 0;
|
||||
}
|
||||
int timer_en = hw->hw_timer[timer_num].config.enable;
|
||||
hw->hw_timer[timer_num].config.enable = 0;
|
||||
hw->hw_timer[timer_num].config.divider = divider;
|
||||
hw->hw_timer[timer_num].config.enable = timer_en;
|
||||
int timer_en = hw->hw_timer[timer_num].config.tx_en;
|
||||
hw->hw_timer[timer_num].config.tx_en = 0;
|
||||
hw->hw_timer[timer_num].config.tx_divider = divider;
|
||||
hw->hw_timer[timer_num].config.tx_en = timer_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ static inline void timer_ll_set_divider(timg_dev_t *hw, timer_idx_t timer_num, u
|
||||
*/
|
||||
static inline void timer_ll_get_divider(timg_dev_t *hw, timer_idx_t timer_num, uint32_t *divider)
|
||||
{
|
||||
uint32_t d = hw->hw_timer[timer_num].config.divider;
|
||||
uint32_t d = hw->hw_timer[timer_num].config.tx_divider;
|
||||
if (d == 0) {
|
||||
d = 65536;
|
||||
} else if (d == 1) {
|
||||
@@ -85,9 +85,9 @@ static inline void timer_ll_get_divider(timg_dev_t *hw, timer_idx_t timer_num, u
|
||||
*/
|
||||
static inline void timer_ll_set_counter_value(timg_dev_t *hw, timer_idx_t timer_num, uint64_t load_val)
|
||||
{
|
||||
hw->hw_timer[timer_num].load_high = (uint32_t) (load_val >> 32);
|
||||
hw->hw_timer[timer_num].load_low = (uint32_t) load_val;
|
||||
hw->hw_timer[timer_num].reload = 1;
|
||||
hw->hw_timer[timer_num].loadhi.tx_load_hi = (uint32_t) (load_val >> 32);
|
||||
hw->hw_timer[timer_num].loadlo.tx_load_lo = (uint32_t) load_val;
|
||||
hw->hw_timer[timer_num].load.tx_load = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -101,9 +101,9 @@ static inline void timer_ll_set_counter_value(timg_dev_t *hw, timer_idx_t timer_
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_get_counter_value(timg_dev_t *hw, timer_idx_t timer_num, uint64_t *timer_val)
|
||||
{
|
||||
hw->hw_timer[timer_num].update.update = 1;
|
||||
while (hw->hw_timer[timer_num].update.update) {}
|
||||
*timer_val = ((uint64_t) hw->hw_timer[timer_num].cnt_high << 32) | (hw->hw_timer[timer_num].cnt_low);
|
||||
hw->hw_timer[timer_num].update.tx_update = 1;
|
||||
while (hw->hw_timer[timer_num].update.tx_update) {}
|
||||
*timer_val = ((uint64_t) hw->hw_timer[timer_num].hi.tx_hi << 32) | (hw->hw_timer[timer_num].lo.tx_lo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -117,7 +117,7 @@ FORCE_INLINE_ATTR void timer_ll_get_counter_value(timg_dev_t *hw, timer_idx_t ti
|
||||
*/
|
||||
static inline void timer_ll_set_counter_increase(timg_dev_t *hw, timer_idx_t timer_num, bool increase_en)
|
||||
{
|
||||
hw->hw_timer[timer_num].config.increase = increase_en;
|
||||
hw->hw_timer[timer_num].config.tx_increase = increase_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -132,7 +132,7 @@ static inline void timer_ll_set_counter_increase(timg_dev_t *hw, timer_idx_t tim
|
||||
*/
|
||||
static inline bool timer_ll_get_counter_increase(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
return hw->hw_timer[timer_num].config.increase;
|
||||
return hw->hw_timer[timer_num].config.tx_increase;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,7 +146,7 @@ static inline bool timer_ll_get_counter_increase(timg_dev_t *hw, timer_idx_t tim
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_set_counter_enable(timg_dev_t *hw, timer_idx_t timer_num, bool counter_en)
|
||||
{
|
||||
hw->hw_timer[timer_num].config.enable = counter_en;
|
||||
hw->hw_timer[timer_num].config.tx_en = counter_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -161,7 +161,7 @@ FORCE_INLINE_ATTR void timer_ll_set_counter_enable(timg_dev_t *hw, timer_idx_t t
|
||||
*/
|
||||
static inline bool timer_ll_get_counter_enable(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
return hw->hw_timer[timer_num].config.enable;
|
||||
return hw->hw_timer[timer_num].config.tx_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -175,7 +175,7 @@ static inline bool timer_ll_get_counter_enable(timg_dev_t *hw, timer_idx_t timer
|
||||
*/
|
||||
static inline void timer_ll_set_auto_reload(timg_dev_t *hw, timer_idx_t timer_num, bool auto_reload_en)
|
||||
{
|
||||
hw->hw_timer[timer_num].config.autoreload = auto_reload_en;
|
||||
hw->hw_timer[timer_num].config.tx_autoreload = auto_reload_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -190,7 +190,7 @@ static inline void timer_ll_set_auto_reload(timg_dev_t *hw, timer_idx_t timer_nu
|
||||
*/
|
||||
FORCE_INLINE_ATTR bool timer_ll_get_auto_reload(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
return hw->hw_timer[timer_num].config.autoreload;
|
||||
return hw->hw_timer[timer_num].config.tx_autoreload;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -204,8 +204,8 @@ FORCE_INLINE_ATTR bool timer_ll_get_auto_reload(timg_dev_t *hw, timer_idx_t time
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_set_alarm_value(timg_dev_t *hw, timer_idx_t timer_num, uint64_t alarm_value)
|
||||
{
|
||||
hw->hw_timer[timer_num].alarm_high = (uint32_t) (alarm_value >> 32);
|
||||
hw->hw_timer[timer_num].alarm_low = (uint32_t) alarm_value;
|
||||
hw->hw_timer[timer_num].alarmhi.tx_alarm_hi = (uint32_t) (alarm_value >> 32);
|
||||
hw->hw_timer[timer_num].alarmlo.tx_alarm_lo = (uint32_t) alarm_value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,7 +219,7 @@ FORCE_INLINE_ATTR void timer_ll_set_alarm_value(timg_dev_t *hw, timer_idx_t time
|
||||
*/
|
||||
static inline void timer_ll_get_alarm_value(timg_dev_t *hw, timer_idx_t timer_num, uint64_t *alarm_value)
|
||||
{
|
||||
*alarm_value = ((uint64_t) hw->hw_timer[timer_num].alarm_high << 32) | (hw->hw_timer[timer_num].alarm_low);
|
||||
*alarm_value = ((uint64_t) hw->hw_timer[timer_num].alarmhi.tx_alarm_hi << 32) | (hw->hw_timer[timer_num].alarmlo.tx_alarm_lo);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -233,7 +233,7 @@ static inline void timer_ll_get_alarm_value(timg_dev_t *hw, timer_idx_t timer_nu
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_set_alarm_enable(timg_dev_t *hw, timer_idx_t timer_num, bool alarm_en)
|
||||
{
|
||||
hw->hw_timer[timer_num].config.alarm_en = alarm_en;
|
||||
hw->hw_timer[timer_num].config.tx_alarm_en = alarm_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,7 +248,7 @@ FORCE_INLINE_ATTR void timer_ll_set_alarm_enable(timg_dev_t *hw, timer_idx_t tim
|
||||
*/
|
||||
static inline bool timer_ll_get_alarm_enable(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
return hw->hw_timer[timer_num].config.alarm_en;
|
||||
return hw->hw_timer[timer_num].config.tx_alarm_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -261,8 +261,8 @@ static inline bool timer_ll_get_alarm_enable(timg_dev_t *hw, timer_idx_t timer_n
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_intr_enable(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
hw->int_ena.val |= BIT(timer_num);
|
||||
hw->hw_timer[timer_num].config.level_int_en = 1;
|
||||
hw->int_ena_timers.val |= BIT(timer_num);
|
||||
hw->hw_timer[timer_num].config.tx_level_int_en = 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -275,8 +275,8 @@ FORCE_INLINE_ATTR void timer_ll_intr_enable(timg_dev_t *hw, timer_idx_t timer_nu
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_intr_disable(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
hw->int_ena.val &= (~BIT(timer_num));
|
||||
hw->hw_timer[timer_num].config.level_int_en = 0;
|
||||
hw->int_ena_timers.val &= (~BIT(timer_num));
|
||||
hw->hw_timer[timer_num].config.tx_level_int_en = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -289,7 +289,7 @@ FORCE_INLINE_ATTR void timer_ll_intr_disable(timg_dev_t *hw, timer_idx_t timer_n
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_clear_intr_status(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
hw->int_clr.val |= BIT(timer_num);
|
||||
hw->int_clr_timers.val |= BIT(timer_num);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -302,7 +302,7 @@ FORCE_INLINE_ATTR void timer_ll_clear_intr_status(timg_dev_t *hw, timer_idx_t ti
|
||||
*/
|
||||
FORCE_INLINE_ATTR void timer_ll_get_intr_status(timg_dev_t *hw, uint32_t *intr_status)
|
||||
{
|
||||
*intr_status = hw->int_st.val & 0x03;
|
||||
*intr_status = hw->int_st_timers.val & 0x03;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -316,7 +316,7 @@ FORCE_INLINE_ATTR void timer_ll_get_intr_status(timg_dev_t *hw, uint32_t *intr_s
|
||||
FORCE_INLINE_ATTR void timer_ll_get_intr_raw_status(timer_group_t group_num, uint32_t *intr_raw_status)
|
||||
{
|
||||
timg_dev_t *hw = TIMER_LL_GET_HW(group_num);
|
||||
*intr_raw_status = hw->int_raw.val & 0x03;
|
||||
*intr_raw_status = hw->int_raw_timers.val & 0x03;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -330,7 +330,7 @@ FORCE_INLINE_ATTR void timer_ll_get_intr_raw_status(timer_group_t group_num, uin
|
||||
*/
|
||||
static inline void timer_ll_set_level_int_enable(timg_dev_t *hw, timer_idx_t timer_num, bool level_int_en)
|
||||
{
|
||||
hw->hw_timer[timer_num].config.level_int_en = level_int_en;
|
||||
hw->hw_timer[timer_num].config.tx_level_int_en = level_int_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -345,7 +345,7 @@ static inline void timer_ll_set_level_int_enable(timg_dev_t *hw, timer_idx_t tim
|
||||
*/
|
||||
static inline bool timer_ll_get_level_int_enable(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
return hw->hw_timer[timer_num].config.level_int_en;
|
||||
return hw->hw_timer[timer_num].config.tx_level_int_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -359,7 +359,7 @@ static inline bool timer_ll_get_level_int_enable(timg_dev_t *hw, timer_idx_t tim
|
||||
*/
|
||||
static inline void timer_ll_set_edge_int_enable(timg_dev_t *hw, timer_idx_t timer_num, bool edge_int_en)
|
||||
{
|
||||
hw->hw_timer[timer_num].config.edge_int_en = edge_int_en;
|
||||
hw->hw_timer[timer_num].config.tx_edge_int_en = edge_int_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -374,7 +374,7 @@ static inline void timer_ll_set_edge_int_enable(timg_dev_t *hw, timer_idx_t time
|
||||
*/
|
||||
static inline bool timer_ll_get_edge_int_enable(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
return hw->hw_timer[timer_num].config.edge_int_en;
|
||||
return hw->hw_timer[timer_num].config.tx_edge_int_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -386,7 +386,7 @@ static inline bool timer_ll_get_edge_int_enable(timg_dev_t *hw, timer_idx_t time
|
||||
*/
|
||||
static inline uint32_t timer_ll_get_intr_status_reg(timg_dev_t *hw)
|
||||
{
|
||||
return (uint32_t) & (hw->int_st.val);
|
||||
return (uint32_t) & (hw->int_st_timers.val);
|
||||
}
|
||||
|
||||
static inline uint32_t timer_ll_get_intr_mask_bit(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
@@ -404,7 +404,7 @@ static inline uint32_t timer_ll_get_intr_mask_bit(timg_dev_t *hw, timer_idx_t ti
|
||||
*/
|
||||
static inline void timer_ll_set_use_xtal(timg_dev_t *hw, timer_idx_t timer_num, bool use_xtal_en)
|
||||
{
|
||||
hw->hw_timer[timer_num].config.use_xtal = use_xtal_en;
|
||||
hw->hw_timer[timer_num].config.tx_use_xtal = use_xtal_en;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -418,7 +418,7 @@ static inline void timer_ll_set_use_xtal(timg_dev_t *hw, timer_idx_t timer_num,
|
||||
*/
|
||||
static inline bool timer_ll_get_use_xtal(timg_dev_t *hw, timer_idx_t timer_num)
|
||||
{
|
||||
return hw->hw_timer[timer_num].config.use_xtal;
|
||||
return hw->hw_timer[timer_num].config.tx_use_xtal;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
Reference in New Issue
Block a user