66 #define ADC_TEMPERATURE_FACTOR (10.0f)
122 {0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u};
126 {0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u, 0x0000u};
180 float temperature_degC = 0.0f;
189 return (10.0f * temperature_degC);
201 for (uint8_t i = 0u; i < 20u; i++) {
static float adc_adc0Voltage[4]
static uint16_t adc_txConvert[CONVERT_LENGTH]
#define ADC_TEMPERATURE_FACTOR
static float adc_adc1Voltage[4]
static uint16_t adc_txLockCommand[SINGLE_MESSAGE_LENGTH]
ADC_TEMPERATURE_SENSOR_TYPE
@ ADC1_TEMPERATURE_SENSOR
@ ADC0_TEMPERATURE_SENSOR
static uint16_t adc_txNull[SINGLE_MESSAGE_LENGTH]
void ADC_Control(void)
determines which ADC is measured and stores result in database.
static uint16_t adc_rxConvert[CONVERT_LENGTH]
enum ADC_TEMPERATURE_SENSOR_TYPE ADC_TEMPERATURE_SENSOR_TYPE_e
static uint8_t adc_conversionState
describes the current state of the conversion
void ADC_Initialize(void)
initializes the ADC devices. It is called during startup.
static uint16_t adc_txReadRegisterCommand[SINGLE_MESSAGE_LENGTH]
static uint16_t adc_txWakeupCommand[SINGLE_MESSAGE_LENGTH]
static float ADC_ConvertVoltagesToTemperatures(float v_adc_V, ADC_TEMPERATURE_SENSOR_TYPE_e TsensorType)
converts a raw voltage from ADC to a temperature value in Celsius.
static uint16_t adc_txUnlockCommand[SINGLE_MESSAGE_LENGTH]
static DATA_BLOCK_ADC_TEMPERATURE_s adc_tableTemperature
static uint16_t adc_rxReadSingleMessage[SINGLE_MESSAGE_LENGTH]
static uint16_t adc_txWriteRegisterCommand[SINGLE_MESSAGE_LENGTH]
static STD_RETURN_TYPE_e ADC_Transmit(uint32 blocksize, uint16 *pTxBuffer, uint16 *pRxBuffer, SPI_INTERFACE_CONFIG_s *pSpiInterface)
Headers for the driver for the ADC module.
#define ADC_NUMBER_OF_CHANNELS
#define ADC_HET1_RESET_PIN
#define SINGLE_MESSAGE_LENGTH
#define BS_NR_OF_TEMP_SENSORS_ON_ADC0
#define BS_NR_OF_TEMP_SENSORS_ON_ADC1
int16_t BETA_GetTemperatureFromBeta(uint16_t adcVoltage_mV)
returns temperature based on measured ADC voltage
Resistive divider used for measuring temperature.
#define DATA_READ_DATA(...)
#define DATA_WRITE_DATA(...)
@ DATA_BLOCK_ID_ADC_TEMPERATURE
int16_t TS_Epc00GetTemperatureFromLut(uint16_t adcVoltage_mV)
returns temperature based on measured ADC voltage
Resistive divider used for measuring temperature.
#define FAS_ASSERT(x)
Assertion macro that asserts that x is true.
#define FAS_TRAP
Define that evaluates to essential boolean false thus tripping an assert.
#define NULL_PTR
Null pointer.
enum STD_RETURN_TYPE STD_RETURN_TYPE_e
void IO_PinSet(volatile uint32_t *pRegisterAddress, uint32_t pin)
Set pin by writing in pin output register.
void IO_PinReset(volatile uint32_t *pRegisterAddress, uint32_t pin)
Set pin by writing in pin output register.
Header for the driver for the IO module.
STD_RETURN_TYPE_e SPI_TransmitReceiveData(SPI_INTERFACE_CONFIG_s *pSpiInterface, uint16 *pTxBuff, uint16 *pRxBuff, uint32 frameLength)
Transmits and receives data on SPI without DMA.
Headers for the driver for the SPI module.
SPI_INTERFACE_CONFIG_s spi_adc0Interface
SPI_INTERFACE_CONFIG_s spi_adc1Interface
int16_t temperatureAdc1_ddegC[BS_NR_OF_TEMP_SENSORS_ON_ADC1]
DATA_BLOCK_HEADER_s header
int16_t temperatureAdc0_ddegC[BS_NR_OF_TEMP_SENSORS_ON_ADC0]