19 #define PWMSS0_BASE 0x48300000 20 #define PWMSS1_BASE 0x48302000 22 #define EPWM_OFFSET 0x0200 27 #define PWM_SIZE 0x00000FFF 31 #define TBCTL (EPWM_OFFSET+0x0) / sizeof (uint16_t) // counter control 32 #define TBPRD (EPWM_OFFSET+0xA) / sizeof (uint16_t) // period 34 #define CMPA (EPWM_OFFSET+0x12) / sizeof (uint16_t) // compare 36 #define CMPB (EPWM_OFFSET+0x14) / sizeof (uint16_t) 38 #define AQCTLA (EPWM_OFFSET+0x16) / sizeof (uint16_t) // action qualifier 40 #define AQCTLB (EPWM_OFFSET+0x18) / sizeof (uint16_t) 45 #define TBCTL_DEFAULT 0xC000 46 #define UP_DOWN_COUNT 0x0002 48 #define PRESCALE2 0x0400 54 #define RWC_AQ_A 0x0060 // set when incrementing, clear when decrementing 55 #define RWC_AQ_B 0x0900 // set when decrementing, clear when incrementing 60 #define PULSE_WIDTH 0.1 // 10% of sampling period 63 #define PWM_PERIOD_SCALE 50000000 * (1 + PULSE_WIDTH + MARGIN) // period scaling factor (period is set in 5ns, (/2 clock prescaling)) 69 #define ADC_CLOCK_PERIOD 48 // in 10ns 70 #define ADC_AQ 0x0025 // clear on zero and period, set at 50%
void adc_clock_setup(void)
void range_clock_setup(int sample_rate)