| | |
| | | #define VTEMP_ADDRESS (0x09) |
| | | #define XTRIM_ADDRESS (0x1E) |
| | | uint8_t module_power; |
| | | uint8_t uwb_errorflag; |
| | | int dwt_initialise(uint16_t config) |
| | | { |
| | | uint32_t power_temp,power_input; |
| | | uint8_t plllockdetect = EC_CTRL_PLLLCK; |
| | | uint16_t otp_addr = 0; |
| | | uint32_t ldo_tune = 0; |
| | | |
| | | uint8_t uwb_error; |
| | | dw1000local.dblbuffon = 0; // Double buffer mode off by default |
| | | dw1000local.prfIndex = 0; // 16MHz |
| | | dw1000local.cdata.aatset = 0; // Auto ACK bit not set |
| | |
| | | while (DWT_DEVICE_ID != dw1000local.deviceID) // MP IC ONLY (i.e. DW1000) FOR THIS CODE |
| | | { |
| | | dw1000local.deviceID = dwt_readdevid() ; |
| | | uwb_error++; |
| | | if(uwb_error>10) |
| | | { |
| | | uwb_errorflag=1; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | _dwt_enableclocks(FORCE_SYS_XTI); // NOTE: set system clock to XTI - this is necessary to make sure the values read by _dwt_otpread are reliable |