|
Zephyr API Documentation 4.4.0-rc1
A Scalable Open Source RTOS
|
Files | |
| file | max2221x.h |
| Public API for MAX2221X PWM driver. | |
Enumerations | |
| enum | max2221x_master_chop_freq { MAX2221X_FREQ_100KHZ = 0 , MAX2221X_FREQ_80KHZ , MAX2221X_FREQ_60KHZ , MAX2221X_FREQ_50KHZ , MAX2221X_FREQ_40KHZ , MAX2221X_FREQ_30KHZ , MAX2221X_FREQ_25KHZ , MAX2221X_FREQ_20KHZ , MAX2221X_FREQ_15KHZ , MAX2221X_FREQ_10KHZ , MAX2221X_FREQ_7500HZ , MAX2221X_FREQ_5000HZ , MAX2221X_FREQ_2500HZ , MAX2221X_FREQ_INVALID } |
| Master chopping frequency options. More... | |
| enum | max2221x_individual_chop_freq { MAX2221X_FREQ_M = 0 , MAX2221X_FREQ_M_2 , MAX2221X_FREQ_M_4 , MAX2221X_FREQ_M_8 , MAX2221X_FREQ_M_INVALID } |
| Individual channel chopping frequency divisor options. More... | |
Functions | |
| int | max2221x_get_master_chop_freq (const struct device *dev) |
| Get the master chop frequency of the MAX2221X device. | |
| int | max2221x_get_channel_freq (const struct device *dev, uint32_t channel, uint32_t *channel_freq) |
| Get the individual channel frequency of the MAX2221X device. | |
| int | max2221x_calculate_duty_cycle (uint32_t pulse, uint32_t period, uint16_t *duty_cycle) |
| Calculate the duty cycle. | |
| int | max2221x_calculate_master_freq_divisor (uint32_t master_freq, uint32_t period, int *freq_divisor) |
| Calculate the master frequency divisor used for calculating individual frequency. | |
| int | max2221x_get_cycles_per_sec (const struct device *dev, uint32_t channel, uint64_t *cycles) |
| Get the cycles per second for the pwm channel. | |
| int | max2221x_set_cycles (const struct device *dev, uint32_t channel, uint32_t period, uint32_t pulse, pwm_flags_t flags) |
| Set the duty cycle for the pwm channel. | |
#include <zephyr/drivers/pwm/max2221x.h>
Individual channel chopping frequency divisor options.
#include <zephyr/drivers/pwm/max2221x.h>
Master chopping frequency options.
#include <zephyr/drivers/pwm/max2221x.h>
Calculate the duty cycle.
| pulse | Pulse width (in microseconds) set to the PWM. HW specific. |
| period | Period (in microseconds) set to the PWM. HW specific. |
| duty_cycle | Pointer to the variable to store the duty cycle. |
| int max2221x_calculate_master_freq_divisor | ( | uint32_t | master_freq, |
| uint32_t | period, | ||
| int * | freq_divisor ) |
#include <zephyr/drivers/pwm/max2221x.h>
Calculate the master frequency divisor used for calculating individual frequency.
| master_freq | Master frequency (in Hz) set to the PWM. HW specific. |
| period | Period (in microseconds) set to the PWM. HW specific. |
| freq_divisor | Master frequency divisor set per channel. |
| int max2221x_get_channel_freq | ( | const struct device * | dev, |
| uint32_t | channel, | ||
| uint32_t * | channel_freq ) |
#include <zephyr/drivers/pwm/max2221x.h>
Get the individual channel frequency of the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to read. |
| channel_freq | Pointer to the variable to store the individual channel frequency. |
#include <zephyr/drivers/pwm/max2221x.h>
Get the cycles per second for the pwm channel.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to get the cycles. |
| cycles | Pointer to the variable to store the cycles. |
| int max2221x_get_master_chop_freq | ( | const struct device * | dev | ) |
#include <zephyr/drivers/pwm/max2221x.h>
Get the master chop frequency of the MAX2221X device.
| dev | Pointer to the device structure for the driver instance. |
| int max2221x_set_cycles | ( | const struct device * | dev, |
| uint32_t | channel, | ||
| uint32_t | period, | ||
| uint32_t | pulse, | ||
| pwm_flags_t | flags ) |
#include <zephyr/drivers/pwm/max2221x.h>
Set the duty cycle for the pwm channel.
| dev | Pointer to the device structure for the driver instance. |
| channel | The channel to set the cycles. |
| period | Period (in microseconds) set to the PWM. HW specific. |
| pulse | Pulse width (in microseconds) set to the PWM. HW specific. |
| flags | Flags for pin configuration. |