| | |
| | | #define XTRIM_ADDRESS (0x1E) |
| | | uint8_t module_power; |
| | | uint32_t power_temp,power_input; |
| | | uint8_t error_num; |
| | | int dwt_initialise(uint16_t config) |
| | | { |
| | | |
| | |
| | | while (DWT_DEVICE_ID != dw1000local.deviceID) // MP IC ONLY (i.e. DW1000) FOR THIS CODE |
| | | { |
| | | dw1000local.deviceID = dwt_readdevid() ; |
| | | error_num++; |
| | | if(error_num>100) |
| | | {break;} |
| | | } |
| | | |
| | | error_num=0; |
| | | _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 |
| | | dw1000local.deviceID = dwt_readdevid() ; |
| | | if(module_power>36) |
| | |
| | | * |
| | | * returns DWT_SUCCESS for success, or DWT_ERROR for error |
| | | */ |
| | | |
| | | int dwt_configure(dwt_config_t *config) |
| | | { |
| | | uint8_t nsSfd_result = 0; |
| | |
| | | uint8_t chan = config->chan ; |
| | | uint32_t regval ; |
| | | uint16_t reg16 = lde_replicaCoeff[config->rxCode]; |
| | | uint8_t prfIndex = dw1000local.prfIndex = config->prf - DWT_PRF_16M; |
| | | volatile uint8_t prfIndex = dw1000local.prfIndex = config->prf - DWT_PRF_16M; |
| | | uint8_t bw = ((chan == 4) || (chan == 7)) ? 1 : 0 ; // Select wide or narrow band |
| | | |
| | | dw1000local.chan = config->chan ; |
| | |
| | | */ |
| | | void dwt_forcetrxoff(void) |
| | | { |
| | | decaIrqStatus_t stat ; |
| | | // decaIrqStatus_t stat ; |
| | | uint8_t temp ; |
| | | uint32_t mask; |
| | | |
| | |
| | | */ |
| | | void dwt_setinterrupt(uint32_t bitmask, uint8_t enable) |
| | | { |
| | | decaIrqStatus_t stat ; |
| | | // decaIrqStatus_t stat ; |
| | | uint32_t mask ; |
| | | |
| | | // Need to beware of interrupts occurring in the middle of following read modify write cycle |