int32_t stm32_pwm_enable(struct no_os_pwm_desc *desc)
Enable the PWM.
Definition: stm32_pwm.c:509
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
bool timer_autoreload
Definition: stm32_pwm.h:86
@ PWM_TRGO_ENABLE
Definition: stm32_pwm.h:70
enum TimOCMode mode
Definition: stm32_pwm.h:88
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:664
Structure describing a callback to be registered.
Definition: no_os_irq.h:142
uint32_t repetitions
Definition: stm32_pwm.h:106
int32_t stm32_pwm_get_period(struct no_os_pwm_desc *desc, uint32_t *period_ns)
Get the PWM period.
Definition: stm32_pwm.c:640
enum stm32_pwm_trigger_out trigger_output
Definition: stm32_pwm.h:102
@ PWM_TRGO_UPDATE
Definition: stm32_pwm.h:71
Header file of IRQ interface.
@ PWM_TRGO_OC3REF
Definition: stm32_pwm.h:75
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:92
uint32_t repetitions
Definition: stm32_pwm.h:141
#define PWM_DEFAULT_PERIOD
Definition: stm32_pwm.c:46
uint32_t id
Definition: no_os_pwm.h:97
enum stm32_pwm_trigger trigger_source
Definition: stm32_pwm.h:100
int32_t stm32_pwm_disable(struct no_os_pwm_desc *desc)
Disable the PWM.
Definition: stm32_pwm.c:561
uint32_t period_ns
Definition: no_os_pwm.h:70
stm32_pwm_trigger
Definition: stm32_pwm.h:61
@ NO_OS_EVT_TIM_PWM_PULSE_FINISHED
Definition: no_os_irq.h:69
struct no_os_callback_desc timer_callback
Definition: stm32_pwm.h:139
uint32_t clock_divider
Definition: stm32_pwm.h:135
uint32_t phase_ns
Definition: no_os_pwm.h:103
uint32_t clock_divider
Definition: stm32_pwm.h:96
@ TIM_OC_PWM2
Definition: stm32_pwm.h:58
struct no_os_irq_ctrl_desc * nvic_tim
Definition: stm32_pwm.h:137
uint32_t id
Definition: no_os_pwm.h:68
uint32_t(* get_timer_clock)(void)
Definition: stm32_pwm.h:133
enum no_os_irq_peripheral peripheral
Definition: no_os_irq.h:150
uint32_t period_ns
Definition: no_os_pwm.h:99
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:403
@ PWM_TRGO_OC4REF
Definition: stm32_pwm.h:76
@ PWM_TRGO_OC2REF
Definition: stm32_pwm.h:74
@ TIM_OC_PWM1
Definition: stm32_pwm.h:57
struct no_os_gpio_desc * pwm_gpio
Definition: no_os_pwm.h:109
@ PWM_TRGO_OC1REF
Definition: stm32_pwm.h:73
uint32_t irq_id
Definition: no_os_pwm.h:80
bool timer_autoreload
Definition: stm32_pwm.h:125
uint32_t timer_chn
Definition: stm32_pwm.h:90
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:76
Header file for stm32 irq specifics.
@ PWM_TRGO_RESET
Definition: stm32_pwm.h:69
void * ctx
Definition: no_os_irq.h:146
int32_t stm32_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by stm32_pwm_init()
Definition: stm32_pwm.c:463
const struct no_os_pwm_platform_ops stm32_pwm_ops
STM32 platform specific PWM platform ops structure.
Definition: stm32_pwm.c:709
TIM_HandleTypeDef htimer
Definition: stm32_pwm.h:119
enum no_os_pwm_polarity polarity
Definition: no_os_pwm.h:105
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:112
uint32_t irq_id
Definition: no_os_pwm.h:111
@ NO_OS_TIM_IRQ
Definition: no_os_irq.h:88
#define NO_OS_CHN_TO_STM32_CHN(x)
Definition: stm32_pwm.c:47
const struct no_os_pwm_platform_ops stm32_pwm_ops
STM32 specific PWM platform ops structure.
Definition: stm32_pwm.c:709
bool onepulse_enable
Definition: stm32_pwm.h:104
@ PWM_TS_ITR1
Definition: stm32_pwm.h:63
const struct no_os_irq_platform_ops * platform_ops
Definition: no_os_irq.h:111
bool complementary_channel
Definition: stm32_pwm.h:92
const struct no_os_irq_platform_ops stm32_irq_ops
stm32 specific IRQ platform ops structure
Definition: stm32_irq.c:582
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:104
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:45
bool complementary_channel
Definition: stm32_pwm.h:131
void * handle
Definition: no_os_irq.h:152
void * extra
Definition: no_os_pwm.h:86
void(* callback)(void *context)
Definition: no_os_irq.h:144
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
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:698
@ NO_OS_PWM_POLARITY_HIGH
Definition: no_os_pwm.h:57
void(* pwm_callback)(void *arg)
Definition: no_os_pwm.h:82
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
uint32_t duty_cycle_ns
Definition: no_os_pwm.h:72
TimOCMode
Definition: stm32_pwm.h:55
bool dma_enable
Definition: stm32_pwm.h:108
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:49
enum no_os_irq_event event
Definition: no_os_irq.h:148
@ PWM_TS_ITR3
Definition: stm32_pwm.h:65
Header file of PWM Interface.
void * extra
Definition: no_os_pwm.h:117
Header file for stm32 gpio specifics.
#define FREQUENCY_HZ_TO_TIME_NS_FACTOR
Definition: stm32_pwm.c:48
void(* pwm_callback)(void *arg)
Definition: no_os_pwm.h:113
struct no_os_gpio_init_param * pwm_gpio
Definition: no_os_pwm.h:78
#define NULL
Definition: wrapper.h:64
bool trigger_enable
Definition: stm32_pwm.h:98
@ PWM_TS_ITR0
Definition: stm32_pwm.h:62
Structure holding the initial parameters for Interrupt Request.
Definition: no_os_irq.h:107
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:71
bool dma_enable
Definition: stm32_pwm.h:143
enum TimOCMode mode
Definition: stm32_pwm.h:127
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:181
Structure holding the STM32 PWM parameters.
Definition: stm32_pwm.h:82
uint32_t phase_ns
Definition: no_os_pwm.h:74
Header file of GPIO Interface.
uint32_t(* get_timer_clock)(void)
Definition: stm32_pwm.h:94
@ PWM_TS_ITR2
Definition: stm32_pwm.h:64
uint32_t prescaler
Definition: stm32_pwm.h:84
uint32_t prescaler
Definition: stm32_pwm.h:123
uint32_t timer_chn
Definition: stm32_pwm.h:129
Structure holding the STM32 PWM descriptor.
Definition: stm32_pwm.h:117
Header file of utility functions.
@ NO_OS_PWM_POLARITY_LOW
Definition: no_os_pwm.h:59
struct no_os_gpio_desc * gpio
Definition: stm32_pwm.h:121
struct no_os_callback_desc timer_callback
Definition: stm32_pwm.h:110
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:198
Definition: no_os_irq.h:123
stm32_pwm_trigger_out
Definition: stm32_pwm.h:68
Error macro definition for ARM Compiler.
@ PWM_TRGO_OC1
Definition: stm32_pwm.h:72
@ TIM_OC_TOGGLE
Definition: stm32_pwm.h:56
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:599