86 lines
2.5 KiB
C
86 lines
2.5 KiB
C
/**
|
|
* @file flowmeter.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
|
|
*
|
|
*/
|
|
|
|
#ifndef FLOWMETER_H_
|
|
#define FLOWMETER_H_
|
|
/******************************************************************************
|
|
* Include Header Files
|
|
******************************************************************************/
|
|
#include <stdint.h>
|
|
#include "nms_types.h"
|
|
#include "adc.h"
|
|
/******************************************************************************
|
|
* Type declarations
|
|
******************************************************************************/
|
|
typedef struct
|
|
{
|
|
ADC_HandleTypeDef *adcHandle_pst;
|
|
float32 mKu_f32;
|
|
uint32 channel_u32;
|
|
float32 rawQ_f32;
|
|
} FlowmeterMain_st; /* HubaFlowmeter structure definition */
|
|
|
|
/******************************************************************************
|
|
* Macro Constant Declarations
|
|
******************************************************************************/
|
|
#define FLOWMETER_FM1_ADC_CHANNEL 6u
|
|
#define FLOWMETER_FM2_ADC_CHANNEL 7u
|
|
#define FLOWMETER_FM3_ADC_CHANNEL 8u
|
|
#define FLOWMETER_FM4_ADC_CHANNEL 9u
|
|
/******************************************************************************
|
|
* Extern Function Declarations
|
|
******************************************************************************/
|
|
/**
|
|
* @brief Init function of the Flowmeter module.
|
|
*
|
|
* @param flowmeter_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 Flow rate value.
|
|
*
|
|
*/
|
|
void FlowmeterInit(FlowmeterMain_st *flowmeter_pst, ADC_HandleTypeDef *adcHandle_pst, uint32 channel_u32);
|
|
|
|
/**
|
|
* @brief Function to get flow value
|
|
*
|
|
* @param flowmeter_pst : Pointer to main strucutre of the module.
|
|
*
|
|
* @return void
|
|
*
|
|
*/
|
|
void FlowmeterGetFlow(FlowmeterMain_st *flowmeter_pst);
|
|
|
|
/**
|
|
* @brief Function to Get Ku
|
|
*
|
|
* @param flowmeter_pst : Pointer to main strucutre of the module.
|
|
*
|
|
* @return Current value of Ku.
|
|
*
|
|
*/
|
|
float32 FlowmeterGetKu(FlowmeterMain_st *flowmeter_pst);
|
|
|
|
/**
|
|
* @brief Function to Set Ku.
|
|
*
|
|
* @param flowmeter_pst : Pointer to main strucutre of the module.
|
|
* @param ku_f : The Ku value to be set.
|
|
*
|
|
* @return void
|
|
*
|
|
*/
|
|
void FlowmeterSetKu(FlowmeterMain_st *flowmeter_pst, float32 ku_f32);
|
|
|
|
|
|
#endif /* FLOWMETER_H_ */
|