25 lines
562 B
C
25 lines
562 B
C
#ifndef _PWM_H
|
|
#define _PWM_H
|
|
|
|
#include "stdint.h"
|
|
|
|
/*---------------------- 配置 ------------------------*/
|
|
|
|
#define LCD_PWM_PORT GPIOD
|
|
#define LCD_PWM_CLK RCC_AHB1Periph_GPIOD
|
|
#define LCD_PWM_PIN GPIO_Pin_13
|
|
#define LCD_PWM_AF GPIO_AF_TIM4
|
|
#define LCD_PWM_PinSource GPIO_PinSource13
|
|
|
|
#define LCD_TIM_CLK RCC_APB1Periph_TIM4
|
|
#define LCD_TIM TIM4
|
|
|
|
/*-------------------- 函数声明 ----------------------*/
|
|
|
|
void LCD_PWMinit(uint8_t pulse); // PWM初始化
|
|
void LCD_PwmSetPulse(uint8_t pulse); // 设置占空比
|
|
// 获取屏幕亮度
|
|
uint8_t LCD_PwmGetPulse(void);
|
|
|
|
#endif
|