96 static inline void pwm_set_clk(
int system_clock_hz,
int pwm_clk){
320 static unsigned char index=0;
321 unsigned short cfg_data = pulse_num + ((use_shadow&
BIT(0))<<14) + ((carrier_en&
BIT(0))<<15);
338 return ( carrier_en<<15 | pulse_type | (pulse_num & 0x3fff) );
static void pwm_polo_enable(pwm_id id, int en)
This fuction servers to enable the pwm polarity.
Definition: pwm.h:228
static void pwm_set_cmp(pwm_id id, unsigned short cmp_tick)
This fuction servers to set pwm count status(CMP) time.
Definition: pwm.h:106
#define reg_pwm_ir_fifo_dat(i)
Definition: register_8258.h:880
static void pwm_set_cycle_and_duty(pwm_id id, unsigned short cycle_tick, unsigned short cmp_tick)
This fuction servers to set pwm cycle time & count status.
Definition: pwm.h:128
static void pwm_set_interrupt_enable(PWM_IRQ irq)
This fuction servers to enable the pwm interrupt.
Definition: pwm.h:242
static void pwm_start(pwm_id id)
This fuction servers to start the pwm.
Definition: pwm.h:174
static void pwm_set_clk(int system_clock_hz, int pwm_clk)
This fuction servers to set pwm clock frequency.
Definition: pwm.h:96
#define reg_pwm_ir_fifo_irq_trig_level
Definition: register_8258.h:881
#define reg_pwm_ir_clr_fifo_data
Definition: register_8258.h:890
static unsigned char pwm_ir_fifo_get_data_num(void)
This fuction serves to get the number of data in fifo.
Definition: pwm.h:285
PWM_IRQ
Definition: pwm.h:60
static unsigned char pwm_ir_fifo_is_full(void)
This fuction serves to determine whether data in fifo is full.
Definition: pwm.h:305
#define reg_pwm_max(i)
Definition: register_8258.h:840
static void pwm_revert(pwm_id id)
This fuction servers to revert the PWMx.
Definition: pwm.h:207
#define reg_pwm0_enable
Definition: register_8258.h:828
#define reg_pwm_irq_sta
Definition: register_8258.h:849
Definition: register_8258.h:893
#define reg_dma_chn_en
Definition: register_8258.h:1163
#define reg_pwm_enable
Definition: register_8258.h:827
#define BM_SET(x, mask)
Definition: bsp.h:39
Definition: register_8258.h:1097
static unsigned char pwm_ir_fifo_is_empty(void)
This fuction serves to determine whether data in fifo is empty.
Definition: pwm.h:294
static void pwm_set_mode(pwm_id id, pwm_mode mode)
This fuction servers to set pwm mode.
Definition: pwm.h:83
Definition: register_8258.h:1179
static void pwm_ir_fifo_set_data_entry(unsigned short pulse_num, unsigned char use_shadow, unsigned char carrier_en)
This fuction serves to write data into FiFo.
Definition: pwm.h:318
static void pwm_stop_dma_ir_sending(void)
This fuction servers to stop the pwm's IRQ sending.
Definition: pwm.h:370
static void pwm_ir_fifo_set_irq_trig_level(unsigned char trig_level)
This fuction serves to set trigger level of interrupt for IR FiFo mode.
Definition: pwm.h:266
#define BIT(n)
Definition: bsp.h:33
static void pwm_set_pwm0_shadow_cycle_and_duty(unsigned short cycle_tick, unsigned short cmp_tick)
This fuction servers to set pwm cycle time & count status.
Definition: pwm.h:139
#define reg_pwm0_mode
Definition: register_8258.h:831
pwm_id
enum variable, the number of PWM channels supported
Definition: pwm.h:37
static void pwm_stop(pwm_id id)
This fuction servers to stop the pwm.
Definition: pwm.h:191
static unsigned short pwm_config_dma_fifo_waveform(int carrier_en, Pwm0Pulse_SelectDef pulse_type, unsigned short pulse_num)
This fuction serves to config the pwm's dma wave form.
Definition: pwm.h:335
#define reg_dma7_addrHi
Definition: register_8258.h:1214
Definition: register_8258.h:842
#define reg_pwm_clk
Definition: register_8258.h:829
Definition: register_8258.h:886
#define reg_dma_pwm_addr
Definition: register_8258.h:1157
Definition: register_8258.h:885
Definition: register_8258.h:843
#define reg_pwm_cmp(i)
Definition: register_8258.h:839
#define reg_dma_pwm_mode
Definition: register_8258.h:1159
#define reg_rst0
Definition: register_8258.h:143
static void pwm_clear_interrupt_status(PWM_IRQ irq)
This fuction servers to clear the pwm interrupt.
Definition: pwm.h:255
static void pwm_ir_fifo_clr_data(void)
This fuction serves to clear data in fifo. Only when pwm is in not active mode, it is possible to cle...
Definition: pwm.h:276
static void pwm_set_phase(pwm_id id, unsigned short phase)
This fuction servers to set the pwm phase.
Definition: pwm.h:152
pwm_mode
enum variable used for PWM work mode setting
Definition: pwm.h:49
#define reg_pwm_irq_mask
Definition: register_8258.h:848
#define reg_pwm_tcmp0_shadow
Definition: register_8258.h:877
static void pwm_set_dma_address(void *pdat)
This fuction servers to set the pwm's dma address.
Definition: pwm.h:346
static void pwm_set_cycle(pwm_id id, unsigned short cycle_tick)
This fuction servers to set pwm cycle time.
Definition: pwm.h:117
void sleep_us(unsigned long us)
This function performs to set sleep us.
#define reg_pwm_n_invert
Definition: register_8258.h:835
#define reg_pwm_pol
Definition: register_8258.h:836
#define reg_pwm_cycle(i)
Definition: register_8258.h:838
Definition: register_8258.h:149
#define BM_CLR(x, mask)
Definition: bsp.h:40
#define reg_pwm0_pulse_num
Definition: register_8258.h:846
#define reg_dma_tx_rdy0
Definition: register_8258.h:1165
static void pwm_set_interrupt_disable(PWM_IRQ irq)
Definition: pwm.h:245
static void pwm_set_pulse_num(pwm_id id, unsigned short pulse_num)
This fuction servers to set the pwm pulse number.
Definition: pwm.h:162
#define reg_pwm_tmax0_shadow
Definition: register_8258.h:878
#define reg_pwm_ir_fifo_data_status
Definition: register_8258.h:883
#define reg_pwm_invert
Definition: register_8258.h:834
static void pwm_start_dma_ir_sending(void)
This fuction servers to start the pwm's IRQ sending.
Definition: pwm.h:358
#define MASK_VAL(...)
Definition: bsp.h:94
Pwm0Pulse_SelectDef
Definition: pwm.h:71
static void pwm_n_revert(pwm_id id)
This fuction servers to revert the PWMx_N.
Definition: pwm.h:217
Definition: register_8258.h:887