Files
slhal/template/hal_pwm_in_wrapper.c
T
2020-03-20 13:11:30 +08:00

86 lines
1.5 KiB
C

/*
* Include Files
*
*/
#if defined(MATLAB_MEX_FILE)
#include "tmwtypes.h"
#include "simstruc_types.h"
#else
#include "rtwtypes.h"
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
//#include "param_mgr.h"
#endif
/* %%%-SFUNWIZ_wrapper_includes_Changes_END --- EDIT HERE TO _BEGIN */
#define u_width 1
/*
* Create external references here.
*
*/
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
int is_pwm_in_init = 0;
void pwm_in_init()
{
if (!is_pwm_in_init)
{
//TODO
is_pwm_in_init = 1;
}
}
#endif
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
/*
* Start function
*
*/
void hal_pwm_in_Start_wrapper(void)
{
/* %%%-SFUNWIZ_wrapper_Start_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
pwm_in_init();
#endif
/* %%%-SFUNWIZ_wrapper_Start_Changes_END --- EDIT HERE TO _BEGIN */
}
/*
* Output function
*
*/
void hal_pwm_in_Outputs_wrapper(const uint16_T *start_idx,
uint16_T *pwm,
int32_T *ErrorCode,
const int_T y_width)
{
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
#ifdef HAL_IMPL
/*
* input *pwm* from pwm devices from *start_idx* to *start_idx*+y_width-1.
*
* ErrorCode - return zero on success, otherwise nonzero on failures.
*/
if (is_pwm_in_init)
{
// TODO set pwm outputs
ErrorCode[0] = 0;
return;
}
ErrorCode[0] = -1;
#else
ErrorCode[0] = 0;
#endif
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_END --- EDIT HERE TO _BEGIN */
}