存档
This commit is contained in:
60
apps/earphone/RFID/include/rfid_main.h
Normal file
60
apps/earphone/RFID/include/rfid_main.h
Normal file
@ -0,0 +1,60 @@
|
||||
#ifndef _RFID_MAIN_H
|
||||
#define _RFID_MAIN_H
|
||||
|
||||
#define uchar unsigned char
|
||||
#define uint unsigned int
|
||||
//typedef unsigned char u8;
|
||||
//typedef unsigned int u16;
|
||||
//typedef unsigned long u32;
|
||||
|
||||
#include "system/includes.h"
|
||||
#define BIT5 0x00000020U
|
||||
#define BIT6 0x00000040U
|
||||
#define BIT7 0x00000080U
|
||||
|
||||
|
||||
#define BIT0 0x00000001U
|
||||
#define BIT1 0x00000002U
|
||||
#define BIT2 0x00000004U
|
||||
#define BIT3 0x00000008U
|
||||
#define BIT4 0x00000010U
|
||||
#define BIT5 0x00000020U
|
||||
|
||||
|
||||
void Uart1Send(unsigned char dat);
|
||||
void Uart1SendString(unsigned char *str);
|
||||
|
||||
void printHex(unsigned char num);
|
||||
|
||||
typedef enum {
|
||||
FAIL = 0U,
|
||||
SUCCESS = !FAIL
|
||||
} ErrorStatus;
|
||||
|
||||
typedef enum {
|
||||
DISABLE = 0U,
|
||||
ENABLE = !DISABLE
|
||||
} FunState;
|
||||
|
||||
typedef enum {
|
||||
RESET = 0U,
|
||||
SET = !RESET
|
||||
} FlagStatus, ITStatus;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned char SendLength;
|
||||
unsigned char *pSendBuffer;
|
||||
unsigned char ReceiveLength;
|
||||
unsigned char *pReceiveBuffer;
|
||||
unsigned int Timeout;
|
||||
}transmission_struct;
|
||||
|
||||
|
||||
|
||||
unsigned char GetReg(unsigned char address,unsigned char *reg_data);
|
||||
unsigned char SetReg(unsigned char address, unsigned char reg_data);
|
||||
void Delay1ms();
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user