Go to the documentation of this file.
46 #define MAX_PWM_TMR_MAX_VAL NO_OS_GENMASK(15, 0)
47 #define MAX_PWM_PRESCALER_VAL(n) ((n - 1) * 16)
48 #define MAX_PWM_PRESCALER_TRUE(n) NO_OS_BIT((n) / 16)
49 #define MAX_PWM_GET_PRESCALER(n) NO_OS_BIT((n) - 1)
65 #endif // MAXIM_PWM_H_
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:107
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:72
#define MAX_PWM_PRESCALER_TRUE(n)
Definition: maxim_pwm.h:48
uint32_t id
Definition: no_os_pwm.h:103
int max_pwm_set_period(struct no_os_pwm_desc *desc, uint32_t period_ns)
Set the PWM period.
Definition: maxim_pwm.c:137
uint32_t period_ns
Definition: no_os_pwm.h:76
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:60
uint32_t id
Definition: no_os_pwm.h:74
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:60
#define MAX_PWM_TMR_MAX_VAL
Definition: maxim_pwm.h:46
int max_pwm_get_duty_cycle(struct no_os_pwm_desc *desc, uint32_t *duty_cycle_ns)
Get the PWM duty cycle.
Definition: maxim_pwm.c:228
uint32_t period_ns
Definition: no_os_pwm.h:105
Maxim platform specific implementation PWM API.
const struct no_os_pwm_platform_ops max_pwm_ops
Maxim specific PWM ops.
Definition: maxim_pwm.c:311
int max_pwm_disable(struct no_os_pwm_desc *desc)
Disable the PWM.
Definition: maxim_pwm.c:86
Maxim platform specific implementation PWM API.
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:82
#define MAX_PWM_GET_PRESCALER(n)
Definition: maxim_pwm.h:49
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:111
Maxim platform specific implementation PWM API.
Maxim platform specific implementation PWM API.
int max_pwm_set_duty_cycle(struct no_os_pwm_desc *desc, uint32_t duty_cycle_ns)
Set the PWM duty cycle.
Definition: maxim_pwm.c:195
const struct no_os_pwm_platform_ops max_pwm_ops
Maxim platform specific callbacks for the PWM API.
Definition: maxim_pwm.c:311
void * extra
Definition: no_os_pwm.h:92
Structure representing an PWM generator device.
Definition: no_os_pwm.h:99
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:78
Header file of PWM Interface.
void * extra
Definition: no_os_pwm.h:123
Maxim platform specific implementation PWM API.
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:75
mxc_gpio_vssel_t vssel
Definition: maxim_pwm.h:52
Definition: maxim_pwm.h:51
int max_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM.
Definition: maxim_pwm.c:242
int max_pwm_enable(struct no_os_pwm_desc *desc)
Enable the PWM.
Definition: maxim_pwm.c:74
#define NANO
Definition: no_os_units.h:56
int max_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by max_pwm_init().
Definition: maxim_pwm.c:296
Header file of utility functions.
Maxim platform specific implementation PWM API.
Maxim platform specific implementation PWM API.
#define MAX_PWM_PRESCALER_VAL(n)
Definition: maxim_pwm.h:47
int max_pwm_get_period(struct no_os_pwm_desc *desc, uint32_t *period_ns)
Get the PWM period.
Definition: maxim_pwm.c:181