OSDN Git Service

Add more samples. (License is mostly unknown. Some are GPLed.)
[nxt-jsp/etrobo-atk.git] / nxtOSEK / samples / nxte22 / nxte22.h
diff --git a/nxtOSEK/samples/nxte22/nxte22.h b/nxtOSEK/samples/nxte22/nxte22.h
new file mode 100644 (file)
index 0000000..d567d97
--- /dev/null
@@ -0,0 +1,30 @@
+/* nxte22.h */ \r
+\r
+#ifndef _NXTE22_H_\r
+#define _NXTE22_H_\r
+\r
+#include "ecrobot_interface.h"\r
+\r
+#define NXTe_I2C_ADDR 0x28 /* 0x50>>1 */\r
+#define MAX_NXTe_CH  4     /* max. number of NXTe channels for LSC */\r
+\r
+/* LATTEBOX LSC22 servo channel configuration */  \r
+/* each bit (0 to 21 bits) represents enable/disable for each servo control */\r
+#define ALL_22SERVO_ENABLE 0x03FFFFF\r
+#define MIN_SERVO_CH  0\r
+#define MAX_SERVO_CH 21\r
+\r
+#define MAX_ANGLE 2000\r
+#define MIN_ANGLE 0\r
+\r
+extern const U8 NXTe_CH[MAX_NXTe_CH];\r
+\r
+extern void init_NXTe22(U8 port_id);\r
+extern void sync_NXTe22Servo(U8 port_id, U8 nxte_ch);\r
+extern void load_NXTe22Servo(U8 port_id, U8 nxte_ch, U32 servo_ch_bit);\r
+extern   U32 read_NXTe22Motion(U8 port_id, U8 nxte_ch);\r
+extern void  set_NXTe22Delay(U8 port_id, U8 nxte_ch, U8 servo_ch, U8 delay);\r
+extern void  set_NXTe22Angle(U8 port_id, U8 nxte_ch, U8 servo_ch, S16 angle);\r
+extern   S16  get_NXTe22Angle(U8 port_id, U8 nxte_ch, U8 servo_ch);\r
+\r
+#endif\r