wake up the sensor in STM #56
-
|
Hello! void wakeUp(uint8_t reg, uint8_t value){
uint8_t txBuf[2]={reg & ~0x80, value};
HAL_GPIO_WritePin(BME_CS_GPIO_Port, BME_CS_Pin, GPIO_PIN_RESET);
HAL_SPI_Transmit(&hspi1, txBuf,2,10);
HAL_GPIO_WritePin(BME_CS_GPIO_Port, BME_CS_Pin, GPIO_PIN_SET);
}in the main function: wakeUp(CTRL_HUM,valHUM);
wakeUp(CTRL_MEAS,valMEAS);and still not working... . I don't know if I am not using properly the HAL_SPI_Transmit function for writing in the corresponding registers or if it is something else. The full code is commited in the git repository in case it is needed. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Okay I was not selecting the CS pin correctly! |
Beta Was this translation helpful? Give feedback.
-
|
Glad to hear that you solved it 😉 |
Beta Was this translation helpful? Give feedback.
Okay I was not selecting the CS pin correctly!