/*
 * tts.h
 *
 *  Created on: Jun 29, 2024
 *      Author: ted
 */

#ifndef INC_TTS_H_
#define INC_TTS_H_

#include "main.h"

typedef enum {
	TTS_FL,
	TTS_FR,
	TTS_RL,
	TTS_RR
} TTS_SensorID;

typedef enum {
	FT20e = 20,	// "lol" - TEDü
	FT20c = 21,
	FT22,
	FT23,
	FT24
} TTS_CarID;

typedef enum {
	UNKNOWN,
	OZ7_SLICKS,
	OZ7_RAIN,
	JP8_SLICKS
} TTS_TireID;

typedef struct {
	TTS_TireID id;					// Tire ID
	uint8_t epsilon;				// Emissivity [%]
	uint8_t outerLeftStart;			// First pixel of outer left zone
	uint8_t outerLeftStop;			// Last pixel of outer right zone
	uint8_t centerLeftStart;
	uint8_t centerLeftStop;
	uint8_t centerStart;
	uint8_t centerStop;
	uint8_t centerRightStart;
	uint8_t centerRightStop;
	uint8_t outerRightStart;
	uint8_t outerRightStop;
} TTS_TireData;

void TTS_Init(CAN_HandleTypeDef *hcan);
void TTS_LoadTireData(void);
void TTS_SendCAN(uint32_t tireZones[5]);
void TTS_TireZones(uint32_t tempArray[32], uint32_t tireTempArray[5]);

#endif /* INC_TTS_H_ */
