pic_pwm.h File Reference
Software (timer-based) PWM.
More...
Go to the source code of this file.
Detailed Description
Function Documentation
uns8 pwm_get_level |
( |
uns8 |
pwm_item |
) |
|
00050 {
00051 return pwm_level[pwm_item];
00052 }
00070 {
00071 uns8 count;
00072
00073 pwm_count++;
00074
00075 if (pwm_count == 0) {
00076 set_pin(PWM_PORT_0, PWM_PIN_0);
00077 #if PWM_NUM_PINS > 1
00078 set_pin(PWM_PORT_1, PWM_PIN_1);
00079 #endif
00080 #if PWM_NUM_PINS > 2
00081 set_pin(PWM_PORT_2, PWM_PIN_2);
00082 #endif
00083 }
00084 if (pwm_level[0] == pwm_count) {
00085 clear_pin(PWM_PORT_0, PWM_PIN_0);
00086 }
00087 #if PWM_NUM_PINS > 1
00088 if (pwm_level[1] == pwm_count) {
00089 clear_pin(PWM_PORT_1, PWM_PIN_1);
00090 }
00091 #endif
00092 #if PWM_NUM_PINS > 2
00093 if (pwm_level[2] == pwm_count) {
00094 clear_pin(PWM_PORT_2, PWM_PIN_2);
00095 }
00096 #endif
00097 }
void pwm_set_level |
( |
uns8 |
pwm_item, |
|
|
uns8 |
level | |
|
) |
| | |
00045 {
00046
00047 pwm_level[pwm_item] = level;
00048 }
void pwm_set_transition |
( |
uns8 |
to_level, |
|
|
uns16 |
steps | |
|
) |
| | |
00058 {
00059
00060 make_output(PWM_PORT_0, PWM_PIN_0);
00061 #if PWM_NUM_PINS > 1
00062 make_output(PWM_PORT_1, PWM_PIN_1);
00063 #endif
00064 #if PWM_NUM_PINS > 2
00065 make_output(PWM_PORT_2, PWM_PIN_2);
00066 #endif
00067
00068 }
Variable Documentation