Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // all values are in timer clock cycles of the respective peripheral.
- // eCAP 0-2 run at 100 MHz, i.e. pwm values are in units of 10ns
- // PRUSS eCAP runs at 200 MHz, i.e. pwm values are in units of 5ns
- // ePWM 0-2 run at 100 MHz / prescale divider, configurable per peripheral.
- //
- // using these macros assumes the corresponding peripheral has already been
- // setup as pwm output in advance (from python)
- // macros to get/set the pwm values (in range 0 .. period)
- #define EPWM0A ( *(uint16_t volatile *)0x48300212 )
- #define EPWM0B ( *(uint16_t volatile *)0x48300214 )
- #define EPWM1A ( *(uint16_t volatile *)0x48302212 )
- #define EPWM1B ( *(uint16_t volatile *)0x48302214 )
- #define EPWM2A ( *(uint16_t volatile *)0x48304212 )
- #define EPWM2B ( *(uint16_t volatile *)0x48304214 )
- #define ECAP0_PWM ( *(uint32_t volatile *)0x48300114 )
- #define ECAP1_PWM ( *(uint32_t volatile *)0x48302114 )
- #define ECAP2_PWM ( *(uint32_t volatile *)0x48304114 )
- // macros to get the pwm periods.
- // caution: if an eCAP has been configured to a period of 2**32 cycles then
- // this macro will yield 0 instead.
- #define EPWM0_PERIOD ( *(uint16_t const *)0x4830020a + 1 )
- #define EPWM1_PERIOD ( *(uint16_t const *)0x4830220a + 1 )
- #define EPWM2_PERIOD ( *(uint16_t const *)0x4830420a + 1 )
- #define ECAP0_PWM_PERIOD ( *(uint32_t const *)0x48300110 + 1 )
- #define ECAP1_PWM_PERIOD ( *(uint32_t const *)0x48302110 + 1 )
- #define ECAP2_PWM_PERIOD ( *(uint32_t const *)0x48304110 + 1 )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement