[MOD] Added regdump function
This commit is contained in:
parent
907de02a79
commit
8ae092ac81
2 changed files with 23 additions and 1 deletions
|
@ -465,6 +465,19 @@ void Module::hexdump(uint8_t* data, size_t len) {
|
|||
}
|
||||
}
|
||||
|
||||
void Module::regdump(uint8_t start, uint8_t len) {
|
||||
#if defined(RADIOLIB_STATIC_ONLY)
|
||||
uint8_t buff[RADIOLIB_STATIC_ARRAY_SIZE];
|
||||
#else
|
||||
uint8_t* buff = new uint8_t[len];
|
||||
#endif
|
||||
SPIreadRegisterBurst(start, len, buff);
|
||||
hexdump(buff, len);
|
||||
#if !defined(RADIOLIB_STATIC_ONLY)
|
||||
delete[] buff;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Module::setRfSwitchPins(RADIOLIB_PIN_TYPE rxEn, RADIOLIB_PIN_TYPE txEn) {
|
||||
_useRfSwitch = true;
|
||||
_rxEn = rxEn;
|
||||
|
|
11
src/Module.h
11
src/Module.h
|
@ -382,10 +382,19 @@ class Module {
|
|||
|
||||
\param data Data to dump.
|
||||
|
||||
\param data Number of bytes to dump.
|
||||
\param len Number of bytes to dump.
|
||||
*/
|
||||
static void hexdump(uint8_t* data, size_t len);
|
||||
|
||||
/*!
|
||||
\brief Function to dump device registers as hex into the debug port.
|
||||
|
||||
\param start First address to dump.
|
||||
|
||||
\param len Number of bytes to dump.
|
||||
*/
|
||||
void regdump(uint8_t start, uint8_t len);
|
||||
|
||||
// hardware abstraction layer callbacks
|
||||
RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_PIN_MODE);
|
||||
RADIOLIB_GENERATE_CALLBACK(RADIOLIB_CB_ARGS_DIGITAL_WRITE);
|
||||
|
|
Loading…
Add table
Reference in a new issue