no-OS
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stm32_pwm.h
Go to the documentation of this file.
1/***************************************************************************/
32#ifndef STM32_PWM_H_
33#define STM32_PWM_H_
34
35#include <stdint.h>
36#include <stdbool.h>
37#include "no_os_gpio.h"
38#include "no_os_irq.h"
39#include "stm32_gpio.h"
40#include "stm32_hal.h"
41
46
52
60
71
77
84 void *htimer;
88 uint32_t prescaler;
94 uint32_t timer_chn;
98 uint32_t (*get_timer_clock)(void);
107 /* Enable one pulse */
109 /* Number of pulse repetitions */
110 uint32_t repetitions;
111 /* Enable dma */
115};
116
123 void *htimer;
129 uint32_t prescaler;
135 uint32_t timer_chn;
139 uint32_t (*get_timer_clock)(void);
146 /* Number of pulse repetitions */
147 uint32_t repetitions;
148 /* Enable dma */
150 /* Enable one pulse */
152};
153
157extern const struct no_os_pwm_platform_ops stm32_pwm_ops;
158
159#endif // STM32_PWM_H_
Header file of GPIO Interface.
Header file of IRQ interface.
Header file for stm32 gpio specifics.
const struct no_os_pwm_platform_ops stm32_pwm_ops
STM32 platform specific PWM platform ops structure.
Definition stm32_pwm.c:1173
stm32_pwm_slave_mode
Definition stm32_pwm.h:72
@ STM32_PWM_SM_DISABLE
Definition stm32_pwm.h:73
@ STM32_PWM_SM_TRIGGER
Definition stm32_pwm.h:74
@ STM32_PWM_SM_EXTERNAL1
Definition stm32_pwm.h:75
stm32_pwm_timer
Definition stm32_pwm.h:42
@ STM32_PWM_TIMER_TIM
Definition stm32_pwm.h:43
@ STM32_PWM_TIMER_LPTIM
Definition stm32_pwm.h:44
stm32_pwm_trigger_out
Definition stm32_pwm.h:61
@ PWM_TRGO_OC3REF
Definition stm32_pwm.h:68
@ PWM_TRGO_OC1REF
Definition stm32_pwm.h:66
@ PWM_TRGO_UPDATE
Definition stm32_pwm.h:64
@ PWM_TRGO_OC2REF
Definition stm32_pwm.h:67
@ PWM_TRGO_ENABLE
Definition stm32_pwm.h:63
@ PWM_TRGO_RESET
Definition stm32_pwm.h:62
@ PWM_TRGO_OC1
Definition stm32_pwm.h:65
@ PWM_TRGO_OC4REF
Definition stm32_pwm.h:69
stm32_pwm_trigger
Definition stm32_pwm.h:53
@ PWM_TS_ITR0
Definition stm32_pwm.h:55
@ PWM_TS_ITR1
Definition stm32_pwm.h:56
@ PWM_TS_ITR2
Definition stm32_pwm.h:57
@ PWM_TS_ITR3
Definition stm32_pwm.h:58
@ PWM_TS_NONE
Definition stm32_pwm.h:54
TimOCMode
Definition stm32_pwm.h:47
@ TIM_OC_TOGGLE
Definition stm32_pwm.h:48
@ TIM_OC_PWM1
Definition stm32_pwm.h:49
@ TIM_OC_PWM2
Definition stm32_pwm.h:50
Structure describing a callback to be registered.
Definition no_os_irq.h:136
Structure holding the GPIO descriptor.
Definition no_os_gpio.h:84
Definition no_os_irq.h:117
Structure holding PWM function pointers that point to the platform specific function.
Definition no_os_pwm.h:115
Structure holding the STM32 PWM descriptor.
Definition stm32_pwm.h:121
struct no_os_callback_desc timer_callback
Definition stm32_pwm.h:145
uint32_t(* get_timer_clock)(void)
Definition stm32_pwm.h:139
bool timer_autoreload
Definition stm32_pwm.h:131
bool onepulse_enable
Definition stm32_pwm.h:151
void * htimer
Definition stm32_pwm.h:123
bool dma_enable
Definition stm32_pwm.h:149
bool complementary_channel
Definition stm32_pwm.h:137
uint32_t prescaler
Definition stm32_pwm.h:129
enum TimOCMode mode
Definition stm32_pwm.h:133
uint32_t repetitions
Definition stm32_pwm.h:147
struct no_os_irq_ctrl_desc * nvic_tim
Definition stm32_pwm.h:143
struct no_os_gpio_desc * gpio
Definition stm32_pwm.h:127
uint32_t clock_divider
Definition stm32_pwm.h:141
uint32_t timer_chn
Definition stm32_pwm.h:135
enum stm32_pwm_timer pwm_timer
Definition stm32_pwm.h:125
Structure holding the STM32 PWM parameters.
Definition stm32_pwm.h:82
uint32_t prescaler
Definition stm32_pwm.h:88
enum stm32_pwm_trigger_out trigger_output
Definition stm32_pwm.h:106
uint32_t repetitions
Definition stm32_pwm.h:110
uint32_t timer_chn
Definition stm32_pwm.h:94
enum TimOCMode mode
Definition stm32_pwm.h:92
bool complementary_channel
Definition stm32_pwm.h:96
uint32_t(* get_timer_clock)(void)
Definition stm32_pwm.h:98
bool onepulse_enable
Definition stm32_pwm.h:108
bool timer_autoreload
Definition stm32_pwm.h:90
bool dma_enable
Definition stm32_pwm.h:112
enum stm32_pwm_slave_mode slave_mode
Definition stm32_pwm.h:102
struct no_os_callback_desc timer_callback
Definition stm32_pwm.h:114
enum stm32_pwm_trigger trigger_source
Definition stm32_pwm.h:104
void * htimer
Definition stm32_pwm.h:84
enum stm32_pwm_timer pwm_timer
Definition stm32_pwm.h:86
uint32_t clock_divider
Definition stm32_pwm.h:100