46 uint8_t _partition = 0xff;
47 uint16_t _addr = 0xffffu;
49 addr14 &= (1u << 14) - 1;
50 uint8_t hibyte = addr14 >> 8;
53 _atype = TrainAddressType::DCC_LONG_ADDRESS;
59 _atype = TrainAddressType::DCC_ACCY_EXT;
65 _atype = TrainAddressType::DCC_ACCY_BASIC_OUTPUT;
71 _atype = TrainAddressType::DCC_SHORT_ADDRESS;
73 _addr = addr14 & 0x7f;
86 *partition = _partition;
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.