Go to the source code of this file.
Enumerations | |
enum | pwm_id { PWM0_ID = 0, PWM1_ID, PWM2_ID, PWM3_ID, PWM4_ID, PWM5_ID } |
enum variable, the number of PWM channels supported More... | |
enum | pwm_mode { PWM_NORMAL_MODE = 0x00, PWM_COUNT_MODE = 0x01, PWM_IR_MODE = 0x03, PWM_IR_FIFO_MODE = 0x07, PWM_IR_DMA_FIFO_MODE = 0x0F } |
enum variable used for PWM work mode setting More... | |
enum | PWM_IRQ { PWM_IRQ_PWM0_PNUM = BIT(0), PWM_IRQ_PWM0_IR_DMA_FIFO_DONE = BIT(1), PWM_IRQ_PWM0_FRAME = BIT(2), PWM_IRQ_PWM1_FRAME = BIT(3), PWM_IRQ_PWM2_FRAME = BIT(4), PWM_IRQ_PWM3_FRAME = BIT(5), PWM_IRQ_PWM4_FRAME = BIT(6), PWM_IRQ_PWM5_FRAME = BIT(7) } |
enum | Pwm0Pulse_SelectDef { PWM0_PULSE_NORMAL = 0, PWM0_PULSE_SHADOW = BIT(14) } |
Functions | |
static void | pwm_set_mode (pwm_id id, pwm_mode mode) |
This fuction servers to set pwm mode. More... | |
static void | pwm_set_clk (int system_clock_hz, int pwm_clk) |
This fuction servers to set pwm clock frequency. More... | |
static void | pwm_set_cmp (pwm_id id, unsigned short cmp_tick) |
This fuction servers to set pwm count status(CMP) time. More... | |
static void | pwm_set_cycle (pwm_id id, unsigned short cycle_tick) |
This fuction servers to set pwm cycle time. More... | |
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. More... | |
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. More... | |
static void | pwm_set_phase (pwm_id id, unsigned short phase) |
This fuction servers to set the pwm phase. More... | |
static void | pwm_set_pulse_num (pwm_id id, unsigned short pulse_num) |
This fuction servers to set the pwm pulse number. More... | |
static void | pwm_start (pwm_id id) |
This fuction servers to start the pwm. More... | |
static void | pwm_stop (pwm_id id) |
This fuction servers to stop the pwm. More... | |
static void | pwm_revert (pwm_id id) |
This fuction servers to revert the PWMx. More... | |
static void | pwm_n_revert (pwm_id id) |
This fuction servers to revert the PWMx_N. More... | |
static void | pwm_polo_enable (pwm_id id, int en) |
This fuction servers to enable the pwm polarity. More... | |
static void | pwm_set_interrupt_enable (PWM_IRQ irq) |
This fuction servers to enable the pwm interrupt. More... | |
static void | pwm_set_interrupt_disable (PWM_IRQ irq) |
static void | pwm_clear_interrupt_status (PWM_IRQ irq) |
This fuction servers to clear the pwm interrupt. More... | |
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. More... | |
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 clear data in fifo. More... | |
static unsigned char | pwm_ir_fifo_get_data_num (void) |
This fuction serves to get the number of data in fifo. More... | |
static unsigned char | pwm_ir_fifo_is_empty (void) |
This fuction serves to determine whether data in fifo is empty. More... | |
static unsigned char | pwm_ir_fifo_is_full (void) |
This fuction serves to determine whether data in fifo is full. More... | |
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. More... | |
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. More... | |
static void | pwm_set_dma_address (void *pdat) |
This fuction servers to set the pwm's dma address. More... | |
static void | pwm_start_dma_ir_sending (void) |
This fuction servers to start the pwm's IRQ sending. More... | |
static void | pwm_stop_dma_ir_sending (void) |
This fuction servers to stop the pwm's IRQ sending. More... | |
enum pwm_id |
enum pwm_mode |
enum PWM_IRQ |
enum Pwm0Pulse_SelectDef |
This fuction servers to set pwm mode.
[in] | pwm_id | - variable of enum to select the pwm number. |
[in] | mode | - variable of enum to indicates the pwm mode. |
|
inlinestatic |
This fuction servers to set pwm clock frequency.
[in] | system_clock_hz | - variable to set system clock hz. |
[in] | pwm_clk | - variable of the pwm clock. |
|
inlinestatic |
This fuction servers to set pwm count status(CMP) time.
[in] | pwm_id | - variable of enum to select the pwm number. |
[in] | cmp_tick | - variable of the CMP. |
|
inlinestatic |
This fuction servers to set pwm cycle time.
[in] | pwm_id | - variable of enum to select the pwm number. |
[in] | cycle_tick | - variable of the cycle time. |
|
inlinestatic |
This fuction servers to set pwm cycle time & count status.
[in] | pwm_id | - variable of enum to select the pwm number. |
[in] | cycle_tick | - variable of the cycle time. |
[in] | cmp_tick | - variable of the CMP. |
|
inlinestatic |
This fuction servers to set pwm cycle time & count status.
[in] | cycle_tick | - variable of the cycle time. |
[in] | cmp_tick | - variable of the CMP. |
|
inlinestatic |
This fuction servers to set the pwm phase.
[in] | pwm_id | - variable of enum to select the pwm number. |
[in] | phase | - variable of the pwm phase. |
|
inlinestatic |
This fuction servers to set the pwm pulse number.
[in] | pwm_id | - variable of enum to select the pwm number. |
[in] | pulse_num | - variable of the pwm pulse number. |
|
inlinestatic |
This fuction servers to start the pwm.
[in] | pwm_id | - variable of enum to select the pwm number. |
|
inlinestatic |
This fuction servers to stop the pwm.
[in] | pwm_id | - variable of enum to select the pwm number. |
|
inlinestatic |
This fuction servers to revert the PWMx.
[in] | pwm_id | - variable of enum to select the pwm number. |
|
inlinestatic |
This fuction servers to revert the PWMx_N.
[in] | pwm_id | - variable of enum to select the pwm number. |
|
inlinestatic |
This fuction servers to enable the pwm polarity.
[in] | pwm_id | - variable of enum to select the pwm number. |
[in] | en | 1 enable. 0 disable. |
|
inlinestatic |
This fuction servers to enable the pwm interrupt.
[in] | irq | - variable of enum to select the pwm interrupt source. |
|
inlinestatic |
|
inlinestatic |
This fuction servers to clear the pwm interrupt.
[in] | irq | - variable of enum to select the pwm interrupt source. |
|
inlinestatic |
This fuction serves to set trigger level of interrupt for IR FiFo mode.
[in] | trig_level | - FIFO num int trigger level |
|
inlinestatic |
This fuction serves to clear data in fifo. Only when pwm is in not active mode, it is possible to clear data in fifo.
[in] | none |
|
inlinestatic |
This fuction serves to get the number of data in fifo.
[in] | none |
|
inlinestatic |
This fuction serves to determine whether data in fifo is empty.
[in] | none |
|
inlinestatic |
This fuction serves to determine whether data in fifo is full.
[in] | none |
|
inlinestatic |
This fuction serves to write data into FiFo.
[in] | pulse_num | - the number of pulse |
[in] | use_shadow | - determine whether the configuration of shadow cmp and shadow max is used 1: use shadow, 0: not use |
[in] | carrier_en | - enable sending carrier, 1: enable, 0: disable |
|
inlinestatic |
This fuction serves to config the pwm's dma wave form.
[in] | carrier_en | - must 1 or 0. |
[in] | pulse_type | - type of pwm0's pulse. |
[in] | pulse_num | - the number of pulse. |
|
inlinestatic |
This fuction servers to set the pwm's dma address.
[in] | pdat | - variable of pointer to indicate the address. |
|
inlinestatic |
This fuction servers to start the pwm's IRQ sending.
[in] | none. |
|
inlinestatic |
This fuction servers to stop the pwm's IRQ sending.
[in] | none. |