Compare commits
	
		
			2 Commits
		
	
	
		
			82d4d1b36c
			...
			7f9e1bac35
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 7f9e1bac35 | |||
| ad0988d6ef | 
							
								
								
									
										15
									
								
								Core/Inc/tire_data.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								Core/Inc/tire_data.h
									
									
									
									
									
										Normal file
									
								
							@ -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_ */
 | 
			
		||||
@ -38,14 +38,13 @@
 | 
			
		||||
// 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?
 | 
			
		||||
 | 
			
		||||
uint8_t data_topBlock[256];
 | 
			
		||||
uint8_t data_botBlock[256];
 | 
			
		||||
uint8_t htpa_statusReg;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Initialization of HTPA Sensor
 | 
			
		||||
 * 
 | 
			
		||||
@ -56,7 +55,7 @@ uint8_t htpa_statusReg;
 | 
			
		||||
 * @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);
 | 
			
		||||
@ -80,7 +79,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
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user