Skip to content
Snippets Groups Projects
Commit ac472f60 authored by Colin Wulf's avatar Colin Wulf
Browse files

dw1000: rewritten reset function, now soft reset

parent 72e4d64d
No related branches found
No related tags found
No related merge requests found
...@@ -21,18 +21,19 @@ TaskHandle_t xHandleDW1000HAL = NULL; ...@@ -21,18 +21,19 @@ TaskHandle_t xHandleDW1000HAL = NULL;
void dw1000Hal_reset(void) void dw1000Hal_reset(void)
{ {
GPIO_InitTypeDef GPIO_InitStruct; uint32_t subreg;
/*Configure GPIO pin : PD7 */ dw1000Hal_readSubRegister(PMSC_ID,PMSC_CTRL0_OFFSET,(uint8_t*)&subreg,PMSC_CTRL0_LEN);
GPIO_InitStruct.Pin = GPIO_PIN_7; subreg |= (1 << 0 );
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP; subreg &= ~(1 << 1);
GPIO_InitStruct.Speed = GPIO_SPEED_LOW; dw1000Hal_writeSubRegister(PMSC_ID,PMSC_CTRL0_OFFSET,(uint8_t*)&subreg,PMSC_CTRL0_LEN);
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); dw1000Hal_readSubRegister(PMSC_ID,PMSC_CTRL0_OFFSET,(uint8_t*)&subreg,PMSC_CTRL0_LEN);
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_7, GPIO_PIN_RESET); subreg &= ~(15 << 28);
GPIO_InitStruct.Pin = GPIO_PIN_7; dw1000Hal_writeSubRegister(PMSC_ID,PMSC_CTRL0_OFFSET,(uint8_t*)&subreg,PMSC_CTRL0_LEN);
GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
GPIO_InitStruct.Pull = GPIO_NOPULL; dw1000Hal_readSubRegister(PMSC_ID,PMSC_CTRL0_OFFSET,(uint8_t*)&subreg,PMSC_CTRL0_LEN);
HAL_GPIO_Init(GPIOD, &GPIO_InitStruct); subreg |= (15 << 28);
dw1000Hal_writeSubRegister(PMSC_ID,PMSC_CTRL0_OFFSET,(uint8_t*)&subreg,PMSC_CTRL0_LEN);
} }
void dw1000Hal_chipSelect(void) void dw1000Hal_chipSelect(void)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment