forked from HelloSpoon/HelloSpoon-Spark
-
Notifications
You must be signed in to change notification settings - Fork 23
/
dxl_pro.h
40 lines (28 loc) · 1.32 KB
/
dxl_pro.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
* dxl_pro.h
*
* Created on: 2013. 4. 25.
* Author: ROBOTIS,.LTD.
*/
#ifndef DXL_PRO_H_
#define DXL_PRO_H_
#ifdef __cplusplus
extern "C" {
#endif
#define MAXNUM_TXPACKET (255)//(65535)
#define MAXNUM_RXPACKET (255)//(65535)
///////////////// utility for value ///////////////////////////
#define DXL_MAKEWORD(a, b) ((unsigned short)(((unsigned char)(((unsigned long)(a)) & 0xff)) | ((unsigned short)((unsigned char)(((unsigned long)(b)) & 0xff))) << 8))
#define DXL_MAKEDWORD(a, b) ((unsigned int)(((unsigned short)(((unsigned long)(a)) & 0xffff)) | ((unsigned int)((unsigned short)(((unsigned long)(b)) & 0xffff))) << 16))
#define DXL_LOWORD(l) ((unsigned short)(((unsigned long)(l)) & 0xffff))
#define DXL_HIWORD(l) ((unsigned short)((((unsigned long)(l)) >> 16) & 0xffff))
#define DXL_LOBYTE(w) ((unsigned char)(((unsigned long)(w)) & 0xff))
#define DXL_HIBYTE(w) ((unsigned char)((((unsigned long)(w)) >> 8) & 0xff))
#define RX_TIMEOUT_COUNT2 (1600L) //(1000L) //porting
#define NANO_TIME_DELAY (12000) //ydh added 20111228 -> 20120210 edited ydh
#define RX_TIMEOUT_COUNT1 (RX_TIMEOUT_COUNT2*128L)
unsigned short update_crc(unsigned short crc_accum, unsigned char *data_blk_ptr, unsigned short data_blk_size);
#ifdef __cplusplus
}
#endif
#endif /* DXL_PRO_H_ */