ledc_dev->timer_group[group].timer[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_dev->timer_group[group].timer[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.
ledc_dev->timer_group[group].timer[timer].conf.low_speed_update=1;//This bit is only useful for low speed timer channels, reserved for high speed timers
ledc_dev->channel_group[group].channel[channel].conf0.timer_sel=timer;//2 bit Selects the timer to attach 0-3
ledc_dev->channel_group[group].channel[channel].conf0.idle_lv=idle_level;//1 bit This bit is used to control the output value when channel is off.
ledc_dev->channel_group[group].channel[channel].hpoint.hpoint=0;//20 bit The output value changes to high when timer selected by channel has reached hpoint
ledc_dev->channel_group[group].channel[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_dev->channel_group[group].channel[channel].conf1.duty_num=1;//10 bit This register is used to control the number of increased or decreased times for channel
ledc_dev->channel_group[group].channel[channel].conf1.duty_cycle=1;//10 bit This register is used to increase or decrease the duty every duty_cycle cycles for channel
ledc_dev->channel_group[group].channel[channel].conf1.duty_scale=0;//10 bit This register controls the increase or decrease step scale for channel.
ledc_dev->channel_group[group].channel[channel].conf0.sig_out_en=0;//This is the output enable control bit for channel
ledc_dev->channel_group[group].channel[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_dev->channel_group[group].channel[channel].duty.duty=duty<<4;//25 bit (21.4)
if(duty){
ledc_dev->channel_group[group].channel[channel].conf0.sig_out_en=1;//This is the output enable control bit for channel
ledc_dev->channel_group[group].channel[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_dev->channel_group[group].channel[channel].conf0.sig_out_en=0;//This is the output enable control bit for channel
ledc_dev->channel_group[group].channel[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.