roneos
Operating System for the r-one robot
 All Data Structures Files Functions Variables Typedefs Groups
pwm.h
Go to the documentation of this file.
1 
11 #ifndef PWM_H_
12 #define PWM_H_
13 
14 /* All periods are in 8962 clock cycles
15  * The short period should always look continuous and varying the duty cycle changes the perceived
16  * brightness of one of the RGB LEDs. The long period should result in a visible on/off when
17  * the duty cycle is varied and enable the light to blink.
18  * The super short period is for controlling the power of the IR beacons.
19  * Note that the PWM generator counter is 16 bits.
20  */
21 
22 
23 //#define PERIOD_IRBEACON TODO Need actual number for this. Talk to professor, use math.
24 #define IR_FREQUENCY 38000
25 #define IR_PWM_LEVEL 31
26 #define PWM_FREQUENCY (SYSCTL_CLOCK_FREQ / IR_FREQUENCY * IR_PWM_LEVEL)
27 
28 
34 void pwmInitializeLed(void);
35 
36 
41 void pwmInitializeBeacon(void);
42 
52 void pwmSetDuty (uint32 pwm_target, uint16 duty);
53 
54 
61 void pwmSetDutyAllLeds(uint16 duty);
62 
63 
70 void pwmEnableSingle (uint32 pin_name);
71 
72 
78 void pwmEnableAllLeds(void);
79 
80 
87 void pwmDisableSingle(uint32 pin_name);
88 
89 
95 void pwmDisableAllLeds(void);
96 
97 #endif /* PWM_H_ */