dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
led_pwm.h
Go to the documentation of this file.
1 
11 /*
12  * This program is free software; you can redistribute it and/or modify
13  * it under the terms of the GNU General Public License as published by
14  * the Free Software Foundation; either version 3 of the License, or
15  * (at your option) any later version.
16  *
17  * This program is distributed in the hope that it will be useful, but
18  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
20  * for more details.
21  *
22  * You should have received a copy of the GNU General Public License along
23  * with this program; if not, see <http://www.gnu.org/licenses/>
24  */
25 
26 #ifndef LED_PWM_H_
27 #define LED_PWM_H_
28 
29 #include <stdint.h> /* uint*_t */
30 #include <stdbool.h> /* bool */
31 
32 struct led_pwm_state {
33  uint32_t uptime_us;
34 
36  uint32_t pwm_1_period_us;
38 
40  uint32_t pwm_2_period_us;
42 
43 #ifdef PIOS_INCLUDE_WS2811
44  uint32_t last_ws2811_us;
45 #endif
46 };
47 
48 extern void led_pwm_config(struct led_pwm_state * leds, uint32_t pwm_1_period_us, uint32_t pwm_1_sweep_steps, uint32_t pwm_2_period_us, uint32_t pwm_2_sweep_steps);
49 
50 extern void led_pwm_add_ticks(struct led_pwm_state *leds, uint32_t elapsed_us);
51 
52 extern bool led_pwm_update_leds(struct led_pwm_state *leds);
53 
54 #endif /* LED_PWM_H_ */
55 
bool led_pwm_update_leds(struct led_pwm_state *leds)
Definition: led_pwm.c:82
uint32_t pwm_2_sweep_steps
Definition: led_pwm.h:41
uint32_t pwm_1_period_us
Definition: led_pwm.h:36
void led_pwm_add_ticks(struct led_pwm_state *leds, uint32_t elapsed_us)
Definition: led_pwm.c:77
uint32_t pwm_2_period_us
Definition: led_pwm.h:40
bool pwm_2_enabled
Definition: led_pwm.h:39
void led_pwm_config(struct led_pwm_state *leds, uint32_t pwm_1_period_us, uint32_t pwm_1_sweep_steps, uint32_t pwm_2_period_us, uint32_t pwm_2_sweep_steps)
Definition: led_pwm.c:51
uint32_t pwm_1_sweep_steps
Definition: led_pwm.h:37
bool pwm_1_enabled
Definition: led_pwm.h:35
uint32_t uptime_us
Definition: led_pwm.h:33