Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 9869835739 |
@@ -48,7 +48,7 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
GPIO_TypeDef *GpioPort;
|
GPIO_TypeDef *GpioPort;
|
||||||
unsigned short GpioPin;
|
unsigned short GpioPin;
|
||||||
unsigned char Irqn;
|
// unsigned char Irqn;
|
||||||
} GPIO_PERIPH_T;
|
} GPIO_PERIPH_T;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -197,7 +197,7 @@ typedef struct {
|
|||||||
#define GPIO111 {RCC_APB2PeriphClockCmd, RCC_APB2Periph_GPIOG, {GPIOG, GPIO_Pin_15}}
|
#define GPIO111 {RCC_APB2PeriphClockCmd, RCC_APB2Periph_GPIOG, {GPIOG, GPIO_Pin_15}}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// #define GPIO_NULL ((COM_CONFIG){0, 0, {0, 0}})
|
#define GPIO_NULL {0, 0, {0, 0}}
|
||||||
|
|
||||||
/* COM */
|
/* COM */
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -209,7 +209,7 @@ typedef struct {
|
|||||||
void (*ClockCmd)(uint32_t RccPeriph, FunctionalState State);
|
void (*ClockCmd)(uint32_t RccPeriph, FunctionalState State);
|
||||||
unsigned int ClockTree;
|
unsigned int ClockTree;
|
||||||
COM_PERIPH_T Periph;
|
COM_PERIPH_T Periph;
|
||||||
// GPIO_MAP_T TxRxEn; //收发使能
|
GPIO_MAP_T TxRxEn; //收发使能
|
||||||
} COM_MAP_T;
|
} COM_MAP_T;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -223,17 +223,17 @@ typedef struct {
|
|||||||
|
|
||||||
#define COM_NUM 5
|
#define COM_NUM 5
|
||||||
#ifdef USART1
|
#ifdef USART1
|
||||||
#define COM0 (&(COM_MAP_T){RCC_APB2PeriphClockCmd, RCC_APB2Periph_USART1, {USART1,USART1_IRQn}})
|
#define COM0 (&(COM_MAP_T){RCC_APB2PeriphClockCmd, RCC_APB2Periph_USART1, {USART1,USART1_IRQn},GPIO_NULL})
|
||||||
#endif
|
#endif
|
||||||
#ifdef USART2
|
#ifdef USART2
|
||||||
#define COM1 (&(COM_MAP_T){RCC_APB1PeriphClockCmd, RCC_APB1Periph_USART2, {USART2,USART2_IRQn}})
|
#define COM1 (&(COM_MAP_T){RCC_APB1PeriphClockCmd, RCC_APB1Periph_USART2, {USART2,USART2_IRQn},GPIO_NULL})
|
||||||
#endif
|
#endif
|
||||||
#ifdef USART3
|
#ifdef USART3
|
||||||
#define COM2 (&(COM_MAP_T){RCC_APB1PeriphClockCmd, RCC_APB1Periph_USART3,{USART3,USART3_IRQn}})
|
#define COM2 (&(COM_MAP_T){RCC_APB1PeriphClockCmd, RCC_APB1Periph_USART3,{USART3,USART3_IRQn},GPIO_NULL})
|
||||||
#endif
|
#endif
|
||||||
#ifdef UART4
|
#ifdef UART4
|
||||||
#define COM3 (&(COM_MAP_T){RCC_APB1PeriphClockCmd, RCC_APB1Periph_UART4,{UART4,UART4_IRQn}})
|
#define COM3 (&(COM_MAP_T){RCC_APB1PeriphClockCmd, RCC_APB1Periph_UART4,{UART4,UART4_IRQn},GPIO_NULL})
|
||||||
#endif
|
#endif
|
||||||
#define COM4 (&(COM_MAP_T){RCC_APB1PeriphClockCmd, RCC_APB1Periph_UART5,{UART5,UART5_IRQn}})
|
#define COM4 (&(COM_MAP_T){RCC_APB1PeriphClockCmd, RCC_APB1Periph_UART5,{UART5,UART5_IRQn},GPIO_NULL})
|
||||||
|
|
||||||
#endif //_VOILET_PORT_H
|
#endif //_VOILET_PORT_H
|
||||||
|
|||||||
Reference in New Issue
Block a user