LEDC_TIMER(group,timer).conf.div_num=div_num;//18 bit (10.8) This register is used to configure parameter for divider in timer the least significant eight bits represent the decimal part.
LEDC_TIMER(group,timer).conf.bit_num=bit_num;//5 bit This register controls the range of the counter in timer. the counter range is [0 2**bit_num] the max bit width for counter is 20.
div_num=LEDC_TIMER(group,timer).conf.div_num;//18 bit (10.8) This register is used to configure parameter for divider in timer the least significant eight bits represent the decimal part.
bit_num=LEDC_TIMER(group,timer).conf.bit_num;//5 bit This register controls the range of the counter in timer. the counter range is [0 2**bit_num] the max bit width for counter is 20.
LEDC_CHAN(group,channel).conf0.timer_sel=timer;//2 bit Selects the timer to attach 0-3
LEDC_CHAN(group,channel).conf0.idle_lv=idle_level;//1 bit This bit is used to control the output value when channel is off.
LEDC_CHAN(group,channel).hpoint.hpoint=0;//20 bit The output value changes to high when timer selected by channel has reached hpoint
LEDC_CHAN(group,channel).conf1.duty_inc=1;//1 bit This register is used to increase the duty of output signal or decrease the duty of output signal for high speed channel
LEDC_CHAN(group,channel).conf1.duty_num=1;//10 bit This register is used to control the number of increased or decreased times for channel
LEDC_CHAN(group,channel).conf1.duty_cycle=1;//10 bit This register is used to increase or decrease the duty every duty_cycle cycles for channel
LEDC_CHAN(group,channel).conf1.duty_scale=0;//10 bit This register controls the increase or decrease step scale for channel.
LEDC_CHAN(group,channel).duty.duty=0;
LEDC_CHAN(group,channel).conf0.sig_out_en=0;//This is the output enable control bit for channel
LEDC_CHAN(group,channel).conf1.duty_start=0;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware.
LEDC_CHAN(group,channel).conf0.sig_out_en=1;//This is the output enable control bit for channel
LEDC_CHAN(group,channel).conf1.duty_start=1;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware.
LEDC_CHAN(group,channel).conf0.sig_out_en=0;//This is the output enable control bit for channel
LEDC_CHAN(group,channel).conf1.duty_start=0;//When duty_num duty_cycle and duty_scale has been configured. these register won't take effect until set duty_start. this bit is automatically cleared by hardware.