Firmware version 2
This guide is for anyone who wants to use UART to program SwitchBlox but doesn't want to use switchblox-manager-software
.
Perfect for those who want to extend the functionality beyond what switchblox-manager-software
can bring.
The firmware works by reading values send over UART by a suitable UART client and storing them in a DMA buffer. Once 4 bytes of data have been stored in this buffer, this triggers a callback in the firmware which retrieves those bytes and performs actions on them.
The 4 bytes typically follow this pattern
0th index byte | 1 index byte | 2 index byte | 3 index byte |
---|---|---|---|
PHY | REG | Most significant byte in 16 bit register (15:8) | Lease significant byte in 16 bit register (7:0) |
You’ll notice that this is the data format for SMI (serial management interface).
PHY
= The port number that you want to write to OR one of addresses that correspond to global switch registers. PHY values 2,3,4,6,7 correspond to ports 0,1,2,3,4 respectively. However, PHY value 20 is the port mirroring register, which is a global switch register, not per port.
REG
= The actual register within that port.