71 MARKLIN_DEFAULT_CMD = 0b00100110,
73 MARKLIN_CHANGE_DIR_B2 = 0b11000000,
76 DCC_LONG_PREAMBLE_CMD = 0b00001100,
77 DCC_SERVICE_MODE_5X_WITH_ACK_CMD = 0b00111000,
79 DCC_SERVICE_MODE_5X_CMD = 0b00101000,
80 DCC_SERVICE_MODE_1X_CMD = 0b00001000,
85 DCC_BASELINE_SPEED = 0b01000000,
86 DCC_BASELINE_SPEED_FORWARD = 0b00100000,
87 DCC_BASELINE_SPEED_LIGHT = 0b00010000,
88 DCC_FUNCTION1 = 0b10000000,
89 DCC_FUNCTION1_F0 = 0b00010000,
90 DCC_FUNCTION2_F5 = 0b10110000,
91 DCC_FUNCTION2_F9 = 0b10100000,
92 DCC_FEATURE_EXP_F13 = 0b11011110,
93 DCC_FEATURE_EXP_F21 = 0b11011111,
94 DCC_FEATURE_EXP_FNHI = 0b11011000,
95 DCC_BINARY_SHORT = 0b11011101,
96 DCC_BINARY_LONG = 0b11000000,
97 DCC_ANALOG_FN = 0b00111101,
99 DCC_PROG_READ1 = 0b11100100,
100 DCC_PROG_WRITE1 = 0b11101100,
101 DCC_PROG_READ4 = 0b11100000,
103 DCC_SVC_BIT_MANIPULATE = 0b01111000,
104 DCC_SVC_WRITE = 0b01111100,
105 DCC_SVC_VERIFY = 0b01110100,
106 DCC_SVC_MASK = 0b11111100,
108 DCC_SVC_BITVAL_WRITE = 0b11110000,
109 DCC_SVC_BITVAL_VERIFY = 0b11100000,
110 DCC_SVC_BITVAL_VALUE = 0b00001000,
111 DCC_SVC_BITVAL_MASK = 0b11110000,
113 DCC_SVC_PAGED_WRITE = 0b01111000,
114 DCC_SVC_PAGED_VERIFY = 0b01110000,
115 DCC_SVC_PAGED_MASK = 0b11111000,
118 DCC_BASIC_ACCESSORY_B1 = 0b10000000,
120 DCC_BASIC_ACCESSORY_MASK1 = 0b11000000,
122 DCC_BASIC_ACCESSORY_B2 = 0b10000000,
124 DCC_BASIC_ACCESSORY_MASK2 = 0b10000000,
126 DCC_EXT_ACCESSORY_B2 = 0b00000001,
128 DCC_EXT_ACCESSORY_MASK2 = 0b10001001,
131 DCC_BASIC_ACCESSORY_B2_ACTIVATE = 0b00001000,
133 DCC_BASIC_ACCESSORY_B2_DEACTIVATE = 0b00000000,
135 DCC_BASIC_ACCESSORY_B2_ACTIVATE_MASK = DCC_BASIC_ACCESSORY_B2_ACTIVATE,
137 DCC_BASIC_ACCESSORY_B2_THROWN = 0b00000000,
139 DCC_BASIC_ACCESSORY_B2_CLOSED = 0b00000001,
141 DCC_BASIC_ACCESSORY_B2_DIR_MASK = DCC_BASIC_ACCESSORY_B2_CLOSED,
144 DCC_EXT_SPEED = 0b00111111,
145 DCC_EXT_SPEED_FORWARD = 0x80,
155 DCC_LOGON_ENABLE_MASK = 0b11111100,
158 DCC_SELECT_MASK = 0b11110000,
165 DCC_LOGON_ASSIGN_MASK = 0b11110000,
175 CMD_READ_SHORT_INFO = 0b11111111,
176 CMD_READ_BLOCK = 0b11111110,
177 CMD_READ_BACKGROUND = 0b11111101,
178 CMD_WRITE_BLOCK = 0b11111100,
255 return binary + 2045;
bool decode_address_partition(uint16_t addr14, uint16_t *addr, uint8_t *partition, dcc::TrainAddressType *atype)
Decodes a 14-bit address (according to S-9.2.1.1) into an address type and a raw address.
LogonEnableParam
Parameters for the Logon Enable command.
@ NOW
All decoders respond and ignore backoff.
@ LOCO
Locomotive decoders only.
@ ALL
All decoders respond.
@ ACC
Accessory decoders only.
static unsigned accy_address_user_to_binary(unsigned user)
Convers a DCC basic or extended accessory decoder address from user address (1-2048) to binary addres...
TrainAddressType
Which address type this legacy train node uses.
@ UNSPECIFIED
Unspecified address type (default / match any).
@ UNSUPPORTED
Unsupported address type (e.g.
@ DCC_ACCY_EXT
DCC 11-bit extended accessory decoder address (user facing is 1 to 2048, internal is 0 to 2047).
@ DCC_SHORT_ADDRESS
DCC packets with short address (1..127)
@ DCC_ACCY_BASIC_OUTPUT
Per-output addressing of DCC basic accessories (user facing is 1 to 2048, internal is 0 to 2047)
@ MM
Marklin-motorola packets. Addresses 1..80 are supported.
@ DCC_LONG_ADDRESS
DCC packets with long address (128..~10000)
@ ADR_MASK
Mask for the address partition bits.
@ MASK_ACC_BASIC
Mask for 9-bit basic accessory decoder.
@ ADR_ACC_EXT
11-bit extended accessory decoder
@ ADR_MOBILE_LONG
14-bit mobile decoders
@ ADR_INVALID
This value, when given to a decoder, represents an invalid (unassignable) address.
@ DCC_GET_DATA_CONT
Get Data Continue command in the 254 address partition.
@ MAX_MOBILE_LONG
Maximum value of the first byte for a 14-bit mobile decoder.
@ DCC_LOGON_ENABLE
Logon enable in the 254 address partition.
@ ADDRESS_LOGON
Address partition used for logon features per S-9.2.1.1 and RCN-218.
@ ADR_MOBILE_SHORT
7-bit mobile decoders
@ ADR_MOBILE_SHORT_MASK
Mask for 7-bit mobile decoders.
@ DCC_DID_MAX
Maximum value of second byte for DID assigned packets.
@ DCC_LONG_ADDRESS_FIRST
Prefix for DCC long addresses (first byte).
@ ADR_ACC_BASIC
9-bit basic accessory decoder
@ DCC_SELECT
Select command in the 254 address partition.
@ MASK_ACC_EXT
Mask for 11-bit extended accessory decoder.
@ DCC_DID_MASK
Mask used for the DCC_DID packets primary command byte.
@ DCC_LOGON_ASSIGN
Logon Assign command the 254 address partition.
@ DCC_DID_MIN
Minimum value of second byte for DID assigned packets.
@ DCC_GET_DATA_START
Get Data Start command in the 254 address partition.
@ ADDRESS_EXT
Address partition used for advanced extended packets per S-9.2.1.1.
static unsigned accy_address_binary_to_user(unsigned binary)
Convers a DCC basic or extended accessory decoder address from a binary address (0 - 2047) to user ad...