#include "libusb.h"
#include "lms2012.h"
#include "c_com.h"
Go to the source code of this file.
|
enum | {
DAISY_WR_NOT_CONNECTED,
DAISY_WR_CONNECTED,
DAISY_WR_IDLE,
DAISY_WR_REQUESTED,
DAISY_WR_COMPLETED,
DAISY_WR_TIMED_OUT,
DAISY_WR_FAIL
} |
|
enum | {
DAISY_RD_IDLE,
DAISY_RD_REQUESTED,
DAISY_RD_DONE,
DAISY_RD_DISCONNECTED,
DAISY_RD_TIMEDOUT,
DAISY_RD_ERROR
} |
|
enum | {
DAISY_DOWN_DISCONNECTED,
DAISY_DOWN_CONNECTED,
DAISY_DOWN_UNLOCKING,
DAISY_CHECK_UNLOCK,
DAISY_DOWN_UNLOCKED,
DAISY_DOWN_SET_DEVICETYPE,
DAISY_DOWNSTREAM_CHECK_WRITE_DONE
} |
|
enum | { DAISY_PUSH_NOT_CONNECTED,
DAISY_PUSH_CONNECTED
} |
|
enum | {
DAISY_WR_OK = LIBUSB_SUCCESS,
DAISY_WR_DONE = DAISY_WR_OK,
DAISY_WR_NOT_FINISHED = LIBUSB_ERROR_BUSY,
DAISY_WR_ERROR = LIBUSB_ERROR_OTHER,
DAISY_WR_TIMEDOUT = LIBUSB_ERROR_TIMEOUT,
DAISY_WR_DISCONNECTED = LIBUSB_ERROR_NO_DEVICE
} |
|
enum | { STATUS_POS,
TYPE_POS,
MODE_POS,
DEVICE_DATA_POS
} |
|
enum | {
LEN1,
LEN2,
MSG1,
MSG2,
CMDTYP,
SUBCMD,
STAT
} |
|
enum | {
INFO_LEN1,
INFO_LEN2,
INFO_MSG1,
INFO_MSG2,
INFO_CMDTYP,
INFO_SUBCMD,
INFO_INFO
} |
|
enum | { EMPTY,
VALID
} |
|
enum | { DAISY_RD_OK = LIBUSB_SUCCESS,
DAISY_RD_NO_DATA_YET = LIBUSB_ERROR_BUSY
} |
|
|
RESULT | cDaisyReady (void) |
|
int | cDaisyWrite (void) |
|
RESULT | cDaisyGetDownstreamData (DATA8 Layer, DATA8 Sensor, DATA8 Length, DATA8 *pType, DATA8 *pMode, DATA8 *pData) |
|
void | cDaisyPollFromDownstream (void) |
|
RESULT | cDaisyDownStreamCmd (DATA8 *pData, DATA8 Length, DATA8 Layer) |
|
int | cDaisyWriteDone (void) |
|
int | cDaisyGetLastWriteState (void) |
|
int | cDaisyGetLastWriteResult (void) |
|
RESULT | cDaisyInit (void) |
|
RESULT | cDaisyOpen (void) |
|
RESULT | cDaisyClose (void) |
|
RESULT | cDaisyExit (void) |
|
void | cDaisyControl (void) |
|
void | cDaisySetTimeout (int TimeOut) |
|
DATA8 | cDaisyGetUsbUpStreamSpeed (void) |
|
void | cDaisyReadFromDownStream (void) |
|
int | cDaisyGetInterruptPacketSize (void) |
|
void | cDaisyCmd (RXBUF *pRxBuf, TXBUF *pTxBuf) |
|
RESULT | cDaisySetDeviceInfo (DATA8 Length, UBYTE *pInfo) |
|
RESULT | cDaisyGetDeviceInfo (DATA8 Length, UBYTE *pInfo) |
|
RESULT | cDaisySetDeviceType (DATA8 Layer, DATA8 Port, DATA8 Type, DATA8 Mode) |
|
UWORD | cDaisyData (UBYTE **pData) |
|
void | cDaisyStuffTxed (void) |
|
uint | GetDaisyPushCounter (void) |
|
void | ResetDaisyPushCounter (void) |
|
RESULT | cDaisyChained (void) |
|
void | DecrementDaisyPushCounter (void) |
|
void | cDaisyPushUpStream (void) |
|
void | cDaisyPrepareNext (void) |
|
void | SetUnlocked (int Status) |
|
int | GetUnlocked (void) |
|
void | SetSlaveUnlocked (int Status) |
|
int | GetSlaveUnlocked (void) |
|
void | cDaisySetOwnLayer (UBYTE Layer) |
|
UBYTE | cDaisyGetOwnLayer (void) |
|
UBYTE | cDaisyCheckBusyBit (UBYTE Layer, UBYTE PortBits) |
|
RESULT | cDaisyCheckBusyIndex (UBYTE Layer, UBYTE Port) |
|
void | cDaisySetBusyFlags (UBYTE Layer, UBYTE Port, UBYTE MagicCookie) |
|
RESULT | cDaisyMotorDownStream (DATA8 *pData, DATA8 Length, DATA8 Layer, DATA8 PortField) |
|
#define DAISY_CHAIN_DOWNSTREAM 0xA0 |
#define DAISY_CHAIN_DOWNSTREAM_WITH_BUSY 0XA5 |
#define DAISY_CHAIN_INFO 0xA2 |
#define DAISY_CHAIN_UPSTREAM 0xA1 |
#define DAISY_COMMAND_NO_REPLY 0x8A |
#define DAISY_COMMAND_REPLY 0x0A |
#define DAISY_DEFAULT_TIMEOUT 1000 |
#define DAISY_DEVICE_CHKSUM_SIZE 1 |
#define DAISY_INT_EP_ADR 0x01 |
#define DAISY_MAX_EP_IN_SIZE 64 |
#define DAISY_MAX_EP_OUT_SIZE 64 |
#define DAISY_MAX_INPUT_PER_LAYER 4 |
#define DAISY_MAX_INPUT_SENSOR_INDEX 3 |
#define DAISY_MAX_LAYER_DEPT 4 |
#define DAISY_MAX_OUTPUT_PER_LAYER 4 |
#define DAISY_PRIORITY_COUNT 2 |
#define DAISY_PRODUCT_ID 0x0005 |
#define DAISY_PUSH_NOT_UNLOCKED 0x55 |
#define DAISY_REPLY_ERROR 0x09 |
#define DAISY_SENSOR_OUTPUT_OFFSET 12 |
#define DAISY_SET_TYPE 0xA4 |
#define DAISY_SLAVE_SEARCH_STRING "ID 0694:0005 Lego Group" |
#define DAISY_UNLOCK_SLAVE 0xA3 |
#define DAISY_VENDOR_ID 0x0694 |
#define DEVICE_MAX_DATA 32 |
#define INTERFACE_NUMBER 0 |
#define LAYER_POS_DOWN (STAT +1) |
#define LAYER_POS_TO_SLAVE (STAT) |
#define SIZEOF_DAISY_DEVICE_DATA_PROLOG 11 |
#define SIZEOF_DAISY_INFO 6 |
#define SIZEOF_DAISY_POLL 6 |
#define SIZEOF_DAISY_READ 8 |
#define SIZEOF_DAISY_WRITE 6 |
#define SIZEOF_UNLOCK_REPLY 7 |
#define SLAVE_PROD_ID "0005" |
#define SLAVE_VENDOR_ID "0694" |
#define TIME_TO_CHECK_FOR_DAISY_DOWNSTREAM 2000 |
Enumerator |
---|
DAISY_WR_NOT_CONNECTED |
|
DAISY_WR_CONNECTED |
|
DAISY_WR_IDLE |
|
DAISY_WR_REQUESTED |
|
DAISY_WR_COMPLETED |
|
DAISY_WR_TIMED_OUT |
|
DAISY_WR_FAIL |
|
Definition at line 287 of file c_daisy.h.
Enumerator |
---|
DAISY_RD_IDLE |
|
DAISY_RD_REQUESTED |
|
DAISY_RD_DONE |
|
DAISY_RD_DISCONNECTED |
|
DAISY_RD_TIMEDOUT |
|
DAISY_RD_ERROR |
|
Definition at line 299 of file c_daisy.h.
Enumerator |
---|
DAISY_DOWN_DISCONNECTED |
|
DAISY_DOWN_CONNECTED |
|
DAISY_DOWN_UNLOCKING |
|
DAISY_CHECK_UNLOCK |
|
DAISY_DOWN_UNLOCKED |
|
DAISY_DOWN_SET_DEVICETYPE |
|
DAISY_DOWNSTREAM_CHECK_WRITE_DONE |
|
Definition at line 311 of file c_daisy.h.
Enumerator |
---|
DAISY_PUSH_NOT_CONNECTED |
|
DAISY_PUSH_CONNECTED |
|
Definition at line 323 of file c_daisy.h.
Enumerator |
---|
DAISY_WR_OK |
|
DAISY_WR_DONE |
|
DAISY_WR_NOT_FINISHED |
|
DAISY_WR_ERROR |
|
DAISY_WR_TIMEDOUT |
|
DAISY_WR_DISCONNECTED |
|
Definition at line 347 of file c_daisy.h.
Enumerator |
---|
STATUS_POS |
|
TYPE_POS |
|
MODE_POS |
|
DEVICE_DATA_POS |
|
Definition at line 360 of file c_daisy.h.
Enumerator |
---|
LEN1 |
|
LEN2 |
|
MSG1 |
|
MSG2 |
|
CMDTYP |
|
SUBCMD |
|
STAT |
|
Definition at line 369 of file c_daisy.h.
Enumerator |
---|
INFO_LEN1 |
|
INFO_LEN2 |
|
INFO_MSG1 |
|
INFO_MSG2 |
|
INFO_CMDTYP |
|
INFO_SUBCMD |
|
INFO_INFO |
|
Definition at line 381 of file c_daisy.h.
Enumerator |
---|
DAISY_RD_OK |
|
DAISY_RD_NO_DATA_YET |
|
Definition at line 416 of file c_daisy.h.
RESULT cDaisyChained |
( |
void |
| ) |
|
RESULT cDaisyCheckBusyIndex |
( |
UBYTE |
Layer, |
|
|
UBYTE |
Port |
|
) |
| |
RESULT cDaisyClose |
( |
void |
| ) |
|
void cDaisyControl |
( |
void |
| ) |
|
RESULT cDaisyExit |
( |
void |
| ) |
|
RESULT cDaisyGetDeviceInfo |
( |
DATA8 |
Length, |
|
|
UBYTE * |
pInfo |
|
) |
| |
int cDaisyGetInterruptPacketSize |
( |
void |
| ) |
|
int cDaisyGetLastWriteResult |
( |
void |
| ) |
|
int cDaisyGetLastWriteState |
( |
void |
| ) |
|
UBYTE cDaisyGetOwnLayer |
( |
void |
| ) |
|
DATA8 cDaisyGetUsbUpStreamSpeed |
( |
void |
| ) |
|
RESULT cDaisyInit |
( |
void |
| ) |
|
RESULT cDaisyOpen |
( |
void |
| ) |
|
void cDaisyPollFromDownstream |
( |
void |
| ) |
|
void cDaisyPrepareNext |
( |
void |
| ) |
|
void cDaisyPushUpStream |
( |
void |
| ) |
|
void cDaisyReadFromDownStream |
( |
void |
| ) |
|
RESULT cDaisyReady |
( |
void |
| ) |
|
RESULT cDaisySetDeviceInfo |
( |
DATA8 |
Length, |
|
|
UBYTE * |
pInfo |
|
) |
| |
void cDaisySetOwnLayer |
( |
UBYTE |
Layer | ) |
|
void cDaisySetTimeout |
( |
int |
TimeOut | ) |
|
void cDaisyStuffTxed |
( |
void |
| ) |
|
int cDaisyWriteDone |
( |
void |
| ) |
|
void DecrementDaisyPushCounter |
( |
void |
| ) |
|
uint GetDaisyPushCounter |
( |
void |
| ) |
|
int GetSlaveUnlocked |
( |
void |
| ) |
|
void ResetDaisyPushCounter |
( |
void |
| ) |
|
void SetSlaveUnlocked |
( |
int |
Status | ) |
|
void SetUnlocked |
( |
int |
Status | ) |
|
enum { ... }
DAISY_DOWN_CONNECTION_STATES |
enum { ... }
DAISY_PUSH_CONNECTION_STATES |
enum { ... }
DAISY_READ_ERROR_CODES |
enum { ... }
DAISY_READ_STATES |
enum { ... }
DAISY_WR_ERROR_CODES |
enum { ... }
DAISY_WRITE_STATES |
enum { ... }
INFO_INDEXES |
enum { ... }
PAYLOAD_POSITIONS |
enum { ... }
REPLY_INDEXES |