forked from trocache/RefKEIL
24 lines
733 B
C
24 lines
733 B
C
#ifndef MYGPIO_H
|
|
#define MYGPIO_H
|
|
#include "stm32f10x.h"
|
|
typedef struct
|
|
{
|
|
GPIO_TypeDef * GPIO ;
|
|
char GPIO_Pin ; // numero de 0 a 15
|
|
char GPIO_Conf ; // voir ci dessous
|
|
}MyGPIO_Struct_TypeDef;
|
|
|
|
#define In_Floating 0x4
|
|
#define InPullDown 0x8
|
|
#define In_PullUp 0xF8
|
|
#define In_Analog 0x00
|
|
#define Out_Ppull 0x01
|
|
#define Out_OD 0x05
|
|
#define AltOut_Ppull 0x09
|
|
#define AltOut_OD 0x1D
|
|
void MyGPIO_Init(MyGPIO_Struct_TypeDef * GPIOStructPtr);
|
|
int MyGPIO_Read (GPIO_TypeDef * GPIO , char GPIO_Pin); // r e n v o i e 0 ou a u t r e chose d i f f e r e n t de 0
|
|
void MyGPIO_Set (GPIO_TypeDef * GPIO , char GPIO_Pin);
|
|
void MyGPIO_Reset (GPIO_TypeDef * GPIO , char GPIO_Pin);
|
|
void MyGPIO_Toggle (GPIO_TypeDef * GPIO , char GPIO_Pin);
|
|
#endif
|