arduino:wio-canprot-en
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | arduino:wio-canprot-en [2024/06/17 15:03] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== WIOCAN ====== | ||
+ | [[: | ||
+ | [[: | ||
+ | * [[: | ||
+ | * [[: | ||
+ | * [[: | ||
+ | \\ | ||
+ | =====RCAN Protocol===== | ||
+ | **WIOcan**, (WIO-02 WIO-PROG2 WIO-PicoW-CAN), | ||
+ | The used CAN baudrate is 125k, which is fast enough and allows long wires.\\ | ||
+ | By using all of the 29 ID bits, will allow instructions with zero to eight bytes of data.\\ | ||
+ | This protocol can be used parallel with other protocols using standard frames and the same baudrate.\\ | ||
+ | Some CAN interfaces cannot be used for extended frames because the ID will be mangled. Use an other available **[[: | ||
+ | The recommended way to serialise CAN Frames over USB and TCP is **[[: | ||
+ | |||
+ | ====CAN Frame==== | ||
+ | ^ Extended ID ^^^^^ Count ^ Data[Count] | ||
+ | | PRIO | TYPE | SID | IC | RID | DLC | DATA | | ||
+ | | 3 | 2 | 8 | 8 | 8 | 4 | (0...8) x 8 | | ||
+ | < | ||
+ | EID 29bit: <PRIO 3bit> <TYPE 2bit> <SID 8bit> | ||
+ | Mask: < | ||
+ | </ | ||
+ | \\ | ||
+ | ^ CAN usage ^ Description ^ Range ^ Remark ^ | ||
+ | | PRIO | ID Priority | 0...7 | | ||
+ | | TYPE | Instruction type | 0...3 | cmd, evt, rsp, inf | | ||
+ | | SID | Sender ID | 1...255 | 1=Rocrail | | ||
+ | | IC | Instruction Code | 0x00...0xFF | Group 0xFn + Opcode 0xnF | | ||
+ | | RID | Receiver ID (NodeID) | 0...255 | 0=broadcast | | ||
+ | | DLC | Number of following data bytes | 0...8 | | ||
+ | | DATA | 8 data bytes | (0...8) x 0...255 | | ||
+ | |||
+ | \\ | ||
+ | ===Streaming=== | ||
+ | An exception on this header is streaming: | ||
+ | The PRIO and SID are used as 11bit down counter. This allows file sizes of max. 16kB.\\ | ||
+ | The end of streaming is triggered if the down counter reaches zero.\\ | ||
+ | The first data packet contains the file name with a max. length of 8 characters incl. extension.\\ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | =====0 System===== | ||
+ | ===CBUS Bootloader=== | ||
+ | Group GRP_SYS and command zero, Instruction Code 0x00, are not used to avoid CBUS bootloader EID conflicts.\\ | ||
+ | This could happen in case the SID is 8 and RID is 4 or 5.\\ | ||
+ | < | ||
+ | :X00080004N -> Bootloader command | ||
+ | :X00080005N -> Bootloader data | ||
+ | </ | ||
+ | |||
+ | ====0.1 State==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | SYS_STATE | x | 0 | | ||
+ | |||
+ | ===Response/ | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_RSP/ | ||
+ | |||
+ | ====0.2 SoD==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | SYS_SOD | 0 | 0 | | ||
+ | |||
+ | ===Response=== | ||
+ | This packets are the same as spontaneous events. | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_SENSOR | TYPE_EVT | x | INF_PORT | 0 | 6 | Port# | Type | Value | Aspect H | Aspect M | Aspect L | | ||
+ | | PRIO_INFO | TYPE_EVT | x | INF_IO | 0 | 1..8 | Port 0-7 | Port 8-15 | Port16-23 | Port 24-31 | Port 32-39 | Port 40-47 | Port 48-55 | Port 56-63 | | ||
+ | |||
+ | ====0.3 Clock==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_INFO | TYPE_CMD | 1 | SYS_CLOCK | 0 | 8 | Hour | Minute | Brightness | Month | Day of month | Temp.H | Temp.L | Divider | | ||
+ | |||
+ | ====0.4 EBreak==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | SYS_EBREAK | 0 | 0 | | ||
+ | |||
+ | ====0.5 Power==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | SYS_POWER | 0 | 1 | On=1 Off=0 | | ||
+ | |||
+ | ====0.6 Shutdown==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | SYS_SHUTDOWN | x/0 | 1 | x or all=0 | | ||
+ | |||
+ | ====0.7 Reboot==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | SYS_REBOOT | x | 0 | | ||
+ | |||
+ | ====0.8 Link==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | SYS_LINK | x | 3 | Source block | Destination block | Options | | ||
+ | |||
+ | ====0.9 Unlink==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | SYS_UNLINK | x | 2 | Block | Options | | ||
+ | |||
+ | \\ | ||
+ | =====1 Configuration===== | ||
+ | ====1.0 Query==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_QUERY | x | 0 | | ||
+ | |||
+ | ===Response=== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_RSP | x | CNF_QUERY | 1 | 8 | Manu-ID | Product-ID | Board type | Options 1 | Options 2 | Options 3 | Version High | Version Low | | ||
+ | |||
+ | ====1.1 Get==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_GET | x | 1 | CNF_OPTIONS | | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_GET | x | 1 | CNF_PORTGROUP_n | | ||
+ | |||
+ | ===Response=== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_RSP | x | CNF_GET | 1 | 7 | CNF_OPTIONS | Options 1 | Options2 | Options3 | Pulse length | CAN-ID | Subtype | | ||
+ | | PRIO_CONFIG | TYPE_RSP | x | CNF_GET | 1 | 5 | CNF_PORTGROUP_n | nib0 + nib1 | nib2 + nib3 | nib4 + nib5 | nib6 + nib7 | | ||
+ | One nible represents a port type, 0...15.\\ | ||
+ | |||
+ | ====1.2 Set==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_SET | x | 7 | CNF_OPTIONS | Options 1 | Options 2 | Options 3 | Pulselength | CAN-ID | Subtype | | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_SET | x | 5 | CNF_PORTGROUP_n | nib0 + nib1 | nib2 + nib3 | nib4 + nib5 | nib6 + nib7 | | ||
+ | |||
+ | ====1.3 Name==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_NAME | x | 8 | Name characters; Unused data bytes must be set to zero. |||||||| | ||
+ | |||
+ | ====1.4 ID==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_ID | x | 2 | New ID | Board type | | ||
+ | |||
+ | ====1.5 Identify==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_IDENTIFY | x | 0 | | ||
+ | The RID should blink the onboard LED fast until it receives another identify command.\\ | ||
+ | |||
+ | ====1.6 Get option==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_OPTIONGET | x | 1 | Option# | | ||
+ | Option number zero request all option bytes.\\ | ||
+ | |||
+ | ====1.7 Set option==== | ||
+ | Option number zero: (8 bit values) | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_OPTIONSET | x | 8 | Option# | Options1 | Options2 | Options3 | Options4 | Options5 | Options6 | Options7 | | ||
+ | Option number greater then zero: (16 bit value) | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | CNF_OPTIONSET | x | 3 | Option# | Options H | Options L | | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | =====2 Programming===== | ||
+ | ====2.0 Get CV==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | PRG_GETCV | x | 6 | Address H | Address L | CV H | CV L | Value | Options | | ||
+ | |||
+ | ====2.1 Set CV==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | PRG_SETCV | x | 6 | Address H | Address L | CV H | CV L | Value | Options | | ||
+ | |||
+ | ====2.2 Programming Track==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | 1 | PRG_PT | x | 1 | On/Off | | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | =====3 Streaming===== | ||
+ | ====3.0 Text start==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_LOW | TYPE_CMD | 1 | STR_TEXT_START | x | 4 | Display# | downcount | Text length | Type | | ||
+ | |||
+ | ====3.1 Text packet==== | ||
+ | The Prio and SID field are used as packet index.\\ | ||
+ | prio = (downcount & 0x700) >> 8; | ||
+ | sid = downcount & 0xFF; | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | prio | TYPE_CMD | sid | STR_TEXT | x | 8 | text[] | text[] | text[] | text[] | text[] | text[] | text[] | text[] | | ||
+ | |||
+ | |||
+ | ====3.2 not used==== | ||
+ | |||
+ | ====3.3 File packet==== | ||
+ | The Prio and SID field are used as packet index.\\ | ||
+ | prio = (downcount & 0x700) >> 8; | ||
+ | sid = downcount & 0xFF; | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | prio | TYPE_CMD | sid | STR_FILE | x | 8 | text[] | text[] | text[] | text[] | text[] | text[] | text[] | text[] | | ||
+ | |||
+ | ====3.4 Play==== | ||
+ | The filename is max. 8 characters in length. | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_LOW| TYPE_CMD | sid | STR_PLAY | x | 8 | filename[] | filename[] | filename[] | filename[] | filename[] | filename[] | filename[] | filename[] | | ||
+ | |||
+ | ====3.5 List files==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_CONFIG | TYPE_CMD | sid | STR_LIST | x | 0 | | ||
+ | The receiver will respond with STR_TEXT_START and n * STR_TEXT. | ||
+ | |||
+ | \\ | ||
+ | |||
+ | =====4 Port===== | ||
+ | ====4.0 Port==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | PRT_GET | x | 3...4 | Port# | Type | Value | Options | | ||
+ | |||
+ | ===Response=== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_SENSOR | TYPE_EVT | x | INF_PORT | 0 | 3..6 | Port# | Type | Value | Aspect H | Aspect M | Aspect L | | ||
+ | |||
+ | |||
+ | ====4.1 Signal==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | PRT_SIGNAL | x | 7 | Port# | Aspects | Aspect | Value H | Value L | Brightness | Dim delay | | ||
+ | |||
+ | ====4.2 Multiplex==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | PRT_MULTIPLEX | x | 7 | Port# | Aspects | Aspect | Value H | Value L | Brightness | Dim delay | | ||
+ | See **[[: | ||
+ | |||
+ | |||
+ | ====4.3 PWM Pair==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | PRT_PWMPAIR | x | 8 | PWM Port# | Options | Direction + F 0x80 | Velocity | Mass | Min. duty | Max. duty | Kickstart | | ||
+ | See **[[: | ||
+ | \\ | ||
+ | =====5 DCC===== | ||
+ | ====5.0 Dir-Velocity==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | DCC_DIRV | x | 5 | Address H | Address L | Velocity + direction 0x80 | Fn | Steps | | ||
+ | |||
+ | |||
+ | ====5.1 Function==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | DCC_FUN | x | 6 | Address H | Address L | Changed F | Value | Group | Fx | | ||
+ | |||
+ | ====5.3 Accessory==== | ||
+ | ^ Prio ^ Type ^ SID ^ Command ^ RID ^ DLC ^ D0 ^ D1 ^ D2 ^ D3 ^ D4 ^ D5 ^ D6 ^ D7 ^ | ||
+ | | PRIO_HIGH | TYPE_CMD | 1 | DCC_ACC | x | 6 | Address H | Address L | Port | Gate | Value | Delay | | ||
+ | |||
+ | |||
+ | \\ | ||
+ | \\ | ||
+ | =====C-Header===== | ||
+ | <code c> | ||
+ | // Priority | ||
+ | #define PRIO_SENSOR | ||
+ | #define PRIO_HIGH | ||
+ | #define PRIO_MEDIUM | ||
+ | #define PRIO_CONFIG | ||
+ | #define PRIO_LOW | ||
+ | #define PRIO_INFO | ||
+ | |||
+ | // Types | ||
+ | #define TYPE_CMD 0x00 | ||
+ | #define TYPE_EVT 0x01 | ||
+ | #define TYPE_RSP 0x02 | ||
+ | #define TYPE_ACK 0x03 | ||
+ | |||
+ | /* | ||
+ | IC = GRP | OPC | ||
+ | |||
+ | GRP = (IC & 0xF0) | ||
+ | OPC = (IC & 0x0F) | ||
+ | */ | ||
+ | |||
+ | #define GRP_SYS 0x00 // System | ||
+ | #define SYS_NOTUSED | ||
+ | #define SYS_STATE | ||
+ | #define SYS_SOD | ||
+ | #define SYS_CLOCK | ||
+ | #define SYS_EBREAK | ||
+ | #define SYS_POWER | ||
+ | #define SYS_SHUTDOWN | ||
+ | #define SYS_REBOOT | ||
+ | #define SYS_LINK | ||
+ | #define SYS_UNLINK | ||
+ | |||
+ | #define GRP_CNF 0x10 // Configuration | ||
+ | #define CNF_QUERY | ||
+ | #define CNF_GET | ||
+ | #define CNF_SET | ||
+ | #define CNF_NAME | ||
+ | #define CNF_ID | ||
+ | #define CNF_IDENTIFY | ||
+ | #define CNF_REBOOT | ||
+ | |||
+ | #define GRP_PRG 0x20 // Programming | ||
+ | #define PRG_GETCV 0x20 | ||
+ | #define PRG_SETCV 0x21 | ||
+ | #define PRG_PT | ||
+ | |||
+ | #define GRP_STR 0x30 // Streaming | ||
+ | #define STR_TEXT_START 0x30 // datat[0] = display number | ||
+ | #define STR_TEXT | ||
+ | #define STR_FILE | ||
+ | #define STR_PLAY | ||
+ | #define STR_LIST | ||
+ | |||
+ | #define GRP_PRT 0x40 // Port I/O | ||
+ | #define PRT_PORT | ||
+ | #define PRT_SIGNAL | ||
+ | #define PRT_MULTIPLEX 0x42 | ||
+ | #define PRT_PWMPAIR | ||
+ | |||
+ | #define GRP_DCC 0x50 // DCC Command Station | ||
+ | #define DCC_DIRV | ||
+ | #define DCC_FUN | ||
+ | #define DCC_BINSTATE 0x52 | ||
+ | #define DCC_ACC | ||
+ | #define DCC_BIND | ||
+ | |||
+ | #define GRP_INF 0x60 // Unsolicited events like Sensors, RailCom, RFID scanner, ... | ||
+ | #define INF_PORT 0x60 | ||
+ | #define INF_RFID 0x61 | ||
+ | #define INF_BIDI 0x62 | ||
+ | #define INF_ENV | ||
+ | #define INF_IO | ||
+ | #define INF_GOODBYE 0x65 | ||
+ | |||
+ | // type for streaming text | ||
+ | #define TEXT_TYPE_TEXT | ||
+ | #define TEXT_TYPE_SSID | ||
+ | #define TEXT_TYPE_FILE | ||
+ | #define TEXT_TYPE_FILE_DEL | ||
+ | #define TEXT_TYPE_FILE_DOWNLOAD 4 | ||
+ | #define TEXT_TYPE_BIN | ||
+ | |||
+ | |||
+ | |||
+ | // Config indexes | ||
+ | #define WIO_CNF_OPTIONS | ||
+ | #define WIO_CNF_PORTGROUP_0 1 | ||
+ | #define WIO_CNF_PORTGROUP_1 2 | ||
+ | #define WIO_CNF_PORTGROUP_2 3 | ||
+ | #define WIO_CNF_PORTGROUP_3 4 | ||
+ | #define WIO_CNF_REBOOT | ||
+ | |||
+ | // Prio values | ||
+ | #define PRIO_SENSOR | ||
+ | #define PRIO_HIGH | ||
+ | #define PRIO_CONFIG | ||
+ | #define PRIO_LOW | ||
+ | #define PRIO_INFO | ||
+ | |||
+ | // Instruction types | ||
+ | #define TYPE_CMD 0x00 | ||
+ | #define TYPE_EVT 0x01 | ||
+ | #define TYPE_RSP 0x02 | ||
+ | #define TYPE_ACK 0x03 | ||
+ | |||
+ | // EID masks | ||
+ | #define MASK_PRIO 0x1C000000 // >> 26 | ||
+ | #define MASK_MODE 0x03000000 // >> 24 | ||
+ | #define MASK_SID | ||
+ | #define MASK_IC | ||
+ | #define MASK_RID | ||
+ | |||
+ | #define SHIFT_PRIO 26 | ||
+ | #define SHIFT_MODE 24 | ||
+ | #define SHIFT_SID | ||
+ | #define SHIFT_IC | ||
+ | #define SHIFT_RID | ||
+ | |||
+ | // State bits | ||
+ | #define SYS_STATE_POWER 0x01 | ||
+ | #define SYS_STATE_SC | ||
+ | #define SYS_STATE_PT | ||
+ | #define SYS_STATE_SLAVE 0x08 | ||
+ | |||
+ | // Port types | ||
+ | #define PORTTYPE_DOUT | ||
+ | #define PORTTYPE_AOUT | ||
+ | #define PORTTYPE_SERVO 2 | ||
+ | #define PORTTYPE_PAIR | ||
+ | #define PORTTYPE_MOTOR 4 | ||
+ | #define PORTTYPE_DIN | ||
+ | #define PORTTYPE_ACC | ||
+ | #define PORTTYPE_LED | ||
+ | #define PORTTYPE_MULTIPLEX 10 | ||
+ | |||
+ | #define PORT_STATE_STRAIGHT 0 | ||
+ | #define PORT_STATE_TURNOUT | ||
+ | |||
+ | // Config indexes | ||
+ | #define CNF_IDX_OPTIONS | ||
+ | #define CNF_IDX_PORTGROUP_0 1 // 0... 7 | ||
+ | #define CNF_IDX_PORTGROUP_1 2 // 8...15 | ||
+ | #define CNF_IDX_PORTGROUP_2 3 // 16...23 | ||
+ | #define CNF_IDX_PORTGROUP_3 4 // 24...31 | ||
+ | |||
+ | |||
+ | |||
+ | </ | ||
arduino/wio-canprot-en.txt · Last modified: 2024/06/17 15:03 by 127.0.0.1