| | |
| | | int dwt_initialise(uint16_t config) |
| | | { |
| | | u32 power_temp,power_input; |
| | | u8 iderrortimes; |
| | | uint8_t plllockdetect = EC_CTRL_PLLLCK; |
| | | uint16_t otp_addr = 0; |
| | | uint32_t ldo_tune = 0; |
| | |
| | | |
| | | // Read and validate device ID return -1 if not recognised |
| | | dw1000local.deviceID = dwt_readdevid() ; |
| | | while (DWT_DEVICE_ID != dw1000local.deviceID) // MP IC ONLY (i.e. DW1000) FOR THIS CODE |
| | | while (DWT_DEVICE_ID != dw1000local.deviceID&&iderrortimes<100) // MP IC ONLY (i.e. DW1000) FOR THIS CODE |
| | | { |
| | | dw1000local.deviceID = dwt_readdevid() ; |
| | | iderrortimes++; |
| | | } |
| | | |
| | | _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 |