2018.07.26

Dependencies:   QEI mbed-rtos mbed

common.h

Committer:
sayzyas
Date:
2016-03-28
Revision:
1:86705c6e0ab7
Parent:
0:b1136bf48c38
Child:
2:c62dc496b79a

File content as of revision 1:86705c6e0ab7:

/*
 * mbed LPC824-Max header
 *
 */

#define __DEBUG__
#ifdef __DEBUG__
#define DEBUG_PRINT(...)  pc.printf(__VA_ARGS__)
#else
#define DEBUG_PRINT(...)  ;
//#define DEBUG_PRINT(...)  1 ? (void)0 : pc.printf(__VA_ARGS__)
#endif
/* Information */
#define LatestUpDate "2015.12.21"
#define ProgramRevision "RC2015.12.21" 
#define Author "Sayzyas"
#define Company "Revast Co.,Ltd"


/* Debug macro */
#define __DEBUG_L0__
#define __DEBUG_L1__
#define __DEBUG_L2__
#define __DEBUG_L3__
#define __DEBUG_L4__

#ifdef __DEBUG_L0__
    #define DEBUG_PRINT_L0(...)  pc.printf(__VA_ARGS__)
#else
    #define DEBUG_PRINT_L0(...) 
#endif
#ifdef __DEBUG_L1__
    #define DEBUG_PRINT_L1(...)  pc.printf(__VA_ARGS__)
#else
    #define DEBUG_PRINT_L1(...) 
#endif
#ifdef __DEBUG_L2__
    #define DEBUG_PRINT_L2(...)  pc.printf(__VA_ARGS__)
#else
    #define DEBUG_PRINT_L2(...) 
#endif
#ifdef __DEBUG_L3__
    #define DEBUG_PRINT_L3(...)  pc.printf(__VA_ARGS__)
#else
    #define DEBUG_PRINT_L3(...) 
#endif
#ifdef __DEBUG_L4__
    #define DEBUG_PRINT_L4(...)  pc.printf(__VA_ARGS__)
#else
    #define DEBUG_PRINT_L4(...) 
#endif

#define NumberOfI2CCommand 10

#define ROTATE_PER_RESOLUTION       24
#define REAL_THREAD_DIAMETER        63          // 60+3
//#define ROTATION_DISTANCE           197.82f     // (60+3)*3.14
#define ROTATION_PULSE_PER_1ROUND   16384       // 2^12(bit) * 4
#define PAI                         3.1415

/* ***************** */
/* Target definition */
/* ***************** */
#define I2C_ADDRESS_RESOLVER    0x02
#define Target_IIC_ADDR 0x02 // For Resolver count controller 


/* Command Packet */
#define CLEAR_RESOLVER_POSITION       'X'
#define HELLO_PACKET        'A'

#define LED_ON  0
#define LED_OFF 1