DW1000 UWB driver based on work of Matthias Grob & Manuel Stalder - ETH Zürich - 2015
DW1000Setup Class Reference
Class for holding DW1000 config options. More...
#include <DW1000Setup.h>
Public Types | |
enum | UWBMode { fastLocationC5, fastLocationC4, tunedDefault, user110k, rangeRateCompromise } |
Supported UWB modes. More... | |
enum | prf_e { prf16MHz, prf64MHz } |
enum for PRF options More... | |
enum | dataRate_e { kbps110, kbps850, kbps6800 } |
enum for data rate options More... | |
enum | sfd_e { standard, decaWave, user } |
enum for SFD options More... | |
enum | preamble_e { pre64, pre128, pre256, pre512, pre1024, pre1536, pre2048, pre4096 } |
enum for preamble length options More... | |
Public Member Functions | |
DW1000Setup (UWBMode modeToUse=tunedDefault) | |
Constructor. | |
DW1000Setup (DW1000Setup *orij) | |
copy constructor | |
void | applyConfig (DW1000Setup *orij) |
Update this config to match the supplied one. | |
bool | setSmartTxPower (float powerdBm, float power500us=0, float power250us=0, float power125us=0) |
Set the Transmit power for smartpower operation. | |
bool | setTxPower (float powerdBm, float powerPRF=0) |
Set the Transmit power for non-smartpower operation. | |
bool | setPRF (enum prf_e newSetting) |
Set the PRF. | |
bool | setChannel (unsigned char newChannel) |
Set the Channel. | |
bool | setSfd (enum sfd_e newSetting) |
Set the SFD. | |
bool | setPreambleLength (enum preamble_e newSetting) |
Set the Preamble length. | |
bool | setDataRate (enum dataRate_e newSetting) |
Set the Data rate. | |
bool | setPreambleCode (unsigned char newCode) |
Set the Preamble code. | |
bool | setSmartPower (bool enable) |
Set the smartpower state. | |
const float * | getTxPowers () |
Get the current transmit gains. | |
unsigned char | getChannel () |
Get the current channel. | |
enum prf_e | getPRF () |
Get the current PRF. | |
enum dataRate_e | getDataRate () |
Get the current data rate. | |
enum sfd_e | getSfd () |
Get the current SFD mode. | |
enum preamble_e | getPreambleLength () |
Get the current preamble length. | |
unsigned char | getPreambleCode () |
Get the current preamble code. | |
bool | getSmartPower () |
Get the current smart power mode. | |
void | setGPIO (uint16_t pins) |
Set which pins are GPIO. | |
uint16_t | getGPIO () |
Get which pins are GPIO. | |
bool | check () |
Check that the settings are self consistent. | |
void | getSetupDescription (char *buffer, int len) |
Get setup description. |
Detailed Description
Class for holding DW1000 config options.
Defaults are channel 5, 16MHz PRF, 850kb/s, standard SFD, 128 symbol preamble, preamble code 3. All pins are GPIO other than sync and IRQ. Smart power is off.
Definition at line 12 of file DW1000Setup.h.
Member Enumeration Documentation
enum dataRate_e |
enum for data rate options
- Enumerator:
kbps110 Data rate of 110kb/s (non-standard)
kbps850 Data rate of 850kb/s.
kbps6800 Data rate of 6.8Mb/s.
Definition at line 47 of file DW1000Setup.h.
enum preamble_e |
enum for preamble length options
- Enumerator:
Definition at line 63 of file DW1000Setup.h.
enum prf_e |
enum for PRF options
- Enumerator:
prf16MHz PRF rate of 16MHz. Lower power.
prf64MHz PRF rate of 64MHz. Higher power but more accurate timing.
Definition at line 42 of file DW1000Setup.h.
enum sfd_e |
enum for SFD options
To conform to the standard the standard setting should be used. The decawave setting claimes to give better performance. Doesn't work for me at 850kb/s but does at 6.8Mb/s
Definition at line 57 of file DW1000Setup.h.
enum UWBMode |
Supported UWB modes.
enum for preset mode combinations
- Enumerator:
Definition at line 20 of file DW1000Setup.h.
Constructor & Destructor Documentation
DW1000Setup | ( | UWBMode | modeToUse = tunedDefault ) |
Constructor.
- Parameters:
-
modeToUse The operating mode to set the initial settings to.
Definition at line 4 of file DW1000Setup.cpp.
DW1000Setup | ( | DW1000Setup * | orij ) |
copy constructor
Definition at line 64 of file DW1000Setup.cpp.
Member Function Documentation
void applyConfig | ( | DW1000Setup * | orij ) |
Update this config to match the supplied one.
Definition at line 77 of file DW1000Setup.cpp.
bool check | ( | ) |
Check that the settings are self consistent.
- Returns:
- true if the settings are valid
Will check the following:
- Preamble size is sensible for the data rate
- Preamble code is valid for the channel
- That smart power is only enabled at 6.8Mb/s
Definition at line 90 of file DW1000Setup.cpp.
unsigned char getChannel | ( | ) |
enum dataRate_e getDataRate | ( | ) |
uint16_t getGPIO | ( | ) |
Get which pins are GPIO.
- Returns:
- A bitmask of which pins are not to be used as GPIO
e.g. 0x01 Indicates that GPIO0 as it's alternative function (RXOKLED) and all other pins to be GPIO.
The default is 0x0180 - GPIO 8 = irq, GPIO 7 = sync. All others are GPIO functionality
Definition at line 244 of file DW1000Setup.h.
unsigned char getPreambleCode | ( | ) |
Get the current preamble code.
- Returns:
- the preamble code
Definition at line 214 of file DW1000Setup.h.
enum preamble_e getPreambleLength | ( | ) |
Get the current preamble length.
- Returns:
- the preamble length
Definition at line 208 of file DW1000Setup.h.
enum prf_e getPRF | ( | ) |
void getSetupDescription | ( | char * | buffer, |
int | len | ||
) |
Get setup description.
- Parameters:
-
buffer Data buffer to place description in len Length of data buffer
Places a text string describing the current setup into the suppled buffer.
Definition at line 174 of file DW1000Setup.cpp.
enum sfd_e getSfd | ( | ) |
bool getSmartPower | ( | ) |
Get the current smart power mode.
- Returns:
- true if smartpower is on
Definition at line 220 of file DW1000Setup.h.
const float* getTxPowers | ( | ) |
Get the current transmit gains.
- Returns:
- An array containing the power levels
An array of 4 floats is returned. For smart power these are the 4 power levels (normal, <500us, <250us, <125us). For non-smart power the first and last values are ignored, the second is the power for the phy header, the 3rd is the power for the reaminder of the frame.
Definition at line 176 of file DW1000Setup.h.
bool setChannel | ( | unsigned char | newChannel ) |
Set the Channel.
- Returns:
- true if a valid option
channels are 1-5 & 7
Definition at line 103 of file DW1000Setup.h.
bool setDataRate | ( | enum dataRate_e | newSetting ) |
void setGPIO | ( | uint16_t | pins ) |
Set which pins are GPIO.
- Parameters:
-
pins A bitmask of which pins are not to be used as GPIO
e.g. 0x01 sets GPIO0 as it's alternative function (RXOKLED) and all other pins to be GPIO.
The default is 0x0180 - GPIO 8 = irq, GPIO 7 = sync. All others are GPIO functionality
Definition at line 232 of file DW1000Setup.h.
bool setPreambleCode | ( | unsigned char | newCode ) |
Set the Preamble code.
- Returns:
- true if a valid option
- Note:
- Not all codes are valid for all channels, see the table below
channel | 16MHzPrf | 64MHzPrf |
---|---|---|
1 | 1, 2 | 9, 10, 11, 12 |
2 | 3, 4 | 9, 10, 11, 12 |
3 | 5, 6 | 9, 10, 11, 12 |
4 | 7, 8 | 17, 18, 19, 20 |
5 | 3, 4 | 9, 10, 11, 12 |
7 | 7, 8 | 17, 18, 19, 20 |
Definition at line 151 of file DW1000Setup.h.
bool setPreambleLength | ( | enum preamble_e | newSetting ) |
Set the Preamble length.
- Returns:
- true if a valid option
For 6.8Mb/s it should be 64 to 256 symbols. For 850kb/s it should be 256 to 2048 symbols For 110kb/s it should be >= 2048 symbols.
Definition at line 124 of file DW1000Setup.h.
bool setPRF | ( | enum prf_e | newSetting ) |
bool setSfd | ( | enum sfd_e | newSetting ) |
bool setSmartPower | ( | bool | enable ) |
Set the smartpower state.
- Returns:
- true if a valid option
only takes effect at 6.8Mb/s
Definition at line 163 of file DW1000Setup.h.
bool setSmartTxPower | ( | float | powerdBm, |
float | power500us = 0 , |
||
float | power250us = 0 , |
||
float | power125us = 0 |
||
) |
Set the Transmit power for smartpower operation.
- Parameters:
-
powerdBm The gain setting in dBm (0-33.5) power500us The gain setting packets under 500us in dBm (0-33.5) power250us The gain setting packets under 250us in dBm (0-33.5) power125us The gain setting packets under 125us in dBm (0-33.5)
- Returns:
- true if a valid option
Definition at line 227 of file DW1000Setup.cpp.
bool setTxPower | ( | float | powerdBm, |
float | powerPRF = 0 |
||
) |
Set the Transmit power for non-smartpower operation.
- Parameters:
-
powerdBm The gain setting in dBm for the main packet(0-33.5) powerPRF The gain setting in dBm for the preamble (0-33.5)
- Returns:
- true if a valid option
Definition at line 251 of file DW1000Setup.cpp.
Generated on Mon Jul 18 2022 07:51:56 by 1.7.2