sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pwm.h
Go to the documentation of this file.
1 #ifndef PWM_H
2 #define PWM_H
3 
4 #include "dev_data.h"
5 #include "features.h"
6 #include "timer.h"
7 
8 #if defined(N_PWM)
9 
10 typedef struct {
11  uint8_t port;
12  uint8_t flags;
13  timer_t timer;
14  uint16_t t_on,t_off;
15 #define PWM_ALERT (1<<0) // alert when one-shot PWM stops
16 #define PWM_FORCE (1<<1) // switch immediately when setting PWM
17 #define PWM_IS_ALERT (1<<6) // alert present
18 #define PWM_IS_ON (1<<7) // PWM is in OM phase
19 } pwm_t;
20 
21 extern pwm_t pwms[];
22 
23 #endif // any PWMs at all
24 #endif // pwm_h