Tool/software: Code Composer Studio
Hello.
My program uses several PWMs. Which are defined as follows:
PWMTimerCC26XX_Object pwmtimerCC26xxObjects[CC1310_LAUNCHXL_PWMCOUNT]; const PWMTimerCC26XX_HwAttrs pwmtimerCC26xxHWAttrs[CC1310_LAUNCHXL_PWMCOUNT] = { { .pwmPin = BUZZ1_PIN, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER1A }, { .pwmPin = BUZZ2_PIN, .gpTimerUnit = CC1310_LAUNCHXL_GPTIMER1B }, }; const PWM_Config PWM_config[CC1310_LAUNCHXL_PWMCOUNT] = { { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[PWM1], &pwmtimerCC26xxHWAttrs[PWM1] }, { &PWMTimerCC26XX_fxnTable, &pwmtimerCC26xxObjects[PWM2], &pwmtimerCC26xxHWAttrs[PWM2] }, }; const uint_least8_t PWM_count = CC1310_LAUNCHXL_PWMCOUNT;
After initialization and use, I need to completely disable PWM so that the MCU consumes less current.
How do I do this correctly?
PWM_Handle pwm1; PWM_Handle pwm2; PWM_Params params1; PWM_Params params2; void PWM_Run(void) { // init PWM_init(); PWM_Params_init(¶ms1); PWM_Params_init(¶ms2); ... // define pwm parameters // run pwm pwm1 = PWM_open(PWM1, ¶ms1); pwm2 = PWM_open(PWM2, ¶ms2); PWM_start(pwm1); PWM_start(pwm2); // wait time sleep(1); // STOP pwm PWM_stop(pwm1); PWM_stop(pwm2); // Close pwm PWM_close(pwm1); PWM_close(pwm2); }