Maxim platform specific implementation PWM API.
More...
#include "tmr.h"
#include "no_os_alloc.h"
#include "no_os_error.h"
#include "no_os_util.h"
#include "no_os_units.h"
#include "maxim_pwm.h"
Maxim platform specific implementation PWM API.
- Author
- Dragos Bogdan (drago.nosp@m.s.bo.nosp@m.gdan@.nosp@m.anal.nosp@m.og.co.nosp@m.m)
Copyright 2024(c) Analog Devices, Inc.
SPDX-License-Identifier: BSD-3-Clause
◆ max_pwm_disable()
Disable the PWM.
- Parameters
-
- Returns
- 0 in case of success, negative error otherwise.
◆ max_pwm_enable()
Enable the PWM.
- Parameters
-
- Returns
- 0 in case of success, negative error code otherwise.
◆ max_pwm_get_duty_cycle()
| int32_t max_pwm_get_duty_cycle |
( |
struct no_os_pwm_desc * | desc, |
|
|
uint32_t * | duty_cycle_ns ) |
Get the PWM duty cycle.
- Parameters
-
| desc | - Pointer where the configured instance is stored. |
| duty_cycle_ns | - PWM duty cycle. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max_pwm_get_period()
| int32_t max_pwm_get_period |
( |
struct no_os_pwm_desc * | desc, |
|
|
uint32_t * | period_ns ) |
Get the PWM period.
- Parameters
-
| desc | - Pointer where the configured instance is stored. |
| period_ns | - PWM period. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max_pwm_init()
Initialize the PWM.
- Parameters
-
| desc | - PWM descriptor. |
| param | - The structure containing PWM init parameters. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max_pwm_remove()
Free the resources allocated by max_pwm_init().
- Parameters
-
- Returns
- 0 in case of success, negative error code otherwise.
◆ max_pwm_set_duty_cycle()
| int32_t max_pwm_set_duty_cycle |
( |
struct no_os_pwm_desc * | desc, |
|
|
uint32_t | duty_cycle_ns ) |
Set the PWM duty cycle.
- Parameters
-
| desc | - Pointer where the configured instance is stored. |
| duty_cycle_ns | - PWM duty cycle. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max_pwm_set_period()
| int32_t max_pwm_set_period |
( |
struct no_os_pwm_desc * | desc, |
|
|
uint32_t | period_ns ) |
Set the PWM period.
- Parameters
-
| desc | - Pointer where the configured instance is stored. |
| period_ns | - PWM period. |
- Returns
- 0 in case of success, negative error code otherwise.
◆ max_pwm_ops
Initial value:= {
}
int32_t max_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM.
Definition maxim_pwm.c:217
int32_t max_pwm_disable(struct no_os_pwm_desc *desc)
Disable the PWM.
Definition maxim_pwm.c:57
int32_t max_pwm_set_period(struct no_os_pwm_desc *desc, uint32_t period_ns)
Set the PWM period.
Definition maxim_pwm.c:108
int32_t max_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by max_pwm_init().
Definition maxim_pwm.c:271
int32_t max_pwm_enable(struct no_os_pwm_desc *desc)
Enable the PWM.
Definition maxim_pwm.c:45
int32_t max_pwm_get_period(struct no_os_pwm_desc *desc, uint32_t *period_ns)
Get the PWM period.
Definition maxim_pwm.c:152
int32_t 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:203
int32_t 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:166
Maxim platform specific callbacks for the PWM API.
Maxim specific PWM ops.