49 #define PWMSS0_BASE 0x48300000 50 #define PWMSS1_BASE 0x48302000 52 #define EPWM_OFFSET 0x0200 57 #define PWM_SIZE 0x00000FFF 61 #define TBCTL (EPWM_OFFSET + 0x0) / sizeof(uint16_t) // counter control 62 #define TBPRD (EPWM_OFFSET + 0xA) / sizeof(uint16_t) // period 64 #define CMPA (EPWM_OFFSET + 0x12) / sizeof(uint16_t) // compare 66 #define CMPB (EPWM_OFFSET + 0x14) / sizeof(uint16_t) 68 #define AQCTLA (EPWM_OFFSET + 0x16) / sizeof(uint16_t) // action qualifier 70 #define AQCTLB (EPWM_OFFSET + 0x18) / sizeof(uint16_t) 75 #define TBCTL_DEFAULT 0xC000 76 #define UP_DOWN_COUNT 0x0002 78 #define PRESCALE2 0x0400 83 #define RWC_AQ_A 0x0060 // set when incrementing, clear when decrementing 84 #define RWC_AQ_B 0x0900 // set when decrementing, clear when incrementing 89 #define PULSE_WIDTH 0.1 // 10% of sampling period 92 #define PWM_PERIOD_SCALE \ 95 (1 + PULSE_WIDTH + MARGIN) // period scaling factor (period is set in 100 #define ADC_CLOCK_PERIOD 48 // in 10ns 101 #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)