STC15W408AS library
0.17.0
Loading...
Searching...
No Matches
include
timer2_mode0_to_ms.h
Go to the documentation of this file.
1
#ifndef STC15_TIMER2_MODE0_TO_MSH
2
#define STC15_TIMER2_MODE0_TO_MSH
3
13
#include <stdint.h>
14
#include <
frequency.h
>
15
#include <
timer2_mode0.h
>
16
#include <
timer_common.h
>
17
#include <
timer_to_ms_common.h
>
18
23
36
#define timer2_mode0_ticks_to_Hz(ticks) (timer_ticks_to_Hz(ticks, get_timer2_clock_divider(), get_frequency_divider_scale()))
37
50
#define timer2_mode0_Hz_to_ticks(frequency) (timer_Hz_to_ticks(frequency, get_timer2_clock_divider(), get_frequency_divider_scale()))
52
57
68
#define timer2_mode0_ticks_to_ms(ticks) (timer_16bit_ticks_to_ms(ticks, get_timer2_clock_divider(), get_frequency_divider_scale()))
69
83
#define timer2_mode0_ms_to_ticks(ms) (timer_ms_to_ticks(ms, get_timer2_clock_divider(), get_frequency_divider_scale()))
85
86
91
99
#define timer2_mode0_start_ms(ms) \
100
do \
101
{ \
102
uint16_t ticks = timer2_mode0_ms_to_ticks(ms); \
103
timer2_mode0_start(ticks); \
104
} while (0);
105
113
#define timer2_mode0_start_Hz(freq) \
114
do \
115
{ \
116
uint16_t ticks = timer2_mode0_Hz_to_ticks(freq); \
117
timer2_mode0_start(ticks); \
118
} while (0);
119
120
122
123
124
#endif
frequency.h
timer2_mode0.h
timer_common.h
timer_to_ms_common.h
Generated by
1.9.8