00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef ARMLIBDEFS_H
00023 #define ARMLIBDEFS_H
00024
00025
00026 #define MIN(a,b) (((a)<(b))?(a):(b))
00027 #define MAX(a,b) (((a)>(b))?(a):(b))
00028 #define ABS(x) (((x)>0)?(x):(-x))
00029
00030
00031 #define PI 3.14159265359
00032
00033
00034 #ifndef BIT
00035 #define BIT(n) (1 << (n))
00036 #endif
00037 #ifndef BV
00038 #define BV(n) (1 << (n))
00039 #endif
00040
00041 #define sbi(num,bitloc) (num|=(1<<bitloc))
00042 #define cbi(num,bitloc) (num&=~(1<<bitloc))
00043 #define gbi(num,bitloc) ((num&=(1<<bitloc))>>bitloc)
00044
00045
00046 #define GNUC_PACKED __attribute__((packed))
00047
00048
00049 #define P00 BIT(0) // P0.00
00050 #define P01 BIT(1) // P0.01
00051 #define P02 BIT(2) // P0.02
00052 #define P03 BIT(3) // P0.03
00053 #define P04 BIT(4) // P0.04
00054 #define P05 BIT(5) // P0.05
00055 #define P06 BIT(6) // P0.06
00056 #define P07 BIT(7) // P0.07
00057 #define P08 BIT(8) // P0.08
00058 #define P09 BIT(9) // P0.09
00059 #define P10 BIT(10) // P0.10
00060 #define P11 BIT(11) // P0.11
00061 #define P12 BIT(12) // P0.12
00062 #define P13 BIT(13) // P0.13
00063 #define P14 BIT(14) // P0.14
00064 #define P15 BIT(15) // P0.15
00065 #define P16 BIT(16) // P0.16
00066 #define P17 BIT(17) // P0.17
00067 #define P18 BIT(18) // P0.18
00068 #define P19 BIT(19) // P0.19
00069 #define P20 BIT(20) // P0.20
00070 #define P21 BIT(21) // P0.21
00071 #define P22 BIT(22) // P0.22
00072 #define P23 BIT(23) // P0.23
00073 #define P24 BIT(24) // P0.24
00074 #define P25 BIT(25) // P0.25
00075 #define P26 BIT(26) // P0.26
00076 #define P27 BIT(27) // P0.27
00077 #define P28 BIT(28) // P0.28
00078 #define P29 BIT(29) // P0.29
00079 #define P30 BIT(30) // P0.30
00080 #define P31 BIT(31) // P0.31
00081
00082 #endif