/*
 * pressureSensor.h
 *
 *  Created on: Dec 18, 2024
 *      Author: AniketSaha
 */

#ifndef PRESSURESENSOR_H_
#define PRESSURESENSOR_H_

/******************************************************************************
 * Include Header Files
 ******************************************************************************/
#include "nms_types.h"
#include <stdlib.h>
#include "adc.h"
/******************************************************************************
 * Type  declarations
 ******************************************************************************/
typedef struct
{
	ADC_HandleTypeDef *adcHandle_pst;
	uint32 channel_u32;
	float32 rawT_f32;
} PressureSensorMain_st;        /* HubaPressure sensor structure definition */

/******************************************************************************
 * Macro Constant Declarations
 ******************************************************************************/
#define PRESSURE_SENSOR_PS1_ADC_CHANNEL		1u
#define PRESSURE_SENSOR_PS2_ADC_CHANNEL		2u
#define PRESSURE_SENSOR_PS3_ADC_CHANNEL		3u
#define PRESSURE_SENSOR_PS4_ADC_CHANNEL		4u
/******************************************************************************
 * Extern Function Declarations
 ******************************************************************************/
/**
 * @brief     Init function of the Pressure sensor module.
 *
 * @param	  pressureSensor_pst   : Pointer to main strucutre of the module.
 * 			  adcHandle_pst        : ADC handler f the flowmeter.
 * 			  channel_u32	  	   : ADC channel of the connected sensor to use.
 *
 * @return	  Pressure value.
 *
 */
void PressureSensorInit(PressureSensorMain_st *pressureSensor_pst,
		ADC_HandleTypeDef *adcHandle_pst, uint32 channel_u32);

/**
 * @brief     Function to get pressure value.
 *
 * @param	  pressureSensor_pst : Pointer to main strucutre of the module.
 *
 * @return	  void
 *
 */
void PressureSensorGetVal(PressureSensorMain_st *pressureSensor_pst);

#endif /* PRESSURESENSOR_H_ */
