Pulse Width Modulation (PWM) Software Driver for modules above revision >v4.0.0.
This driver provides an API to get access to the main features of the PWM controller.
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the PWM - Pulse Width Modulation (>v4.0.0). | |
Data Structures | |
struct | pwm_compare_opt_t |
struct | pwm_opt_t |
Input parameters when initializing a PWM channel. More... | |
struct | pwm_output_override_opt_t |
Macros | |
#define | AVR32_PWM_LINES_MSB 4 |
Local Definition for the number of PWM Lines. More... | |
#define | PWM_CKSEL_GCLK 1 |
PWM Clock Input is Generic Clock. More... | |
#define | PWM_CKSEL_MCK 0 |
PWM Clock Input is Master Clock. More... | |
#define | PWM_COMPARE_MODE_DOWN 1 |
PWM Compare DOWN. More... | |
#define | PWM_COMPARE_MODE_UP 0 |
PWM Compare UP. More... | |
#define | PWM_COMPARE_OFF 0 |
PWM Compare OFF. More... | |
#define | PWM_COMPARE_ON 1 |
PWM Compare ON. More... | |
#define | PWM_EVENT_LINE0 (1<<AVR32_PWM_EL0MR_CSEL0_OFFSET) |
#define | PWM_EVENT_LINE1 (1<<AVR32_PWM_EL0MR_CSEL1_OFFSET) |
#define | PWM_EVENT_LINE2 (1<<AVR32_PWM_EL0MR_CSEL2_OFFSET) |
#define | PWM_EVENT_LINE3 (1<<AVR32_PWM_EL0MR_CSEL3_OFFSET) |
#define | PWM_EVENT_LINE4 (1<<AVR32_PWM_EL0MR_CSEL4_OFFSET) |
#define | PWM_EVENT_LINE5 (1<<AVR32_PWM_EL0MR_CSEL5_OFFSET) |
#define | PWM_EVENT_LINE6 (1<<AVR32_PWM_EL0MR_CSEL6_OFFSET) |
#define | PWM_EVENT_LINE7 (1<<AVR32_PWM_EL0MR_CSEL7_OFFSET) |
#define | PWM_FAILURE -1 |
Value returned by function when it was unable to complete successfully for some unspecified reason. More... | |
#define | PWM_FAULT_INPUT_ACTIVE_HIGH 1 |
PWM Fault Input Active High State. More... | |
#define | PWM_FAULT_INPUT_ACTIVE_LOW 0 |
PWM Fault Input Active Low State. More... | |
#define | PWM_FAULT_INPUT_FILTER_OFF 0 |
PWM Fault Input Filtering Option OFF. More... | |
#define | PWM_FAULT_INPUT_FILTER_ON 1 |
PWM Fault Input Filtering Option ON. More... | |
#define | PWM_FAULT_INPUT_NOT_USED 0 |
PWM Fault Input Not Used. More... | |
#define | PWM_FAULT_INPUT_USED 1 |
PWM Fault Input Used. More... | |
#define | PWM_FAULT_LINES 8 |
PWM Number of Fault Lines. More... | |
#define | PWM_FAULT_MODE_LEVEL 0 |
PWM Fault Mode Level. More... | |
#define | PWM_FAULT_MODE_TGL 1 |
PWM Fault Mode Toggle. More... | |
#define | PWM_FAULT_OUTPUT 4 |
PWM Fault Output Lines: PWM0,1,2,3 => 4. More... | |
#define | PWM_INVALID_ARGUMENT 1 |
Value returned by function when the channel number is invalid. More... | |
#define | PWM_INVALID_INPUT 1 |
Value returned by function when the input parameters are out of range. More... | |
#define | PWM_MODE_CENTER_ALIGNED 1 |
Operate PWM channel in center aligned mode. More... | |
#define | PWM_MODE_LEFT_ALIGNED 0 |
Operate PWM channel in left aligned mode. More... | |
#define | PWM_NO_WRITE_PROTECT_VIOLATION 0xFFFFFFFF |
PWM No Write To Protected Register Status. More... | |
#define | PWM_OOV_CTRL_OFF 0 |
PWM Output Override Control OFF. More... | |
#define | PWM_OOV_CTRL_ON 1 |
PWM Output Override Control ON. More... | |
#define | PWM_OOV_LINES 4 |
PWM Ouptut Override Number of Lines: PWM0,1,2,3 => 4. More... | |
#define | PWM_OOV_VALUE_HIGH 1 |
PWM Output Override Value High Level. More... | |
#define | PWM_OOV_VALUE_LOW 0 |
PWM Output Override Value Low Level. More... | |
#define | PWM_OUTPUT_HIGH_WHEN_FAULT_DETECTION 1 |
PWM Output High Level when fault detection. More... | |
#define | PWM_OUTPUT_LOW_WHEN_FAULT_DETECTION 0 |
PWM Output Low Level when fault detection. More... | |
#define | PWM_POLARITY_HIGH 1 |
PWM channel starts output high level. More... | |
#define | PWM_POLARITY_LOW 0 |
PWM channel starts output low level. More... | |
#define | PWM_SUCCESS 0 |
Value returned by function when it completed successfully. More... | |
#define | PWM_SYNC_CHANNEL_OFF 1 |
PWM Sync channel OFF. More... | |
#define | PWM_SYNC_CHANNEL_ON 1 |
PWM Sync channel ON. More... | |
#define | PWM_SYNC_UPDATE_AUTO_WRITE_AUTO_UPDATE 2 |
PWM Automatic Write And Automatic Update Period, Duty Cycle and Event Method. More... | |
#define | PWM_SYNC_UPDATE_MANUAL_WRITE_AUTO_UPDATE 1 |
PWM Manual Write And Automatic Update Period, Duty Cycle and Event Method. More... | |
#define | PWM_SYNC_UPDATE_MANUAL_WRITE_MANUAL_UPDATE 0 |
PWM Manual Write And Manual Update Period, Duty Cycle and Event Method. More... | |
#define | PWM_UPDATE_DUTY 0 |
PWM channel write in CUPDx updates duty cycle at the next period start event. More... | |
#define | PWM_UPDATE_PERIOD 1 |
PWM channel write in CUPDx updates period at the next period start event. More... | |
#define | PWM_UPDLOCK_TRIGGER 1 |
PWM Update Lock State. More... | |
#define | PWM_WPKEY 0x50574D |
PWM Protection Key. More... | |
Functions | |
int | pwm_channel_init (unsigned int channel_id, const avr32_pwm_channel_t *pwm_channel) |
Initialize a specific PWM channel. More... | |
void | pwm_clr_fault_status (void) |
Return Fault Status. More... | |
int | pwm_compare_disable (int line) |
Compare Match Disable. More... | |
int | pwm_compare_enable (int line) |
Compare Match Enable. More... | |
int | pwm_compare_event_disable (int line, int event_line) |
Compare Event Disable. More... | |
int | pwm_compare_event_enable (int line, int event_line) |
Compare Event Enable. More... | |
int | pwm_compare_match_reload_setup (int line, pwm_compare_opt_t *pwm_compare_t) |
Compare Match Reload Setup. More... | |
int | pwm_compare_match_setup (int line, pwm_compare_opt_t *pwm_compare_t) |
Compare Match Setup. More... | |
int | pwm_compare_reload_update_period_value (int line, pwm_compare_opt_t *pwm_compare_t) |
Compare Reload Update Period. More... | |
int | pwm_compare_update_period_value (int line, pwm_compare_opt_t *pwm_compare_t) |
Fault Lines Enable function. More... | |
int | pwm_fault_lines_enable (U8 line, U8 channel) |
Fault Lines Enable function. More... | |
int | pwm_fault_lines_level_setup (U8 line, U8 channel_high, U8 channel_low) |
Fault Lines Level Setup Function. More... | |
int | pwm_fault_lines_polarity_setup (U8 line, U8 polarity, U8 mode, U8 filter) |
Fault Lines Level Polarity Function. More... | |
int | pwm_get_fault_status (void) |
Get Fault Status. More... | |
unsigned int | pwm_get_update_period_counter_value (void) |
Return Current Counter of Update Period Value. More... | |
int | pwm_init (pwm_opt_t *opt) |
This function initialize the PWM controller (mode register) and disable the interrupt. More... | |
int | pwm_interrupt_update_channel (unsigned int channel_id, const avr32_pwm_channel_t *pwm_channel) |
Update channel register CPRDx or CDTYx with the interrupt method. This function uses the CUPDx register as a double buffer for the period or the duty cycle. Only the first 20 bits of cupd are significant. More... | |
int | pwm_output_override_setup (pwm_output_override_opt_t *opt) |
Output Override Configuration. This function uses the OS and OOV registers. More... | |
int | pwm_output_override_write (pwm_output_override_opt_t *opt) |
Output Override Set. This function uses the OS and OOV registers. More... | |
int | pwm_start_channels (unsigned long channels_bitmask) |
Start PWM channels. More... | |
int | pwm_stop_channels (unsigned long channels_bitmask) |
Stop PWM channels. More... | |
int | pwm_synchronous_prepare_update (unsigned int channel_id, const avr32_pwm_channel_t *pwm_channel) |
Prepare a Synchronous Channel, User should call this function for all the synchronous channel. More... | |
int | pwm_update_auto_write_auto_update_check_eot (void) |
Synchronous Update with Manual Write and Auto Update Method. More... | |
int | pwm_update_auto_write_auto_update_check_ready (void) |
Synchronous Update with Manual Write and Auto Update Method. More... | |
int | pwm_update_channel (unsigned int channel_id, const avr32_pwm_channel_t *pwm_channel) |
Update channel register CPRDx or CDTYx with the polling method. This function uses the CUPDx register as a double buffer for the period or the duty cycle. Only the first 20 bits of cupd are significant. More... | |
int | pwm_update_manual_write_auto_update (void) |
Synchronous Update with Manual Write and Auto Update Method. More... | |
int | pwm_update_manual_write_manual_update (void) |
Synchronous Update with Manual Write and Manual Update Method. More... | |
int | pwm_update_period_value (unsigned int value) |
Define Update Period Value For Update Of Synchronous Channel. More... | |
int | pwm_update_period_value_update (unsigned int value) |
Define Update Period Value For Update Of Synchronous Channel after a first init. More... | |
int | pwm_write_protect_hw_lock (int group) |
Hardware Write Protect Lock Function. This function uses the WPMR register. More... | |
U32 | pwm_write_protect_status (void) |
Write Protect Status Function. This function uses the WPSR register. More... | |
int | pwm_write_protect_sw_lock (int group) |
Software Write Protect Lock Function. This function uses the WPMR register. More... | |
int | pwm_write_protect_sw_unlock (int group) |
Software Write Protect Unlock Function. This function uses the WPMR register. More... | |
#define AVR32_PWM_LINES_MSB 4 |
Local Definition for the number of PWM Lines.
Referenced by pwm_channel_init(), pwm_init(), pwm_interrupt_update_channel(), pwm_start_channels(), pwm_stop_channels(), pwm_synchronous_prepare_update(), and pwm_update_channel().
#define PWM_CKSEL_GCLK 1 |
PWM Clock Input is Generic Clock.
Referenced by main().
#define PWM_CKSEL_MCK 0 |
PWM Clock Input is Master Clock.
#define PWM_COMPARE_MODE_DOWN 1 |
PWM Compare DOWN.
#define PWM_COMPARE_MODE_UP 0 |
PWM Compare UP.
#define PWM_COMPARE_OFF 0 |
PWM Compare OFF.
#define PWM_COMPARE_ON 1 |
PWM Compare ON.
#define PWM_EVENT_LINE0 (1<<AVR32_PWM_EL0MR_CSEL0_OFFSET) |
#define PWM_EVENT_LINE1 (1<<AVR32_PWM_EL0MR_CSEL1_OFFSET) |
#define PWM_EVENT_LINE2 (1<<AVR32_PWM_EL0MR_CSEL2_OFFSET) |
#define PWM_EVENT_LINE3 (1<<AVR32_PWM_EL0MR_CSEL3_OFFSET) |
#define PWM_EVENT_LINE4 (1<<AVR32_PWM_EL0MR_CSEL4_OFFSET) |
#define PWM_EVENT_LINE5 (1<<AVR32_PWM_EL0MR_CSEL5_OFFSET) |
#define PWM_EVENT_LINE6 (1<<AVR32_PWM_EL0MR_CSEL6_OFFSET) |
#define PWM_EVENT_LINE7 (1<<AVR32_PWM_EL0MR_CSEL7_OFFSET) |
#define PWM_FAILURE -1 |
Value returned by function when it was unable to complete successfully for some unspecified reason.
Referenced by pwm_write_protect_hw_lock(), pwm_write_protect_sw_lock(), and pwm_write_protect_sw_unlock().
#define PWM_FAULT_INPUT_ACTIVE_HIGH 1 |
PWM Fault Input Active High State.
#define PWM_FAULT_INPUT_ACTIVE_LOW 0 |
PWM Fault Input Active Low State.
#define PWM_FAULT_INPUT_FILTER_OFF 0 |
PWM Fault Input Filtering Option OFF.
#define PWM_FAULT_INPUT_FILTER_ON 1 |
PWM Fault Input Filtering Option ON.
#define PWM_FAULT_INPUT_NOT_USED 0 |
PWM Fault Input Not Used.
#define PWM_FAULT_INPUT_USED 1 |
PWM Fault Input Used.
#define PWM_FAULT_LINES 8 |
PWM Number of Fault Lines.
#define PWM_FAULT_MODE_LEVEL 0 |
PWM Fault Mode Level.
#define PWM_FAULT_MODE_TGL 1 |
PWM Fault Mode Toggle.
#define PWM_FAULT_OUTPUT 4 |
PWM Fault Output Lines: PWM0,1,2,3 => 4.
#define PWM_INVALID_ARGUMENT 1 |
Value returned by function when the channel number is invalid.
Referenced by pwm_channel_init().
#define PWM_INVALID_INPUT 1 |
Value returned by function when the input parameters are out of range.
Referenced by pwm_channel_init(), pwm_compare_event_disable(), pwm_compare_event_enable(), pwm_compare_match_reload_setup(), pwm_compare_match_setup(), pwm_fault_lines_enable(), pwm_fault_lines_level_setup(), pwm_fault_lines_polarity_setup(), pwm_init(), pwm_interrupt_update_channel(), pwm_output_override_setup(), pwm_output_override_write(), pwm_start_channels(), pwm_stop_channels(), pwm_synchronous_prepare_update(), and pwm_update_channel().
#define PWM_MODE_CENTER_ALIGNED 1 |
Operate PWM channel in center aligned mode.
#define PWM_MODE_LEFT_ALIGNED 0 |
Operate PWM channel in left aligned mode.
Referenced by main(), and tft_bl_init().
#define PWM_NO_WRITE_PROTECT_VIOLATION 0xFFFFFFFF |
PWM No Write To Protected Register Status.
Referenced by pwm_write_protect_status().
#define PWM_OOV_CTRL_OFF 0 |
PWM Output Override Control OFF.
#define PWM_OOV_CTRL_ON 1 |
PWM Output Override Control ON.
#define PWM_OOV_LINES 4 |
PWM Ouptut Override Number of Lines: PWM0,1,2,3 => 4.
Referenced by pwm_init(), pwm_output_override_setup(), and pwm_output_override_write().
#define PWM_OOV_VALUE_HIGH 1 |
PWM Output Override Value High Level.
#define PWM_OOV_VALUE_LOW 0 |
PWM Output Override Value Low Level.
#define PWM_OUTPUT_HIGH_WHEN_FAULT_DETECTION 1 |
PWM Output High Level when fault detection.
#define PWM_OUTPUT_LOW_WHEN_FAULT_DETECTION 0 |
PWM Output Low Level when fault detection.
#define PWM_POLARITY_HIGH 1 |
PWM channel starts output high level.
Referenced by tft_bl_init().
#define PWM_POLARITY_LOW 0 |
PWM channel starts output low level.
Referenced by main().
#define PWM_SUCCESS 0 |
Value returned by function when it completed successfully.
Referenced by pwm_channel_init(), pwm_compare_event_disable(), pwm_compare_event_enable(), pwm_compare_match_reload_setup(), pwm_compare_match_setup(), pwm_fault_lines_enable(), pwm_fault_lines_level_setup(), pwm_fault_lines_polarity_setup(), pwm_init(), pwm_interrupt_update_channel(), pwm_output_override_setup(), pwm_output_override_write(), pwm_start_channels(), pwm_stop_channels(), pwm_synchronous_prepare_update(), pwm_update_auto_write_auto_update_check_eot(), pwm_update_auto_write_auto_update_check_ready(), pwm_update_channel(), pwm_update_manual_write_auto_update(), pwm_update_manual_write_manual_update(), pwm_update_period_value(), pwm_write_protect_hw_lock(), pwm_write_protect_sw_lock(), and pwm_write_protect_sw_unlock().
#define PWM_SYNC_CHANNEL_OFF 1 |
PWM Sync channel OFF.
#define PWM_SYNC_CHANNEL_ON 1 |
PWM Sync channel ON.
#define PWM_SYNC_UPDATE_AUTO_WRITE_AUTO_UPDATE 2 |
PWM Automatic Write And Automatic Update Period, Duty Cycle and Event Method.
Referenced by pwm_init().
#define PWM_SYNC_UPDATE_MANUAL_WRITE_AUTO_UPDATE 1 |
PWM Manual Write And Automatic Update Period, Duty Cycle and Event Method.
#define PWM_SYNC_UPDATE_MANUAL_WRITE_MANUAL_UPDATE 0 |
PWM Manual Write And Manual Update Period, Duty Cycle and Event Method.
Referenced by main().
#define PWM_UPDATE_DUTY 0 |
PWM channel write in CUPDx updates duty cycle at the next period start event.
Referenced by tft_bl_init().
#define PWM_UPDATE_PERIOD 1 |
PWM channel write in CUPDx updates period at the next period start event.
#define PWM_UPDLOCK_TRIGGER 1 |
PWM Update Lock State.
#define PWM_WPKEY 0x50574D |
PWM Protection Key.
int pwm_channel_init | ( | unsigned int | channel_id, |
const avr32_pwm_channel_t * | pwm_channel | ||
) |
Initialize a specific PWM channel.
channel_id | The channel identifier mask |
*pwm_channel | Pointer to PWM channel struct avr32_pwm_channel_t |
References AVR32_PWM_LINES_MSB, PWM_INVALID_ARGUMENT, PWM_INVALID_INPUT, and PWM_SUCCESS.
Referenced by main(), and tft_bl_init().
void pwm_clr_fault_status | ( | void | ) |
Return Fault Status.
int pwm_compare_disable | ( | int | line | ) |
Compare Match Disable.
line | Compare Line to be used |
int pwm_compare_enable | ( | int | line | ) |
Compare Match Enable.
line | Compare Line to be used |
int pwm_compare_event_disable | ( | int | line, |
int | event_line | ||
) |
Compare Event Disable.
line | Compare Line to be used |
event_line | Event Line to be used |
References PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_compare_event_enable | ( | int | line, |
int | event_line | ||
) |
Compare Event Enable.
line | Compare Line to be used |
event_line | Event Line to be used |
References PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_compare_match_reload_setup | ( | int | line, |
pwm_compare_opt_t * | pwm_compare_t | ||
) |
Compare Match Reload Setup.
line | Compare Line to be used |
pwm_compare_t | Parameter |
References pwm_compare_opt_t::compare_mode, pwm_compare_opt_t::compare_period_counter_value, pwm_compare_opt_t::compare_pwm_counter_value, pwm_compare_opt_t::compare_pwm_period_counter_value, pwm_compare_opt_t::compare_pwm_update_period, pwm_compare_opt_t::compare_status, PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_compare_match_setup | ( | int | line, |
pwm_compare_opt_t * | pwm_compare_t | ||
) |
Compare Match Setup.
line | Compare Line to be used |
pwm_compare_t | Parameter |
References pwm_compare_opt_t::compare_mode, pwm_compare_opt_t::compare_period_counter_value, pwm_compare_opt_t::compare_pwm_counter_value, pwm_compare_opt_t::compare_pwm_period_counter_value, pwm_compare_opt_t::compare_pwm_update_period, pwm_compare_opt_t::compare_status, PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_compare_reload_update_period_value | ( | int | line, |
pwm_compare_opt_t * | pwm_compare_t | ||
) |
Compare Reload Update Period.
line | Compare Line to be used |
pwm_compare_t | Parameter |
int pwm_compare_update_period_value | ( | int | line, |
pwm_compare_opt_t * | pwm_compare_t | ||
) |
Fault Lines Enable function.
line | Compare Line to be used |
pwm_compare_t | Parameter |
Fault Lines Enable function.
line | Line |
channel | Channel |
References PWM_INVALID_INPUT, and PWM_SUCCESS.
Fault Lines Level Setup Function.
line | Line |
channel_high | Channel High |
channel_low | Channel Low |
References PWM_INVALID_INPUT, and PWM_SUCCESS.
Fault Lines Level Polarity Function.
line | Line |
polarity | Polarity |
mode | Mode |
filter | Filter |
References PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_get_fault_status | ( | void | ) |
Get Fault Status.
unsigned int pwm_get_update_period_counter_value | ( | void | ) |
Return Current Counter of Update Period Value.
int pwm_init | ( | pwm_opt_t * | opt | ) |
This function initialize the PWM controller (mode register) and disable the interrupt.
opt | PWM Channel structure parameter |
References AVR32_PWM_LINES_MSB, pwm_opt_t::cksel, Disable_global_interrupt, pwm_opt_t::diva, pwm_opt_t::divb, Enable_global_interrupt, pwm_opt_t::fault_detection_activated, i, Is_global_interrupt_enabled, pwm_opt_t::prea, pwm_opt_t::preb, PWM_INVALID_INPUT, PWM_OOV_LINES, PWM_SUCCESS, PWM_SYNC_UPDATE_AUTO_WRITE_AUTO_UPDATE, pwm_write_protect_sw_unlock(), pwm_opt_t::sync_channel_activated, pwm_opt_t::sync_channel_select, and pwm_opt_t::sync_update_channel_mode.
Referenced by main(), and tft_bl_init().
int pwm_interrupt_update_channel | ( | unsigned int | channel_id, |
const avr32_pwm_channel_t * | pwm_channel | ||
) |
Update channel register CPRDx or CDTYx with the interrupt method. This function uses the CUPDx register as a double buffer for the period or the duty cycle. Only the first 20 bits of cupd are significant.
channel_id | The channel identifier (0 to max channel-1) |
*pwm_channel | Pointer to PWM channel struct avr32_pwm_channel_t |
References AVR32_PWM_LINES_MSB, PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_output_override_setup | ( | pwm_output_override_opt_t * | opt | ) |
Output Override Configuration. This function uses the OS and OOV registers.
opt | Output Override Parameter |
References i, pwm_output_override_opt_t::oov, PWM_INVALID_INPUT, PWM_OOV_LINES, and PWM_SUCCESS.
int pwm_output_override_write | ( | pwm_output_override_opt_t * | opt | ) |
Output Override Set. This function uses the OS and OOV registers.
opt | Output Override Parameter |
References i, pwm_output_override_opt_t::os, PWM_INVALID_INPUT, PWM_OOV_LINES, PWM_SUCCESS, and tmp.
int pwm_start_channels | ( | unsigned long | channels_bitmask | ) |
Start PWM channels.
channels_bitmask | A bit-mask with set bits indicating channels to start. |
References AVR32_PWM_LINES_MSB, PWM_INVALID_INPUT, and PWM_SUCCESS.
Referenced by main(), and tft_bl_init().
int pwm_stop_channels | ( | unsigned long | channels_bitmask | ) |
Stop PWM channels.
channels_bitmask | A bit-mask with set bits indicating channels to stop. |
References AVR32_PWM_LINES_MSB, PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_synchronous_prepare_update | ( | unsigned int | channel_id, |
const avr32_pwm_channel_t * | pwm_channel | ||
) |
Prepare a Synchronous Channel, User should call this function for all the synchronous channel.
References AVR32_PWM_LINES_MSB, PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_update_auto_write_auto_update_check_eot | ( | void | ) |
Synchronous Update with Manual Write and Auto Update Method.
References PWM_SUCCESS.
int pwm_update_auto_write_auto_update_check_ready | ( | void | ) |
Synchronous Update with Manual Write and Auto Update Method.
References PWM_SUCCESS.
int pwm_update_channel | ( | unsigned int | channel_id, |
const avr32_pwm_channel_t * | pwm_channel | ||
) |
Update channel register CPRDx or CDTYx with the polling method. This function uses the CUPDx register as a double buffer for the period or the duty cycle. Only the first 20 bits of cupd are significant.
channel_id | The channel identifier (0 to max channel-1) |
*pwm_channel | Pointer to PWM channel struct avr32_pwm_channel_t |
References AVR32_PWM_LINES_MSB, PWM_INVALID_INPUT, and PWM_SUCCESS.
int pwm_update_manual_write_auto_update | ( | void | ) |
Synchronous Update with Manual Write and Auto Update Method.
References PWM_SUCCESS.
int pwm_update_manual_write_manual_update | ( | void | ) |
Synchronous Update with Manual Write and Manual Update Method.
References PWM_SUCCESS.
int pwm_update_period_value | ( | unsigned int | value | ) |
Define Update Period Value For Update Of Synchronous Channel.
value | Update Period Value |
References PWM_SUCCESS.
Referenced by main().
int pwm_update_period_value_update | ( | unsigned int | value | ) |
Define Update Period Value For Update Of Synchronous Channel after a first init.
value | Update Period Value |
int pwm_write_protect_hw_lock | ( | int | group | ) |
Hardware Write Protect Lock Function. This function uses the WPMR register.
group |
References PWM_FAILURE, and PWM_SUCCESS.
U32 pwm_write_protect_status | ( | void | ) |
Write Protect Status Function. This function uses the WPSR register.
References PWM_NO_WRITE_PROTECT_VIOLATION, and status.
int pwm_write_protect_sw_lock | ( | int | group | ) |
Software Write Protect Lock Function. This function uses the WPMR register.
group |
References PWM_FAILURE, and PWM_SUCCESS.
int pwm_write_protect_sw_unlock | ( | int | group | ) |
Software Write Protect Unlock Function. This function uses the WPMR register.
group |
References PWM_FAILURE, and PWM_SUCCESS.
Referenced by pwm_init().