From ad0988d6efafffac2e3ea8dc3b95285ee90cdfa3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?TED=C3=BC?= Date: Mon, 4 Mar 2024 04:15:24 +0100 Subject: [PATCH] added tire data header --- Core/Inc/tire_data.h | 15 +++++++++++++++ Core/Src/HTPA_32x32d.c | 8 ++++---- 2 files changed, 19 insertions(+), 4 deletions(-) create mode 100644 Core/Inc/tire_data.h diff --git a/Core/Inc/tire_data.h b/Core/Inc/tire_data.h new file mode 100644 index 0000000..d24afce --- /dev/null +++ b/Core/Inc/tire_data.h @@ -0,0 +1,15 @@ +/** + * @file tire_data.h + * @brief Tire data for calibration of HTPA sensor + * @author Tim-Erik Düntzsch t.duentzsch@fasttube.de + * + * @date 27.03.2023 - first implementation (untested) + */ + +#ifndef INC_TIRE_DATA_H_ +#define INC_TIRE_DATA_H_ + +uint8_t epsilon = 94; // emissivity of 0.94 (tire rubber) + + +#endif /* INC_TIRE_DATA_H_ */ \ No newline at end of file diff --git a/Core/Src/HTPA_32x32d.c b/Core/Src/HTPA_32x32d.c index 2d01ccd..c5e7ae2 100644 --- a/Core/Src/HTPA_32x32d.c +++ b/Core/Src/HTPA_32x32d.c @@ -38,10 +38,10 @@ // I2C transmit delay #define I2C_MAX_DELAY 0xFFFFFFFF -I2C_HandleTypeDef i2c_handle; +I2C_HandleTypeDef* i2c_handle; // pointer to i2c handle HAL_StatusTypeDef i2c_return; // error handling maybe? -uint16_t blockData[128]; +uint8_t htpa_blockData[258]; // 2 bytes VDD / Ptat, 256 bytes MSB / LSB for 128 pixels /** * @brief Initialization of HTPA Sensor @@ -53,7 +53,7 @@ uint16_t blockData[128]; * @param *hi2c: Pointer to I2C Handle */ void HTPA_Init(I2C_HandleTypeDef *hi2c){ - i2c_handle = *hi2c; + i2c_handle = hi2c; // Berechnung für clk / sample aus I2C parametern? HTPA_WriteRegister(HTPA_SENSOR_CONFIG, 0x01); // Wakeup HTPA_WriteRegister(HTPA_SENSOR_TRIM_1, 0x0C); @@ -76,7 +76,7 @@ void HTPA_Init(I2C_HandleTypeDef *hi2c){ * @param block: select block of array half (0-3) * @param *pData[128]: pointer to 128 word array for read data */ -void HTPA_ReadBlock(uint8_t array_half, uint8_t block, uint16_t *pData[128]){ +void HTPA_ReadBlock(uint8_t array_half, uint8_t block, uint16_t *pData[256]){ uint8_t config = 0; config = (block << 4); // bit 5,4 block config |= 0x09; // bit 3 start | bit 1 wakeup