gpio写完,延时不准
This commit is contained in:
+82
-47
@@ -1,23 +1,10 @@
|
||||
#ifndef __BSP_H__
|
||||
#define __BSP_H__
|
||||
|
||||
/* 板级BSP头文件 */
|
||||
#include "Board.h"
|
||||
#include "VoiletTypeDef.h"
|
||||
#include "Voilet.h"
|
||||
|
||||
/* SHELL头文件 */
|
||||
#include "LetterShell.h"
|
||||
|
||||
/* BSP版本 */
|
||||
#define VERSION_0 0
|
||||
#define VERSION_1 1
|
||||
#define VERSION_2 2
|
||||
|
||||
/* RTOS宏开关 */
|
||||
#ifdef USE_RTOS
|
||||
#ifdef USE_THREADX
|
||||
#include "tx_api.h"
|
||||
#endif
|
||||
#endif
|
||||
#define ARRAY_LEN(arr) (sizeof(arr) / sizeof((arr)[0]))
|
||||
|
||||
/* BOOL类型定义 */
|
||||
typedef enum {
|
||||
@@ -25,44 +12,92 @@ typedef enum {
|
||||
true = 1,
|
||||
} bool_t;
|
||||
|
||||
//System
|
||||
void BspInit(void);
|
||||
void BspExtraInit(void);
|
||||
void SystemStart(void);
|
||||
void BspSystemReboot(void);
|
||||
|
||||
//GPIO
|
||||
//数组信号输出开关
|
||||
#define DO_ON 0
|
||||
#define DO_OFF 1
|
||||
//数组信号输入/出开关
|
||||
#define DI_ON 1
|
||||
#define DI_OFF 0
|
||||
#define DO_ON 1
|
||||
#define DO_OFF 0
|
||||
//LED灯开关
|
||||
#define LED_ON 0
|
||||
#define LED_OFF 1
|
||||
void SystemGpioInit(void);
|
||||
void GpioConfig(GPIO_TypeDef *GpioX, uint16_t GpioPinX,GPIOMode_TypeDef GpioMode, GPIOSpeed_TypeDef GpioSpeed);
|
||||
void GpioSetSts(GPIO_TypeDef *GpioX, uint16_t GpioPinX, uint8_t Status);
|
||||
uint8_t GpioGetSts(GPIO_TypeDef *GpioX, uint16_t GpioPinX);
|
||||
void LedToggle(uint8_t Chnl);
|
||||
void LedOff(uint8_t Chnl);
|
||||
|
||||
/* Voilet */
|
||||
void VoiletBspInit(void);
|
||||
|
||||
/* BSP */
|
||||
void AllPeriphClockDisable(void);
|
||||
void LedOn(uint8_t Chnl);
|
||||
void LedOff(uint8_t Chnl);
|
||||
void LedSet(uint8_t Chnl,uint8_t Value);
|
||||
void LedToggle(uint8_t Chnl);
|
||||
|
||||
//System Delay
|
||||
void SystemDelayConfig(void);
|
||||
uint32_t SystemGetDwtCnt(void);
|
||||
void SystemDelayUs(uint32_t Us);
|
||||
void SystemDelayMs(uint32_t Ms);
|
||||
void DelayConfig(void);
|
||||
unsigned int DwtCntGet(void);
|
||||
void DelayUs(unsigned int Us);
|
||||
void DelayMs(unsigned int Ms);
|
||||
|
||||
//Interrupt
|
||||
void SystemInterruptInit(void);
|
||||
void InterruptRegister(uint32_t Irqn, void(*Func)(uint32_t));
|
||||
void InterruptSetLevel(uint32_t Vector, uint8_t NvicPrePriority, uint8_t NvicSubPriority);
|
||||
void InterruptDisable(uint32_t Vector);
|
||||
/* GPIO */
|
||||
void GpioClockEnable(const GPIO_MAP_T *GpioX);
|
||||
void GpioConfig(const GPIO_MAP_T *GpioX, GPIOMode_TypeDef GpioMode, GPIOSpeed_TypeDef GpioSpeed);
|
||||
void GpioSet(const GPIO_MAP_T *GpioX, uint8_t Value);
|
||||
unsigned char GpioGet(const GPIO_MAP_T *GpioX);
|
||||
|
||||
/* UART */
|
||||
void UartClockEnable(const COM_MAP_T *ComX);
|
||||
// void UartSendChar(uint32_t ComId,uint8_t Data);
|
||||
// void UartSendStr(uint32_t ComId,uint8_t* Data, uint64_t Len);
|
||||
// void UartStdConfig(COM_MAP_T ComX, uint32_t baud);
|
||||
// void UartAdvConfig(const COM_MAP_T *ComX, uint32_t baud, uint8_t DataBits, uint8_t StopBits, uint8_t Parity);
|
||||
// #define UartStdConfig(ComX, baud) UartStdConfig((COM_MAP_T)ComX, baud)
|
||||
|
||||
// /* 板级BSP头文件 */
|
||||
// #include "Board.h"
|
||||
//
|
||||
// /* SHELL头文件 */
|
||||
// #include "LetterShell.h"
|
||||
//
|
||||
// /* BSP版本 */
|
||||
// #define VERSION_0 0
|
||||
// #define VERSION_1 1
|
||||
// #define VERSION_2 2
|
||||
//
|
||||
// /* RTOS宏开关 */
|
||||
// #ifdef USE_RTOS
|
||||
// #ifdef USE_THREADX
|
||||
// #include "tx_api.h"
|
||||
// #endif
|
||||
// #endif
|
||||
//
|
||||
//
|
||||
// //System
|
||||
// void BspInit(void);
|
||||
// void BspExtraInit(void);
|
||||
// void SystemStart(void);
|
||||
// void BspSystemReboot(void);
|
||||
//
|
||||
// void SystemGpioInit(void);
|
||||
// void GpioConfig(GPIO_TypeDef *GpioX, uint16_t GpioPinX,GPIOMode_TypeDef GpioMode, GPIOSpeed_TypeDef GpioSpeed);
|
||||
// void GpioSetSts(GPIO_TypeDef *GpioX, uint16_t GpioPinX, uint8_t Status);
|
||||
// uint8_t GpioGetSts(GPIO_TypeDef *GpioX, uint16_t GpioPinX);
|
||||
// void LedToggle(uint8_t Chnl);
|
||||
// void LedOff(uint8_t Chnl);
|
||||
// void LedOn(uint8_t Chnl);
|
||||
//
|
||||
//
|
||||
// //Interrupt
|
||||
// void SystemInterruptInit(void);
|
||||
// void InterruptRegister(uint32_t Irqn, void(*Func)(uint32_t));
|
||||
// void InterruptSetLevel(uint32_t Vector, uint8_t NvicPrePriority, uint8_t NvicSubPriority);
|
||||
// void InterruptDisable(uint32_t Vector);
|
||||
//
|
||||
// //Usart
|
||||
// void SystemUsartInit(void);
|
||||
// void UsartSendChar(uint32_t ComId,uint8_t Data);
|
||||
// void UsartSendStr(uint32_t ComId,uint8_t* Data, uint64_t Len);
|
||||
// uint8_t UsartReceiveChar(uint32_t ComId);
|
||||
// void UsartStdConfig(uint32_t ComId, uint32_t baud);
|
||||
// void UsartAdvConfig(uint32_t ComId, uint32_t baud, uint8_t DataBits, uint8_t StopBits, uint8_t Parity);
|
||||
|
||||
//Usart
|
||||
void SystemUsartInit(void);
|
||||
void UsartSendChar(uint32_t ComId,uint8_t Data);
|
||||
void UsartSendStr(uint32_t ComId,uint8_t* Data, uint64_t Len);
|
||||
uint8_t UsartReceiveChar(uint32_t ComId);
|
||||
void UsartStdConfig(uint32_t ComId, uint32_t baud);
|
||||
void UsartAdvConfig(uint32_t ComId, uint32_t baud, uint8_t DataBits, uint8_t StopBits, uint8_t Parity);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user