Go to the documentation of this file.
40 #define MAX_PWM_TMR_MAX_VAL NO_OS_GENMASK(15, 0)
41 #define MAX_PWM_PRESCALER_VAL(n) ((n - 1) * 16)
42 #define MAX_PWM_PRESCALER_TRUE(n) NO_OS_BIT((n) / 16)
43 #define MAX_PWM_GET_PRESCALER(n) NO_OS_BIT((n) - 1)
59 #endif // MAXIM_PWM_H_
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:101
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
#define MAX_PWM_PRESCALER_TRUE(n)
Definition: maxim_pwm.h:42
uint32_t id
Definition: no_os_pwm.h:97
int max_pwm_set_period(struct no_os_pwm_desc *desc, uint32_t period_ns)
Set the PWM period.
Definition: maxim_pwm.c:131
uint32_t period_ns
Definition: no_os_pwm.h:70
#define NO_OS_DIV_ROUND_CLOSEST_ULL(x, y)
Definition: no_os_util.h:56
uint32_t id
Definition: no_os_pwm.h:68
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:54
#define MAX_PWM_TMR_MAX_VAL
Definition: maxim_pwm.h:40
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:226
uint32_t period_ns
Definition: no_os_pwm.h:99
Maxim platform specific implementation PWM API.
const struct no_os_pwm_platform_ops max_pwm_ops
Maxim specific PWM ops.
Definition: maxim_pwm.c:309
int max_pwm_disable(struct no_os_pwm_desc *desc)
Disable the PWM.
Definition: maxim_pwm.c:80
Maxim platform specific implementation PWM API.
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:76
#define MAX_PWM_GET_PRESCALER(n)
Definition: maxim_pwm.h:43
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:105
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:189
const struct no_os_pwm_platform_ops max_pwm_ops
Maxim platform specific callbacks for the PWM API.
Definition: maxim_pwm.c:309
void * extra
Definition: no_os_pwm.h:86
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:72
Header file of PWM Interface.
void * extra
Definition: no_os_pwm.h:117
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:69
mxc_gpio_vssel_t vssel
Definition: maxim_pwm.h:46
Definition: maxim_pwm.h:45
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:240
int max_pwm_enable(struct no_os_pwm_desc *desc)
Enable the PWM.
Definition: maxim_pwm.c:68
#define NANO
Definition: no_os_units.h:50
int max_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by max_pwm_init().
Definition: maxim_pwm.c:294
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:41
int max_pwm_get_period(struct no_os_pwm_desc *desc, uint32_t *period_ns)
Get the PWM period.
Definition: maxim_pwm.c:175