105 lines
1.9 KiB
C
105 lines
1.9 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 y_width 1
|
|
|
|
/*
|
|
* Create external references here.
|
|
*
|
|
*/
|
|
/* %%%-SFUNWIZ_wrapper_externs_Changes_BEGIN --- EDIT HERE TO _END */
|
|
#ifdef HAL_IMPL
|
|
|
|
void get_pwm0peroid(param_value_ptr_t p)
|
|
{
|
|
//TODO
|
|
p.I[0] =400u;
|
|
}
|
|
|
|
void set_pwm0peroid(param_value_ptr_t p)
|
|
{
|
|
uint32_t peroid_req;
|
|
peroid_req = p.I[0];
|
|
//TODO
|
|
}
|
|
|
|
int is_pwm_out_init = 0;
|
|
|
|
void pwm_out_init()
|
|
{
|
|
if (!is_pwm_out_init)
|
|
{
|
|
//TODO
|
|
param_prop p;
|
|
strncpy(p.name, "pwm_peroid_g0", 16);
|
|
p.val_ptr.s = NULL;
|
|
p.getter_ptr = &get_pwm0peroid;
|
|
p.setter_ptr = &set_pwm0peroid;
|
|
p.typ = PARAM_TYPE_UINT32;
|
|
param_mgr_regist(&p);
|
|
|
|
is_pwm_out_init = 1;
|
|
}
|
|
}
|
|
#endif
|
|
/* %%%-SFUNWIZ_wrapper_externs_Changes_END --- EDIT HERE TO _BEGIN */
|
|
|
|
/*
|
|
* Start function
|
|
*
|
|
*/
|
|
void hal_pwm_out_Start_wrapper(void)
|
|
{
|
|
/* %%%-SFUNWIZ_wrapper_Start_Changes_BEGIN --- EDIT HERE TO _END */
|
|
#ifdef HAL_IMPL
|
|
pwm_out_init();
|
|
#endif
|
|
/* %%%-SFUNWIZ_wrapper_Start_Changes_END --- EDIT HERE TO _BEGIN */
|
|
}
|
|
/*
|
|
* Output function
|
|
*
|
|
*/
|
|
void hal_pwm_out_Outputs_wrapper(const uint16_T *pwm,
|
|
const uint16_T *start_idx,
|
|
int32_T *ErrorCode,
|
|
const int_T u_width)
|
|
{
|
|
/* %%%-SFUNWIZ_wrapper_Outputs_Changes_BEGIN --- EDIT HERE TO _END */
|
|
#ifdef HAL_IMPL
|
|
/*
|
|
* output *pwm* to pwm devices from *start_idx* to *start_idx*+u_width-1.
|
|
*
|
|
* ErrorCode - return zero on success, otherwise nonzero on failures.
|
|
*/
|
|
if (is_pwm_out_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 */
|
|
}
|
|
|
|
|