CCAux
2.8.3.0
CCAux API reference
Main Page
Namespaces
Data Structures
Files
File List
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
IncludeFiles
PWMOut.h
Go to the documentation of this file.
1
/************************************************
2
*
3
* CROSSCONTROL AUX API
4
*
5
* PWMOut.h
6
*
7
* Version 2.8.3.0, 2016-04-06
8
*
9
* (c) maximatecc 2013
10
*
11
12
* File description:
13
* PWM Output
14
*
15
* Use the function GetPWMOut() to get a handle to pass on to the other functions.
16
* Use the method PWMOut_release(PWMOUTHANDLE) to return the handle.
17
*
18
* Note: The rise and fall times of the hardware limits the signal's usefulness in high frequencies.
19
* The duty cycle of the PWM signal affects the maximum attainable frequency: at 50% duty cycle, the attainable frequecy is at it's maximum.
20
* If the duty cycle is near 0 or 100%, the rise/fall times of the signal means that the maximum attainable frequency is significantly lower.
21
* A PWM signal is generated when both the frequency and the duty cycle of a channel is not zero.
22
*
23
* Example Usage:
24
* @include pwmout_example.cpp
25
*
26
************************************************/
27
#ifndef CC_PWMOUT_H
28
#define CC_PWMOUT_H
29
30
#include "
CCAuxErrors.h
"
31
#include "
CCPlatform.h
"
32
33
#ifdef __cplusplus
34
namespace
CrossControl {
35
#endif
36
37
typedef
void
*
PWMOUTHANDLE
;
38
52
EXTERN_C
53
CCAUXDLL_API
54
PWMOUTHANDLE
55
CCAUXDLL_CALLING_CONV
56
GetPWMOut
(
void
);
57
68
EXTERN_C
69
CCAUXDLL_API
70
void
71
CCAUXDLL_CALLING_CONV
72
PWMOut_release
(
PWMOUTHANDLE
);
73
88
EXTERN_C
89
CCAUXDLL_API
90
eErr
91
CCAUXDLL_CALLING_CONV
92
PWMOut_setPWMOutputChannelDutyCycle
(
PWMOUTHANDLE
,
unsigned
char
channel,
unsigned
char
duty_cycle);
93
108
EXTERN_C
109
CCAUXDLL_API
110
eErr
111
CCAUXDLL_CALLING_CONV
112
PWMOut_setPWMOutputChannelFrequency
(
PWMOUTHANDLE
,
unsigned
char
channel,
float
frequency);
113
128
EXTERN_C
129
CCAUXDLL_API
130
eErr
131
CCAUXDLL_CALLING_CONV
132
PWMOut_getPWMOutputChannelDutyCycle
(
PWMOUTHANDLE
,
unsigned
char
channel,
unsigned
char
* duty_cycle);
133
148
EXTERN_C
149
CCAUXDLL_API
150
eErr
151
CCAUXDLL_CALLING_CONV
152
PWMOut_getPWMOutputChannelFrequency
(
PWMOUTHANDLE
,
unsigned
char
channel,
float
* frequency);
153
170
EXTERN_C
171
CCAUXDLL_API
172
eErr
173
CCAUXDLL_CALLING_CONV
174
PWMOut_getPWMOutputStatus
(
PWMOUTHANDLE
,
unsigned
char
* status);
175
189
EXTERN_C
190
CCAUXDLL_API
191
eErr
192
CCAUXDLL_CALLING_CONV
193
PWMOut_setPWMOutOff
(
PWMOUTHANDLE
,
unsigned
char
channel);
194
195
#ifdef __cplusplus
196
}
/* namespace CrossControl */
197
#endif
198
199
#endif
/* CC_PWMOUT_H */
200
Generated on Wed Apr 6 2016 19:46:22 for CCAux by
1.8.3.1