48 #define PWMSS0_BASE 0x48300000 49 #define PWMSS1_BASE 0x48302000 51 #define EPWM_OFFSET 0x0200 56 #define PWM_SIZE 0x00000FFF 60 #define TBCTL (EPWM_OFFSET + 0x0) / sizeof(uint16_t) // counter control 61 #define TBPRD (EPWM_OFFSET + 0xA) / sizeof(uint16_t) // period 63 #define CMPA (EPWM_OFFSET + 0x12) / sizeof(uint16_t) // compare 65 #define CMPB (EPWM_OFFSET + 0x14) / sizeof(uint16_t) 67 #define AQCTLA (EPWM_OFFSET + 0x16) / sizeof(uint16_t) // action qualifier 69 #define AQCTLB (EPWM_OFFSET + 0x18) / sizeof(uint16_t) 74 #define TBCTL_DEFAULT 0xC000 75 #define UP_DOWN_COUNT 0x0002 77 #define PRESCALE2 0x0400 82 #define RWC_AQ_A 0x0060 // set when incrementing, clear when decrementing 83 #define RWC_AQ_B 0x0900 // set when decrementing, clear when incrementing 88 #define PULSE_WIDTH 0.1 // 10% of sampling period 91 #define PWM_PERIOD_SCALE \ 94 (1 + PULSE_WIDTH + MARGIN) // period scaling factor (period is set in 99 #define ADC_CLOCK_PERIOD 48 // in 10ns 100 #define ADC_AQ 0x0025 // clear on zero and period, set at 50%
void pwm_setup_adc_clock(void)
void pwm_setup_range_clock(int sample_rate)