OSDN Git Service

fdd3d329bd1a95171688e0a093384c659916ffc8
[nxt-jsp/etrobo-atk.git] / nxtOSEK / samples / nxte / nxte.h
1 /* nxte.h */ \r
2 \r
3 #ifndef _NXTE_H_\r
4 #define _NXTE_H_\r
5 \r
6 #include "ecrobot_interface.h"\r
7 \r
8 #define NXTe_I2C_ADDR 0x28 /* 0x50>>1 */\r
9 #define MAX_NXTe_CH  4     /* max. number of NXTe channels for LSC */\r
10 \r
11 /* LATTEBOX LSC servo channel configuration */  \r
12 /* each bit (0 to 9 bits) represents enable/disable for each servo control */\r
13 #define ALL_SERVO_ENABLE 0x03FF\r
14 #define MIN_SERVO_CH  1\r
15 #define MAX_SERVO_CH 10\r
16 \r
17 #define MAX_ANGLE 2000\r
18 #define MIN_ANGLE 0\r
19 \r
20 extern const U8 NXTe_CH[MAX_NXTe_CH];\r
21 \r
22 extern void init_NXTe(U8 port_id);\r
23 extern void sync_NXTeServo(U8 port_id, U8 nxte_ch);\r
24 extern void load_NXTeServo(U8 port_id, U8 nxte_ch, U16 servo_ch_bit);\r
25 extern   U16 read_NXTeMotion(U8 port_id, U8 nxte_ch);\r
26 extern void  set_NXTeDelay(U8 port_id, U8 nxte_ch, U8 servo_ch, U8 delay);\r
27 extern void  set_NXTeAngle(U8 port_id, U8 nxte_ch, U8 servo_ch, S16 angle);\r
28 extern   S16  get_NXTeAngle(U8 port_id, U8 nxte_ch, U8 servo_ch);\r
29 \r
30 #endif\r