| STC15W408AS library 0.12.0
    | 
| Macros | |
| #define | T0 P34 | 
| T0 pin definition. | |
| #define | INT0 P32 | 
| INT0 pin definition. | |
| init | |
| Counter initializaion functions | |
| #define | counter0_mode1_init() | 
| Initialize mode1 for counter0. | |
| start/stop | |
| Counter0 start/stop functions | |
| #define | counter0_mode1_start(value) | 
| Starts Counter 0 in Mode 1 with a specified initial value. | |
| #define | is_counter0_mode1_started() (TR0 == 1) | 
| Check if counter0 is started. | |
| #define | counter0_mode1_stop() | 
| Stop counter0. | |
| read | |
| Counter read value functions | |
| #define | counter0_mode1_get_value() ((((uint16_t) TH0) << 8) | TL0) | 
| Get counter0 value in mode1. | |
Counter0 mode 1 routines.
This module supports general purpose counter0. Timer can work as COUNTER or TIMER.
Counter increments on T0 pin change state.
Counter0 Mode1 is 16-bit counter. Mode1 is like mode0 but without reloading and P35 pin output features.
| #define counter0_mode1_get_value | ( | ) | ((((uint16_t) TH0) << 8) | TL0) | 
Get counter0 value in mode1.
| #define counter0_mode1_init | ( | ) | 
Initialize mode1 for counter0.
Enable counter0 interrupt and set mode1.
Mode 1 is configured as setting TMOD lowest 4 bytes:
| #define counter0_mode1_start | ( | value | ) | 
Starts Counter 0 in Mode 1 with a specified initial value.
Loads the initial 16-bit value into Counter 0 registers and starts the counter.
| value | 16-bit unsigned integer specifying the initial counter count | 
| #define counter0_mode1_stop | ( | ) | 
Stop counter0.
Stop counter0 and clear TF0 flag.
| #define is_counter0_mode1_started | ( | ) | (TR0 == 1) | 
Check if counter0 is started.