2024-04-03 10:05:55 +08:00

58 lines
1.1 KiB
C

/*
* public.h
*
* Created on: 2022年03月15日
* Author: User
*/
#ifndef __PUBLIC_H_
#define __PUBLIC_H_
//数据类型重定义
typedef signed char sint8_t;
typedef signed short int sint16_t;
typedef signed long int sint32_t;
typedef unsigned char uint8_t;
typedef unsigned short int uint16_t;
typedef unsigned long int uint32_t;
//定义位操作枚举类型
typedef enum
{
BIT0 = (uint8_t)(0x01 << 0),
BIT1 = (uint8_t)(0x01 << 1),
BIT2 = (uint8_t)(0x01 << 2),
BIT3 = (uint8_t)(0x01 << 3),
BIT4 = (uint8_t)(0x01 << 4),
BIT5 = (uint8_t)(0x01 << 5),
BIT6 = (uint8_t)(0x01 << 6),
BIT7 = (uint8_t)(0x01 << 7),
} BIT_t;
//定义枚举类型
typedef enum
{
TRUE = (bit)1,
FALSE = (bit)0,
} BOOL_t;
typedef enum
{
LOW = (bit)0,
HIGH = (bit)1,
} Voltage_t;
//定义结构体类型
typedef struct
{
void (*Delay_ms)(uint16_t); // ms延时函数
} Public_t;
/* extern variables-----------------------------------------------------------*/
extern Public_t Public;
#endif
/********************************************************
End Of File
********************************************************/