42 lines
952 B
C
42 lines
952 B
C
|
||
#ifndef __GPIO_H
|
||
#define __GPIO_H
|
||
|
||
#include "config.h"
|
||
|
||
#define GPIO_PullUp 0 //<2F>윗硫崗蕨왯
|
||
#define GPIO_HighZ 1 //륫왕渴흙
|
||
#define GPIO_OUT_OD 2 //역짤渴놔
|
||
#define GPIO_OUT_PP 3 //股共渴놔
|
||
|
||
#define GPIO_Pin_0 0x01 //IO多신 Px.0
|
||
#define GPIO_Pin_1 0x02 //IO多신 Px.1
|
||
#define GPIO_Pin_2 0x04 //IO多신 Px.2
|
||
#define GPIO_Pin_3 0x08 //IO多신 Px.3
|
||
#define GPIO_Pin_4 0x10 //IO多신 Px.4
|
||
#define GPIO_Pin_5 0x20 //IO多신 Px.5
|
||
#define GPIO_Pin_6 0x40 //IO多신 Px.6
|
||
#define GPIO_Pin_7 0x80 //IO多신 Px.7
|
||
#define GPIO_Pin_All 0xFF //IO杰唐多신
|
||
#define GPIO_Pin_Left 0x0F //IO돨1,2,3,4신
|
||
|
||
#define GPIO_P0 0
|
||
#define GPIO_P1 1
|
||
#define GPIO_P2 2
|
||
#define GPIO_P3 3
|
||
#define GPIO_P4 4
|
||
#define GPIO_P5 5
|
||
#define GPIO_P6 6
|
||
#define GPIO_P7 7
|
||
|
||
|
||
typedef struct
|
||
{
|
||
u8 Mode; //IO친駕, GPIO_PullUp,GPIO_HighZ,GPIO_OUT_OD,GPIO_OUT_PP
|
||
u8 Pin; //狼<>零돨똥왯
|
||
} GPIO_InitTypeDef;
|
||
|
||
u8 GPIO_Inilize(u8 GPIO, GPIO_InitTypeDef *GPIOx);
|
||
|
||
#endif
|