int32_t stm32_pwm_enable(struct no_os_pwm_desc *desc)
Enable the PWM.
Definition: stm32_pwm.c:447
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
bool timer_autoreload
Definition: stm32_pwm.h:75
enum TimOCMode mode
Definition: stm32_pwm.h:77
int32_t stm32_pwm_set_duty_cycle(struct no_os_pwm_desc *desc, uint32_t duty_cycle_ns)
Set the PWM duty cycle.
Definition: stm32_pwm.c:577
Structure describing a callback to be registered.
Definition: no_os_irq.h:148
int32_t stm32_pwm_get_period(struct no_os_pwm_desc *desc, uint32_t *period_ns)
Get the PWM period.
Definition: stm32_pwm.c:553
Header file of IRQ interface.
int32_t no_os_irq_register_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Register a callback to handle the irq events.
Definition: no_os_irq.c:98
#define PWM_DEFAULT_PERIOD
Definition: stm32_pwm.c:52
uint32_t id
Definition: no_os_pwm.h:103
int32_t stm32_pwm_disable(struct no_os_pwm_desc *desc)
Disable the PWM.
Definition: stm32_pwm.c:483
uint32_t period_ns
Definition: no_os_pwm.h:76
@ NO_OS_EVT_TIM_PWM_PULSE_FINISHED
Definition: no_os_irq.h:75
struct no_os_callback_desc timer_callback
Definition: stm32_pwm.h:116
uint32_t clock_divider
Definition: stm32_pwm.h:112
uint32_t phase_ns
Definition: no_os_pwm.h:109
uint32_t clock_divider
Definition: stm32_pwm.h:85
@ TIM_OC_PWM2
Definition: stm32_pwm.h:64
struct no_os_irq_ctrl_desc * nvic_tim
Definition: stm32_pwm.h:114
uint32_t id
Definition: no_os_pwm.h:74
uint32_t(* get_timer_clock)(void)
Definition: stm32_pwm.h:110
enum no_os_irq_peripheral peripheral
Definition: no_os_irq.h:156
uint32_t period_ns
Definition: no_os_pwm.h:105
int32_t stm32_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM.
Definition: stm32_pwm.c:341
@ TIM_OC_PWM1
Definition: stm32_pwm.h:63
struct no_os_gpio_desc * pwm_gpio
Definition: no_os_pwm.h:115
uint32_t irq_id
Definition: no_os_pwm.h:86
bool timer_autoreload
Definition: stm32_pwm.h:102
uint32_t timer_chn
Definition: stm32_pwm.h:79
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:82
Header file for stm32 irq specifics.
void * ctx
Definition: no_os_irq.h:152
int32_t stm32_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by stm32_pwm_init()
Definition: stm32_pwm.c:401
const struct no_os_pwm_platform_ops stm32_pwm_ops
STM32 platform specific PWM platform ops structure.
Definition: stm32_pwm.c:622
TIM_HandleTypeDef htimer
Definition: stm32_pwm.h:96
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:111
int32_t no_os_irq_unregister_callback(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id, struct no_os_callback_desc *callback_desc)
Unregisters a generic IRQ handling function.
Definition: no_os_irq.c:118
uint32_t irq_id
Definition: no_os_pwm.h:117
@ NO_OS_TIM_IRQ
Definition: no_os_irq.h:94
#define NO_OS_CHN_TO_STM32_CHN(x)
Definition: stm32_pwm.c:53
const struct no_os_pwm_platform_ops stm32_pwm_ops
STM32 specific PWM platform ops structure.
Definition: stm32_pwm.c:622
const struct no_os_irq_platform_ops * platform_ops
Definition: no_os_irq.h:117
bool complementary_channel
Definition: stm32_pwm.h:81
const struct no_os_irq_platform_ops stm32_irq_ops
stm32 specific IRQ platform ops structure
Definition: stm32_irq.c:588
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:110
int32_t no_os_irq_ctrl_init(struct no_os_irq_ctrl_desc **desc, const struct no_os_irq_init_param *param)
Initialize the IRQ interrupts.
Definition: no_os_irq.c:51
bool complementary_channel
Definition: stm32_pwm.h:108
void * handle
Definition: no_os_irq.h:158
void * extra
Definition: no_os_pwm.h:92
void(* callback)(void *context)
Definition: no_os_irq.h:150
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
int32_t stm32_pwm_get_duty_cycle(struct no_os_pwm_desc *desc, uint32_t *duty_cycle_ns)
Get the PWM duty cycle.
Definition: stm32_pwm.c:611
@ NO_OS_PWM_POLARITY_HIGH
Definition: no_os_pwm.h:63
void(* pwm_callback)(void *arg)
Definition: no_os_pwm.h:88
Structure representing an PWM generator device.
Definition: no_os_pwm.h:99
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:78
TimOCMode
Definition: stm32_pwm.h:61
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:55
enum no_os_irq_event event
Definition: no_os_irq.h:154
Header file of PWM Interface.
void * extra
Definition: no_os_pwm.h:123
Header file for stm32 gpio specifics.
#define FREQUENCY_HZ_TO_TIME_NS_FACTOR
Definition: stm32_pwm.c:54
void(* pwm_callback)(void *arg)
Definition: no_os_pwm.h:119
struct no_os_gpio_init_param * pwm_gpio
Definition: no_os_pwm.h:84
#define NULL
Definition: wrapper.h:64
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:113
int32_t no_os_irq_ctrl_remove(struct no_os_irq_ctrl_desc *desc)
Free the resources allocated by no_os_irq_ctrl_init().
Definition: no_os_irq.c:77
enum TimOCMode mode
Definition: stm32_pwm.h:104
int32_t no_os_irq_enable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Enable specific interrupt.
Definition: no_os_irq.c:187
Structure holding the STM32 PWM parameters.
Definition: stm32_pwm.h:71
uint32_t phase_ns
Definition: no_os_pwm.h:80
Header file of GPIO Interface.
uint32_t(* get_timer_clock)(void)
Definition: stm32_pwm.h:83
uint32_t prescaler
Definition: stm32_pwm.h:73
uint32_t prescaler
Definition: stm32_pwm.h:100
uint32_t timer_chn
Definition: stm32_pwm.h:106
Structure holding the STM32 PWM descriptor.
Definition: stm32_pwm.h:94
Header file of utility functions.
@ NO_OS_PWM_POLARITY_LOW
Definition: no_os_pwm.h:65
struct no_os_gpio_desc * gpio
Definition: stm32_pwm.h:98
struct no_os_callback_desc timer_callback
Definition: stm32_pwm.h:87
int32_t no_os_irq_disable(struct no_os_irq_ctrl_desc *desc, uint32_t irq_id)
Disable specific interrupt.
Definition: no_os_irq.c:204
Definition: no_os_irq.h:129
Error macro definition for ARM Compiler.
@ TIM_OC_TOGGLE
Definition: stm32_pwm.h:62
Implementation of stm32 pwm driver.
int32_t stm32_pwm_set_period(struct no_os_pwm_desc *desc, uint32_t period_ns)
Set the PWM period.
Definition: stm32_pwm.c:512