support EF3Lite

This commit is contained in:
matt
2020-09-23 17:27:03 +08:00
parent a9a1664902
commit e8940d1a31
26 changed files with 3052 additions and 0 deletions
+126
View File
@@ -0,0 +1,126 @@
/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
#include "hal_api.h"
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
/* TODO include files */
#include "AppAirSpeed.h"
#endif
#include <stdint.h>
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define y_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
int pres_inited[4];
void initialize_pressure(uint8_t id)
{
switch (id)
{
case 0:
if (!pres_inited[0])
{
#ifdef HAL_IMPL
// TODO initialize pressure No.0
pres_inited[0] = 1;
#endif
}
break;
case 1:
if (!pres_inited[1])
{
#ifdef HAL_IMPL
// TODO initialize pressure No.0
pres_inited[1] = 1;
#endif
}
break;
case 2:
if (!pres_inited[2])
{
#ifdef HAL_IMPL
// TODO initialize pressure No.0
pres_inited[2] = 1;
#endif
}
break;
default:
break;
}
}
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Start function
*
*/
void hal_pressure_Start_wrapper(const uint8_T *id, const int_T p_width0)
{
/* %%%-SFUNWIZ_wrapper_Start_Changes_BEGIN --- EDIT HERE TO _END */
initialize_pressure(id[0]);
/* %%%-SFUNWIZ_wrapper_Start_Changes_END --- EDIT HERE TO _BEGIN */
}
/*
* Output function
*
*/
void hal_pressure_Outputs_wrapper(HAL_pressure_SI_t *pres,
int32_T *ErrorCode,
const uint8_T *id, const int_T p_width0)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
ErrorCode[0] = -1;
switch (id[0])
{
case 0:
if (pres_inited[0])
{
#ifdef HAL_IMPL
// TODO read pressure
AppQbarGetRawData(id[0], &pres->pressure, &pres->seq);
ErrorCode[0] = 0;
#endif
}
break;
case 1:
case 2:
case 3:
if (pres_inited[id[0]])
{
#ifdef HAL_IMPL
// TODO read pressure
AppBaroGetRawData(id[0], &pres->pressure, &pres->temperature, &pres->seq);
ErrorCode[0] = 0;
#endif
}
break;
default:
break;
}
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}