esp32s2: peripherals: store address of timer peripheral in its struct
.. this is helpful if we need to go down to the esp-idf low level I/O routines
This commit is contained in:
parent
60c9a57815
commit
4de8fa09ab
@ -68,6 +68,8 @@ void peripherals_timer_init(const timer_config_t *config, timer_index_t *timer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
timer->hw = (timer->group == 0) ? &TIMERG0 : &TIMERG1;
|
||||||
|
|
||||||
// initialize timer module
|
// initialize timer module
|
||||||
timer_init(timer->group, timer->idx, config);
|
timer_init(timer->group, timer->idx, config);
|
||||||
timer_set_counter_value(timer->group, timer->idx, 0);
|
timer_set_counter_value(timer->group, timer->idx, 0);
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "driver/timer.h"
|
#include "driver/timer.h"
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
timg_dev_t *hw;
|
||||||
timer_idx_t idx;
|
timer_idx_t idx;
|
||||||
timer_group_t group;
|
timer_group_t group;
|
||||||
} timer_index_t;
|
} timer_index_t;
|
||||||
|
Loading…
Reference in New Issue
Block a user