AT terminal for the mDot using the USB debug port instead of the serial port.
Dependencies: MTS-Serial libmDot-mbed5
Fork of Dot-AT-Firmware by
CommandTerminal/CmdDumpRegisters.cpp@18:f5d28d621bb0, 2018-03-02 (annotated)
- Committer:
- pferland
- Date:
- Fri Mar 02 20:01:38 2018 +0000
- Revision:
- 18:f5d28d621bb0
- Parent:
- 14:f9a77400b622
Added ability to force the AT terminal to use the USB debug port
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Mike Fiore |
14:f9a77400b622 | 1 | #include "CmdDumpRegisters.h" |
Mike Fiore |
14:f9a77400b622 | 2 | |
Mike Fiore |
14:f9a77400b622 | 3 | CmdDumpRegisters::CmdDumpRegisters() : Command("Dump Regs", "AT+DREGS", "Dump the SX1272 register values", "NONE") |
Mike Fiore |
14:f9a77400b622 | 4 | { |
Mike Fiore |
14:f9a77400b622 | 5 | } |
Mike Fiore |
14:f9a77400b622 | 6 | |
Mike Fiore |
14:f9a77400b622 | 7 | uint32_t CmdDumpRegisters::action(std::vector<std::string> args) |
Mike Fiore |
14:f9a77400b622 | 8 | { |
Mike Fiore |
14:f9a77400b622 | 9 | std::map<uint8_t, uint8_t> regs = CommandTerminal::Dot()->dumpRegisters(); |
Mike Fiore |
14:f9a77400b622 | 10 | |
Mike Fiore |
14:f9a77400b622 | 11 | CommandTerminal::Serial()->writef("\r\nSX1272 Register Dump:\r\n"); |
Mike Fiore |
14:f9a77400b622 | 12 | CommandTerminal::Serial()->writef("Addr\tData\r\n"); |
Mike Fiore |
14:f9a77400b622 | 13 | for (std::map<uint8_t, uint8_t>::iterator it = regs.begin(); it != regs.end(); it++) |
Mike Fiore |
14:f9a77400b622 | 14 | CommandTerminal::Serial()->writef("%2.2X -> %2.2X\r\n", it->first, it->second); |
Mike Fiore |
14:f9a77400b622 | 15 | |
Mike Fiore |
14:f9a77400b622 | 16 | return 0; |
Mike Fiore |
14:f9a77400b622 | 17 | } |
Mike Fiore |
14:f9a77400b622 | 18 |