PWM

This module controls the PWM peripherals on a microcontroller. More information about accessing peripheral IO is in the Device Interface section.

Details

define PWM_VERSION

define PWM_IOC_IDENT_CHAR

define I_PWM_GETVERSION

define I_PWM_GETINFO

define I_PWM_SETATTR

define I_PWM_SETACTION

define I_PWM_SETCHANNEL

This IOCTL request sets the channel. The ctl argument is the channel to use. For example,

mcu_channel_t value;
value.channel = 0;
value.value = 100;
ioctl(pwm_fd, I_PWM_SET, &value); //write 100 to channel 0

define I_PWM_GETCHANNEL

define I_PWM_SET

define I_PWM_GET

define I_PWM_ENABLE

define I_PWM_DISABLE

define I_PWM_TOTAL

enum pwm_flag_t
  • PWM_FLAG_SET_TIMER Set to configure the frequency and period (implies PWM_FLAG_SET_CHANNEL)
  • PWM_FLAG_IS_ACTIVE_HIGH Set to configure the outputs as active high
  • PWM_FLAG_IS_ACTIVE_LOW Set to configure the outputs as active low
  • PWM_FLAG_SET_CHANNELS Set to just configure channels and leave the timer alone
  • PWM_FLAG_CLEAR_CHANNELS Set to clear all channels; may be with with PWM_FLAG_SET_CHANNELS or PMW_FLAG_SET_TIMER
  • PWM_FLAG_IS_ENABLED Set with PMW_FLAG_SET_TIMER to enable the timer

struct::pwm_info_t

u32 o_flags

Bitmask to show which flags are supported through the driver

u32 o_events

Bitmask of supported events

u32 resd

struct::pwm_pin_assignment_t

mcu_pin_t channel

struct::pwm_attr_t

PWM Attributes

u32 o_flags

Or’d flags such as PWM_FLAG_SET_TIMER

pwm_pin_assignment_t pin_assignment

u32 freq

The PWM counter frequency

u32 period

The PWM period in counts

mcu_channel_t channel

Channel when using PWM_FLAG_SET_CHANNELS

u32 resd

X

Thanks for Coming!

Subscribe to news and updates