STC15W408AS library 0.16.0
Loading...
Searching...
No Matches
comparator.h
Go to the documentation of this file.
1#ifndef STC15_COMPARATORH
2#define STC15_COMPARATORH
3
4#include <sys.h>
5#include <interrupt.h>
6
24#define comparator_init_async() \
25do { \
26 CMPCR1 = 0x00; \
27 CMPCR2 = 0x09; \
28 \
29 enable_mcu_interrupts(); \
30 enable_comparator_interrupt(ANY_EDGE); \
31} while(0)
32
40#define comparator_start() (bit_set(CMPCR1, SBIT7))
41
49#define comparator_stop() (bit_clr(CMPCR1, CBIT7))
50
51#endif