STC15W408AS library 0.9.0
timer2_to_ms.h
Go to the documentation of this file.
1#ifndef STC15_TIMER2_TO_MSH
2#define STC15_TIMER2_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
37#define timer2_uint16_ticks_to_freq100(ticks) (timer_uint16_ticks_to_freq100(ticks, get_timer2_clock_divider(), get_frequency_divider_scale()))
38
54#define timer2_frequency_to_ticks_unsafe(frequency) (timer_frequency_to_ticks_unsafe(frequency, get_timer2_clock_divider(), get_frequency_divider_scale()))
55
66#define timer2_ticks_to_ms_usafe(ticks) (timer_ticks_to_ms_usafe(ticks, get_timer2_clock_divider(), get_frequency_divider_scale()))
67
69
74
126#define timer2_mode0_baudrate_to_ticks(uart_baudrate) ((get_master_clock_frequency() >> get_frequency_divider_scale())/4/uart_baudrate)
127
142#define timer2_ms_to_ticks_usafe(ms) (timer_ms_to_ticks_usafe(ms, get_timer2_clock_divider()))
143
145
146#endif