| | |
| | | */ |
| | | |
| | | #include "dps310.h" |
| | | |
| | | #include "main.h" |
| | | /* Meaningful Default Configuration */ |
| | | #define IFX_DPS310_TEMPERATURE_OSR OSR_2 |
| | | #define IFX_DPS310_PRESSURE_OSR OSR_64 |
| | |
| | | |
| | | if (ret < IFX_DPS310_PSR_TMP_READ_LEN) |
| | | return -EINVAL; |
| | | |
| | | HAL_GPIO_WritePin(LED1_G_GPIO_Port, LED1_G_Pin, GPIO_PIN_RESET); |
| | | press_raw = (read_buffer[2]) + (read_buffer[1]<<8) + (read_buffer[0] <<16); |
| | | temp_raw = (read_buffer[5]) + (read_buffer[4]<<8) + (read_buffer[3] <<16); |
| | | |
| | |
| | | temp_scaled * drv_state->calib_coeffs.C01 + |
| | | temp_scaled * press_scaled * ( drv_state->calib_coeffs.C11 + |
| | | press_scaled * drv_state->calib_coeffs.C21 ); |
| | | |
| | | HAL_GPIO_WritePin(LED1_G_GPIO_Port, LED1_G_Pin, GPIO_PIN_SET); |
| | | press_final = press_final * 0.01f; //to convert it into mBar |
| | | |
| | | *temperature = temp_final; |