|
Dexter Industries NXTChuck Sensor driver
#define NXTCHUCK_CC_BTN_A 0x1000 |
Definition at line 75 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_B 0x4000 |
Definition at line 77 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_DD 0x0040 |
Definition at line 69 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_DL 0x0200 |
Definition at line 72 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_DR 0x0080 |
Definition at line 70 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_DU 0x0100 |
Definition at line 71 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_H 0x0008 |
Definition at line 66 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_LT 0x0020 |
Definition at line 68 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_M 0x0010 |
Definition at line 67 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_P 0x0004 |
Definition at line 65 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_RT 0x0002 |
Definition at line 64 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_X 0x0800 |
Definition at line 74 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_Y 0x2000 |
Definition at line 76 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_ZL 0x8000 |
Definition at line 78 of file dexterind-nxtchuck.h.
#define NXTCHUCK_CC_BTN_ZR 0x0400 |
Definition at line 73 of file dexterind-nxtchuck.h.
#define NXTCHUCK_COM_ERROR 0 |
Definition at line 40 of file dexterind-nxtchuck.h.
#define NXTCHUCK_COM_SUCCESS 1 |
Definition at line 41 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_BALANCE_BOARD 7 |
Definition at line 51 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_CLASSIC_CONTROLLER 3 |
Definition at line 47 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_DJH_TURNTABLE 6 |
Definition at line 50 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_GH_DRUMS 5 |
Definition at line 49 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_GH_GUITAR 4 |
Definition at line 48 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_MOTION_PLUS_ACTIVE 8 |
Definition at line 52 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_MOTION_PLUS_ACTIVE_CC_PT 10 |
Definition at line 54 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_MOTION_PLUS_ACTIVE_N_PT 9 |
Definition at line 53 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_MOTION_PLUS_INACTIVE 11 |
Definition at line 55 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_MOTION_PLUS_NL_ACTIVE 12 |
Definition at line 56 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_MOTION_PLUS_NL_CC_PT 14 |
Definition at line 58 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_MOTION_PLUS_NL_N_PT 13 |
Definition at line 57 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_NUNCHUK 2 |
Definition at line 46 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_NUNCHUK_BLACK 15 |
Definition at line 59 of file dexterind-nxtchuck.h.
#define NXTCHUCK_DEVICE_UNKNOWN 1 |
Definition at line 45 of file dexterind-nxtchuck.h.
#define NXTCHUCK_I2C_ADDRESS 0xA4 |
Definition at line 43 of file dexterind-nxtchuck.h.
#define NXTCHUCK_N_BTN_C 0x02 |
Definition at line 62 of file dexterind-nxtchuck.h.
#define NXTCHUCK_N_BTN_Z 0x01 |
Definition at line 61 of file dexterind-nxtchuck.h.
bool __NXTChuckReadRaw | ( | tSensors | link, |
ubyte | _reg, | ||
tByteArray & | data | ||
) |
Read 6 bytes from the nunchuck and return it.
Please note this is an internal function and should not be used directly.
link | the nunchuck port number |
_reg | the register to read |
data | the tByteArray to hold the returned data |
Definition at line 172 of file dexterind-nxtchuck.h.
bool _NXTChuckInit | ( | tSensors | link ) |
It's a nunchuck, innit? Initialise the nunchuck sensor.
Please note that this is an internal function and should not called directly.
link | the NXTChuck port number |
Definition at line 153 of file dexterind-nxtchuck.h.
bool NXTChuckReadClassicController | ( | tSensors | link, |
tClassicCtrl & | controller | ||
) |
Read the data from the classic controller.
link | the nunchuck port number |
controller | the tClassicCtrl that holds the Classic Controller related data. |
Definition at line 274 of file dexterind-nxtchuck.h.
bool NXTChuckreadIdent | ( | tSensors | link, |
tNunchuck & | nunchuck | ||
) |
Identify the type of nunchuck sensor connected to the NXT.
link | the nunchuck port number |
nunchuck | the tNunchuck that holds the nunchuck related data. |
Definition at line 201 of file dexterind-nxtchuck.h.
bool NXTChuckreadSensor | ( | tSensors | link, |
tNunchuck & | nunchuck | ||
) |
Read the data from the nunchuck.
link | the nunchuck port number |
nunchuck | the tNunchuck that holds the nunchuck related data. |
Definition at line 248 of file dexterind-nxtchuck.h.
ubyte _NXTChuckDataInit1[] = {3, 0xA4, 0xF0, 0x55} |
First of two arrays written to the extension to initialize
Definition at line 143 of file dexterind-nxtchuck.h.
ubyte _NXTChuckDataInit2[] = {3, 0xA4, 0xFB, 0x00} |
Second of two arrays written to the extension to initialize
Definition at line 144 of file dexterind-nxtchuck.h.
Array to hold I2C reply data
Definition at line 81 of file dexterind-nxtchuck.h.
Array to hold I2C command data
Definition at line 80 of file dexterind-nxtchuck.h.
ubyte NXTChuckIdentLookup[][] |
{ {0x00,0x00,0xA4,0x20,0x00,0x00}, {0x00,0x00,0xA4,0x20,0x01,0x01}, {0x00,0x00,0xA4,0x20,0x01,0x03}, {0x01,0x00,0xA4,0x20,0x01,0x03}, {0x03,0x00,0xA4,0x20,0x01,0x03}, {0x00,0x00,0xA4,0x20,0x04,0x02}, {0x00,0x00,0xA4,0x20,0x04,0x05}, {0x00,0x00,0xA4,0x20,0x05,0x05}, {0x00,0x00,0xA4,0x20,0x07,0x05}, {0x00,0x00,0xA6,0x20,0x00,0x05}, {0x00,0x00,0xA6,0x20,0x04,0x05}, {0x00,0x00,0xA6,0x20,0x05,0x05}, {0x00,0x00,0xA6,0x20,0x07,0x05}, {0xFF,0x00,0xA4,0x20,0x00,0x00} }
Definition at line 126 of file dexterind-nxtchuck.h.
bool NXTCHUCKinitialised[] = {false, false, false, false} |
Has the NXTChuck been initialised yet?
Definition at line 83 of file dexterind-nxtchuck.h.