/**
 * @file	   analogMeasurement.h  
 *
 * @copyright  Nehemis SARL reserves all rights even in the event of industrial
 *             property rights. We reserve all rights of disposal such as
 *             copying and passing on to third parties.
 *
 * @brief	   ADC measurement module interface.
 *             This file provides function declarations and necessary definitions
 *             for reading analog sensor values using ADC with DMA. It defines
 *             ADC channel mappings, reference voltage, and resolution to ensure
 *             consistent data acquisition across multiple modules.
 *
 */
#ifndef ANALOGMEASUREMENT_H_
#define ANALOGMEASUREMENT_H_

/******************************************************************************
 * Include Header Files
 ******************************************************************************/
#include "nms_types.h"
/******************************************************************************
 * Type declarations
 ******************************************************************************/
#define PS1_ADC_CHANNEL		1u
#define PS2_ADC_CHANNEL		2u
#define PS3_ADC_CHANNEL		3u
#define PS4_ADC_CHANNEL		4u
#define PMP_ADC_CHANNEL		5u
#define FM1_ADC_CHANNEL		6u
#define FM2_ADC_CHANNEL		7u
#define FM3_ADC_CHANNEL		8u
#define FM4_ADC_CHANNEL		9u

#define ANALOG_MEAS_ADC_REF_VOLTAGE		3.3f
#define ANALOG_MEAS_ADC_RESOLUTION		4095.0f		/* 12-bit ADC */
/******************************************************************************
 * Extern Function Declarations
 ******************************************************************************/
/* @brief  initialize the ADC, calibrate and Start the ADC in DMA mode */
void AnalogMeasurementInit(void);

void AnalogMesaurementRun(void);

/**
 * @brief Reads the latest ADC value for the specified channel.
 *
 * @param channel_u32 	The ADC channel to read from.
 *        adcValue 		Pointer to store the retrieved ADC value.
 */
void AnalogMeasurementReadData(uint32 channel_u32, uint32 * adcValue_pu32);

#endif /* ANALOGMEASUREMENT_H_ */
