00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00035 #ifndef _PWM_H_
00036 #define _PWM_H_
00037
00038 #include <aversive.h>
00039 #include <aversive/timers.h>
00040 #include <aversive/parts.h>
00041
00042 #include <pwm_config.h>
00043
00044
00045
00047 #define PWM_NORMAL 0x00
00048 #define PWM_REVERSE 0x01
00049 #define PWM_SIGN_INVERTED 0x02
00050 #define PWM_SIGNED 0x04
00051 #define PWM_SPECIAL_SIGN_MODE 0x08
00052
00054 #define PWM_MAX ((1<< PWM_SIGNIFICANT_BITS)-1)
00055 #define PWM_MIN (-PWM_MAX)
00056
00057
00059 extern void pwm_init(void);
00060
00066 extern void pwm_set(void * data, int32_t value);
00067
00068
00069 #if (defined PWM1A_NUM) && (defined PWM1A_ENABLED)
00070 extern void pwm_init_1A(void);
00071 extern void pwm_set_1A(int16_t value);
00072 #endif // (defined PWM1A_NUM) && (defined PWM1A_ENABLED)
00073
00074 #if (defined PWM1B_NUM) && (defined PWM1B_ENABLED)
00075 extern void pwm_init_1B(void);
00076 extern void pwm_set_1B(int16_t value);
00077 #endif // (defined PWM1B_NUM) && (defined PWM1B_ENABLED)
00078
00079 #if (defined PWM1C_NUM) && (defined PWM1C_ENABLED)
00080 extern void pwm_init_1C(void);
00081 extern void pwm_set_1C(int16_t value);
00082 #endif // (defined PWM1C_NUM) && (defined PWM1C_ENABLED)
00083
00084 #if (defined PWM2_NUM) && (defined PWM2_ENABLED)
00085 extern void pwm_init_2(void);
00086 extern void pwm_set_2(int16_t value);
00087 #endif // (defined PWM2_NUM) && (defined PWM2_ENABLED)
00088
00089 #if (defined PWM3A_NUM) && (defined PWM3A_ENABLED)
00090 extern void pwm_init_3A(void);
00091 extern void pwm_set_3A(int16_t value);
00092 #endif // (defined PWM3A_NUM) && (defined PWM3A_ENABLED)
00093
00094 #if (defined PWM3B_NUM) && (defined PWM3B_ENABLED)
00095 extern void pwm_init_3B(void);
00096 extern void pwm_set_3B(int16_t value);
00097 #endif // (defined PWM3B_NUM) && (defined PWM3B_ENABLED)
00098
00099 #if (defined PWM3C_NUM) && (defined PWM3C_ENABLED)
00100 extern void pwm_init_3C(void);
00101 extern void pwm_set_3C(int16_t value);
00102 #endif // (defined PWM3C_NUM) && (defined PWM3C_ENABLED)
00103
00104
00105 #endif // _PWM_H_