12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970 |
- #ifndef _USER_DEFINE_H_
- #define _USER_DEFINE_H_
- typedef unsigned char uint8;
- typedef unsigned short uint16;
- //typedef unsigned int uint32;
- typedef unsigned long uint32;
- typedef signed char int8;
- typedef signed short int16;
- //typedef signed int int32;
- typedef signed long int32;
- typedef float float32;
- typedef double float64;
- typedef unsigned char bool8;
- #define NULL 0
- #define TRUE 1ul
- #define FALSE 0
- #define YES 1ul
- #define NO 0
- #define EN 1ul
- #define DISEN 0
- #define HIGH 1ul
- #define LOW 0
- #define UP 1ul
- #define DOWN 0
- #define LS(reg,bit_count) ((reg) << (bit_count))
- #define RS(reg,bit_count) ((reg) >> (bit_count))
- #define SET(reg,bit_mask) ((reg) | (bit_mask))
- #define CLEAR(reg,bit_mask) ((reg) & ~(bit_mask))
- #define NEGATE(reg,bit_mask) ((reg) ^ (bit_mask))
- #define SET_VALUE(reg,bit_mask,value) (((reg) & (~(bit_mask))) | ((value) & (bit_mask)))
- #define BO0 0
- #define BO1 1
- #define BO2 2
- #define BO3 3
- #define BO4 4
- #define BO5 5
- #define BO6 6
- #define BO7 7
- #define BO8 8
- #define BO9 9
- #define BO10 10
- #define BO11 11
- #define BO12 12
- #define BO13 13
- #define BO14 14
- #define BO15 15
- #define BM0 (1ul<<0)
- #define BM1 (1ul<<1)
- #define BM2 (1ul<<2)
- #define BM3 (1ul<<3)
- #define BM4 (1ul<<4)
- #define BM5 (1ul<<5)
- #define BM6 (1ul<<6)
- #define BM7 (1ul<<7)
- #define BM8 (1ul<<8)
- #define BM9 (1ul<<9)
- #define BM10 (1ul<<10)
- #define BM11 (1ul<<11)
- #define BM12 (1ul<<12)
- #define BM13 (1ul<<13)
- #define BM14 (1ul<<14)
- #define BM15 (1ul<<15)
- #endif
|