pwm2ch Library  v0.50
Use one or more cogs to send one or multiple PWM signals. Each cog can send up to 2.
pwm2ch.h
Go to the documentation of this file.
1 
20 #ifndef PWM2CH_H
21 #define PWM2CH_H
22 
23 #if defined(__cplusplus)
24 extern "C" {
25 #endif
26 
27 #include "simpletools.h"
28 
29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
30 typedef struct pwm2ch_st
31 {
32  volatile unsigned int tCycle;
33  volatile unsigned int ticksA;
34  volatile unsigned int ticksB;
35  volatile unsigned int ctra;
36  volatile unsigned int ctrb;
37  volatile unsigned int pin;
38  volatile int pwm2cog;
39  int pwm2stack[100];
40 } pwm2ch_t;
41 #endif // DOXYGEN_SHOULD_SKIP_THIS
42 
43 
44 typedef pwm2ch_t pwm2ch;
45 
46 
47 
58 pwm2ch * pwm2ch_start(unsigned int cycleMicroseconds);
59 
72 void pwm2ch_set(pwm2ch *device, int pin, int channel, int tHigh);
73 
80 void pwm2ch_stop(pwm2ch *device);
81 
82 
89 #if defined(__cplusplus)
90 }
91 #endif
92 /* __cplusplus */
93 #endif
94 /* SIMPLETOOLS_H */
95 
void pwm2ch_set(pwm2ch *device, int pin, int channel, int tHigh)
Set a PWM signal's high time.
Definition: pwm2ch.c:38
pwm2ch * pwm2ch_start(unsigned int cycleMicroseconds)
Start PWM process in another cog.
Definition: pwm2ch.c:26
void pwm2ch_stop(pwm2ch *device)
Shut down pwm2ch process and reclaim cog and I/O pins for other uses.
Definition: pwm2ch.c:64
Definition: pwm2ch.h:30