Hello,
In deca_device_api.h we find
#define DW3000_CHIP_FREQ 499200000
#define DW3000_CHIP_PER_DTU 2
#define DW3000_DTU_FREQ (DW3000_CHIP_FREQ / DW3000_CHIP_PER_DTU)
#define DTU_TO_US(x) (int)((uint64_t)(x)*1000000 / DW3000_DTU_FREQ)
I tried to use DTU_TO_US, but it gives a wrong result. In my understanding DTU_TO_US should be:
#define DTU_TO_US(x) ((x)*DWT_TIME_UNITS * 1000000.0)
with DWT_TIME_UNITS (1.0 / 499.2e6 / 128.0) //!< = 15.65e-12 s
Is the define wrong?