PWM: Add support for multiple output channels per timer

This commit is contained in:
Paul A. Patience
2015-11-01 17:15:12 -05:00
parent 00af71dd78
commit e8c2466c1c
3 changed files with 104 additions and 47 deletions
+20 -7
View File
@@ -122,17 +122,30 @@
/****************************************************************************
* Public Types
****************************************************************************/
#ifdef CONFIG_PWM_MULTICHAN
struct pwm_chan_s
{
ub16_t duty;
uint8_t channel;
};
#endif
/* This structure describes the characteristics of the pulsed output */
struct pwm_info_s
{
uint32_t frequency; /* Frequency of the pulse train */
ub16_t duty; /* Duty of the pulse train, "1"-to-"0" duration.
* Maximum: 65535/65536 (0x0000ffff)
* Minimum: 1/65536 (0x00000001) */
#ifdef CONFIG_PWM_PULSECOUNT
uint32_t count; /* The number of pulse to generate. 0 means to
* generate an indefinite number of pulses */
uint32_t frequency; /* Frequency of the pulse train */
#ifdef CONFIG_PWM_MULTICHAN
struct pwm_chan_s channels[CONFIG_PWM_NCHANNELS];
#else
ub16_t duty; /* Duty of the pulse train, "1"-to-"0" duration.
* Maximum: 65535/65536 (0x0000ffff)
* Minimum: 1/65536 (0x00000001) */
# ifdef CONFIG_PWM_PULSECOUNT
uint32_t count; /* The number of pulse to generate. 0 means to
* generate an indefinite number of pulses */
# endif
#endif
};