diff options
author | Damien George <damien.p.george@gmail.com> | 2014-04-21 16:48:16 +0100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2014-04-21 16:48:16 +0100 |
commit | 7fdfa93700e0f5a5381a57bca3c45865c720dc2f (patch) | |
tree | c8516645bc8544d8c48720deb2113ae7944b8cf3 /stmhal/timer.h | |
parent | e5f8a77db6b7328b9583cbd0fe6ac73535fca1a0 (diff) | |
download | micropython-7fdfa93700e0f5a5381a57bca3c45865c720dc2f.tar.gz micropython-7fdfa93700e0f5a5381a57bca3c45865c720dc2f.zip |
stmhal: Add Timer class: simple TIM control, incl callback on IRQ.
Simple but functional timer control. More sophistication will
eventually be added, or for now just use direct register access :)
Also added pyb.freq() function to get MCU clock frequencies.
Diffstat (limited to 'stmhal/timer.h')
-rw-r--r-- | stmhal/timer.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/stmhal/timer.h b/stmhal/timer.h index 06e19bcc8b..de8e7374a4 100644 --- a/stmhal/timer.h +++ b/stmhal/timer.h @@ -7,6 +7,11 @@ extern TIM_HandleTypeDef TIM3_Handle; extern TIM_HandleTypeDef TIM5_Handle; extern TIM_HandleTypeDef TIM6_Handle; +extern const mp_obj_type_t pyb_timer_type; + +void timer_init0(void); void timer_tim3_init(void); void timer_tim5_init(void); void timer_tim6_init(uint freq); + +void timer_irq_handler(uint tim_id); |