1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- #ifndef __HAL_PWM_H
- #define __HAL_PWM_H
- #include <stdint.h>
- #ifdef __cplusplus
- extern 'C'
- {
- #endif
- #ifdef __HAL_PWM_H_GLOBAL
- #define __HAL_PWM_H_EXTERN
- #else
- #define __HAL_PWM_H_EXTERN extern
- #endif
- /************************************************************************************************
- * Version *
- ************************************************************************************************/
- /************************************************************************************************
- * How to use *
- ************************************************************************************************/
- /************************************************************************************************
- * Enable config *
- ************************************************************************************************/
- /************************************************************************************************
- * Includes *
- ************************************************************************************************/
- #include "stm32f4xx_gpio.h"
- #include "stm32f4xx_tim.h"
- /************************************************************************************************
- * Defines *
- ************************************************************************************************/
- typedef struct
- {
- GPIO_TypeDef *pwm_gpio_port;
- uint32_t pwm_gpio_pin;
- uint32_t pwm_gpio_rcu;
- uint16_t pwm_gpio_af;
- uint8_t pwm_time_af;
- TIM_TypeDef *pwm_timer;
- uint32_t pwm_timer_rcu;
- uint32_t pwm_timer_ch;
- uint32_t pwm_prescaler;
- uint32_t pwm_period;
- uint32_t pwm_pulse;
- uint8_t pwm_status;
- } pwm_content_t;
- void pwm_init(pwm_content_t * pwm_content);
- void pwm_mode(pwm_content_t * pwm_content, uint8_t status);
- extern pwm_content_t pwm_timer3_content;
- /************************************************************************************************
- * Defines *
- ************************************************************************************************/
- #ifdef __cplusplus
- };
- #endif
- #endif // __HAL_PWM_H
|