2018.07.26

Dependencies:   QEI mbed-rtos mbed

Committer:
sayzyas
Date:
Mon Mar 28 00:09:56 2016 +0000
Revision:
1:86705c6e0ab7
Parent:
0:b1136bf48c38
Child:
2:c62dc496b79a
Rev20160325

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sayzyas 0:b1136bf48c38 1 /*
sayzyas 0:b1136bf48c38 2 * mbed LPC824-Max header
sayzyas 0:b1136bf48c38 3 *
sayzyas 0:b1136bf48c38 4 */
sayzyas 0:b1136bf48c38 5
sayzyas 0:b1136bf48c38 6 #define __DEBUG__
sayzyas 0:b1136bf48c38 7 #ifdef __DEBUG__
sayzyas 0:b1136bf48c38 8 #define DEBUG_PRINT(...) pc.printf(__VA_ARGS__)
sayzyas 0:b1136bf48c38 9 #else
sayzyas 0:b1136bf48c38 10 #define DEBUG_PRINT(...) ;
sayzyas 0:b1136bf48c38 11 //#define DEBUG_PRINT(...) 1 ? (void)0 : pc.printf(__VA_ARGS__)
sayzyas 0:b1136bf48c38 12 #endif
sayzyas 0:b1136bf48c38 13 /* Information */
sayzyas 0:b1136bf48c38 14 #define LatestUpDate "2015.12.21"
sayzyas 0:b1136bf48c38 15 #define ProgramRevision "RC2015.12.21"
sayzyas 0:b1136bf48c38 16 #define Author "Sayzyas"
sayzyas 0:b1136bf48c38 17 #define Company "Revast Co.,Ltd"
sayzyas 0:b1136bf48c38 18
sayzyas 0:b1136bf48c38 19
sayzyas 0:b1136bf48c38 20 /* Debug macro */
sayzyas 0:b1136bf48c38 21 #define __DEBUG_L0__
sayzyas 0:b1136bf48c38 22 #define __DEBUG_L1__
sayzyas 0:b1136bf48c38 23 #define __DEBUG_L2__
sayzyas 0:b1136bf48c38 24 #define __DEBUG_L3__
sayzyas 0:b1136bf48c38 25 #define __DEBUG_L4__
sayzyas 0:b1136bf48c38 26
sayzyas 0:b1136bf48c38 27 #ifdef __DEBUG_L0__
sayzyas 0:b1136bf48c38 28 #define DEBUG_PRINT_L0(...) pc.printf(__VA_ARGS__)
sayzyas 0:b1136bf48c38 29 #else
sayzyas 0:b1136bf48c38 30 #define DEBUG_PRINT_L0(...)
sayzyas 0:b1136bf48c38 31 #endif
sayzyas 0:b1136bf48c38 32 #ifdef __DEBUG_L1__
sayzyas 0:b1136bf48c38 33 #define DEBUG_PRINT_L1(...) pc.printf(__VA_ARGS__)
sayzyas 0:b1136bf48c38 34 #else
sayzyas 0:b1136bf48c38 35 #define DEBUG_PRINT_L1(...)
sayzyas 0:b1136bf48c38 36 #endif
sayzyas 0:b1136bf48c38 37 #ifdef __DEBUG_L2__
sayzyas 0:b1136bf48c38 38 #define DEBUG_PRINT_L2(...) pc.printf(__VA_ARGS__)
sayzyas 0:b1136bf48c38 39 #else
sayzyas 0:b1136bf48c38 40 #define DEBUG_PRINT_L2(...)
sayzyas 0:b1136bf48c38 41 #endif
sayzyas 0:b1136bf48c38 42 #ifdef __DEBUG_L3__
sayzyas 0:b1136bf48c38 43 #define DEBUG_PRINT_L3(...) pc.printf(__VA_ARGS__)
sayzyas 0:b1136bf48c38 44 #else
sayzyas 0:b1136bf48c38 45 #define DEBUG_PRINT_L3(...)
sayzyas 0:b1136bf48c38 46 #endif
sayzyas 0:b1136bf48c38 47 #ifdef __DEBUG_L4__
sayzyas 0:b1136bf48c38 48 #define DEBUG_PRINT_L4(...) pc.printf(__VA_ARGS__)
sayzyas 0:b1136bf48c38 49 #else
sayzyas 0:b1136bf48c38 50 #define DEBUG_PRINT_L4(...)
sayzyas 0:b1136bf48c38 51 #endif
sayzyas 0:b1136bf48c38 52
sayzyas 0:b1136bf48c38 53 #define NumberOfI2CCommand 10
sayzyas 0:b1136bf48c38 54
sayzyas 0:b1136bf48c38 55 #define ROTATE_PER_RESOLUTION 24
sayzyas 0:b1136bf48c38 56 #define REAL_THREAD_DIAMETER 63 // 60+3
sayzyas 0:b1136bf48c38 57 //#define ROTATION_DISTANCE 197.82f // (60+3)*3.14
sayzyas 0:b1136bf48c38 58 #define ROTATION_PULSE_PER_1ROUND 16384 // 2^12(bit) * 4
sayzyas 0:b1136bf48c38 59 #define PAI 3.1415
sayzyas 0:b1136bf48c38 60
sayzyas 0:b1136bf48c38 61 /* ***************** */
sayzyas 0:b1136bf48c38 62 /* Target definition */
sayzyas 0:b1136bf48c38 63 /* ***************** */
sayzyas 1:86705c6e0ab7 64 #define I2C_ADDRESS_RESOLVER 0x02
sayzyas 1:86705c6e0ab7 65 #define Target_IIC_ADDR 0x02 // For Resolver count controller
sayzyas 0:b1136bf48c38 66
sayzyas 0:b1136bf48c38 67
sayzyas 0:b1136bf48c38 68 /* Command Packet */
sayzyas 0:b1136bf48c38 69 #define CLEAR_RESOLVER_POSITION 'X'
sayzyas 0:b1136bf48c38 70 #define HELLO_PACKET 'A'
sayzyas 0:b1136bf48c38 71
sayzyas 0:b1136bf48c38 72 #define LED_ON 0
sayzyas 0:b1136bf48c38 73 #define LED_OFF 1