I have obtained a PWM code online written in C. What is the equivalent code if it is written in Energia - .ino file using Energia IDE libraries?
Here is the code:
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
if (CALBC1_1MHZ==0xFF) // If calibration constant erased
while(1); // do not load, trap CPU!!
DCOCTL = 0; // Select lowest DCOx and MODx settings
BCSCTL1 = CALBC1_1MHZ; // Set range
DCOCTL = CALDCO_1MHZ; // Set DCO step + modulation */
P1DIR |= BIT6;
P1SEL |= BIT6;
TACCR0 = 20000-1; // PWM Period 20us (substract 1 because it's 0-based)
TACCTL1 = OUTMOD_3;
TACCR1 = 10000; // CCR1 PWM duty cycle
TACTL = TASSEL_2 + MC_1; // SMCLK, up mode
_BIS_SR(CPUOFF); // Enter LPM0
Any help is much appreciated.