diff options
author | Punit Vara <punitvara@gmail.com> | 2016-07-04 15:02:05 -0300 |
---|---|---|
committer | Martin Galvan <martin.galvan@tallertechnologies.com> | 2016-07-04 15:08:54 -0300 |
commit | 6dc5c03fad3ddd51423d21b5d60d24b62bb653e9 (patch) | |
tree | 93e26ac736be84ec514afde6970117cb35781eb9 /c/src/lib/libbsp/arm/beagle/include/bbb-pwm.h | |
parent | bsps/arm: basic on core cache support changed to use l1 functions. (diff) | |
download | rtems-6dc5c03fad3ddd51423d21b5d60d24b62bb653e9.tar.bz2 |
Beaglebone: Add original BBBIO PWM driver
This patch adds the PWM driver code for the Beaglebone Black from BBBIO:
https://github.com/VegetableAvenger/BBBIOlib/blob/master/BBBio_lib/BBBiolib_PWMSS.c
This commit is for tracking purposes only; the next commit will adapt the code for
RTEMS.
Diffstat (limited to '')
-rw-r--r-- | c/src/lib/libbsp/arm/beagle/include/bbb-pwm.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/c/src/lib/libbsp/arm/beagle/include/bbb-pwm.h b/c/src/lib/libbsp/arm/beagle/include/bbb-pwm.h new file mode 100644 index 0000000000..761eae2b37 --- /dev/null +++ b/c/src/lib/libbsp/arm/beagle/include/bbb-pwm.h @@ -0,0 +1,41 @@ +#ifndef LIBBSP_ARM_BEAGLE_BBB_PWM_H +#define LIBBSP_ARM_BEAGLE_BBB_PWM_H + +#ifdef __cplusplus +extern "C" { +#endif /* __cplusplus */ + +/** + * @brief BeagleBone Black PWM Macros. + */ +#define BBBIO_PWMSS_COUNT 3 +#define BBBIO_PWMSS0 0 +#define BBBIO_PWMSS1 1 +#define BBBIO_PWMSS2 2 + +#define MUXMODE0 0 +#define MUXMODE1 1 +#define MUXMODE2 2 +#define MUXMODE3 3 +#define MUXMODE4 4 +#define MUXMODE5 5 +#define MUXMODE6 6 +#define MUXMODE7 7 + +#define EPWM_GROUP1 1 +#define EPWM_GROUP2 2 +#define EPWM_GROUP0 0 + +int BBBIO_PWMSS_Setting(unsigned int PWMID , float HZ ,float dutyA ,float dutyB); +int BBBIO_PWM_Init(); +void BBBIO_PWM_Release(); +int BBBIO_PWMSS_Status(unsigned int PWMID); +void BBBIO_ehrPWM_Enable(unsigned int PWMSS_ID); +void BBBIO_ehrPWM_Disable(unsigned int PWMSS_ID); + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#endif /* LIBBSP_ARM_BEAGLE_BBB_PWM_H */ |