143 lines
4.2 KiB
Plaintext
143 lines
4.2 KiB
Plaintext
%% File : hal_sbus_in.tlc
|
|
%% Created : Tue Mar 24 14:55:05 2020
|
|
%%
|
|
%% Description:
|
|
%% Simulink Coder wrapper functions interface generated for
|
|
%% S-function "hal_sbus_in.c".
|
|
%%
|
|
%% File generated by S-function Builder Block
|
|
%%
|
|
%% For more information on using the Target Language with the
|
|
%% Simulink Coder, see the Target Language Compiler manual
|
|
%% (under Simulink Coder) in the "Inlining S-Functions"
|
|
%% chapter under the section and subsection:
|
|
%% "Writing Block Target Files to Inline S-Functions",
|
|
%% "Function-Based or Wrappered Code".
|
|
%%
|
|
%implements hal_sbus_in "C"
|
|
%% Function: BlockTypeSetup ===================================================
|
|
%%
|
|
%% Purpose:
|
|
%% Set up external references for wrapper functions in the
|
|
%% generated code.
|
|
%%
|
|
%function BlockTypeSetup(block, system) Output
|
|
|
|
%if IsModelReferenceSimTarget() || CodeFormat == "S-Function" || ::isRAccel
|
|
%assign hFileName = "hal_sbus_in_accel_wrapper"
|
|
%assign hFileNameMacro = FEVAL("upper", hFileName)
|
|
%openfile hFile = "%<hFileName>.h"
|
|
%selectfile hFile
|
|
#ifndef _%<hFileNameMacro>_H_
|
|
#define _%<hFileNameMacro>_H_
|
|
|
|
#include "tmwtypes.h"
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
extern void hal_sbus_in_Start_wrapper_accel(const uint8_T *id, const int_T p_width0);
|
|
extern void hal_sbus_in_Outputs_wrapper_accel(void *sbus, void *__sbusBUS,
|
|
int32_T *ErrorCode,
|
|
const uint8_T *id, const int_T p_width0);
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
#endif
|
|
%closefile hFile
|
|
|
|
%assign cFileName = "hal_sbus_in_accel_wrapper"
|
|
%openfile cFile = "%<cFileName>.c"
|
|
%selectfile cFile
|
|
#include <string.h>
|
|
#include "tmwtypes.h"
|
|
#include "hal_api.h"
|
|
|
|
void hal_sbus_in_Start_wrapper_accel(const uint8_T *id, const int_T p_width0){
|
|
hal_sbus_in_Start_wrapper(id, p_width0);
|
|
}
|
|
void hal_sbus_in_Outputs_wrapper_accel(void *sbus, void *__sbusBUS,
|
|
int32_T *ErrorCode,
|
|
const uint8_T *id, const int_T p_width0){
|
|
hal_sbus_in_Outputs_wrapper((HAL_sbus_in_t *) __sbusBUS,
|
|
ErrorCode,
|
|
id, p_width0);
|
|
|
|
%assign dTypeId = LibBlockOutputSignalDataTypeId(0)
|
|
%<SLibAssignUserStructToSLStruct(dTypeId, "(char *) sbus", "(*(HAL_sbus_in_t *) __sbusBUS)", 0)>
|
|
}
|
|
|
|
%closefile cFile
|
|
|
|
%<LibAddToCommonIncludes("%<hFileName>.h")>
|
|
%<LibAddToModelSources("%<cFileName>")>
|
|
|
|
%else
|
|
%openfile externs
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern void hal_sbus_in_Start_wrapper(const uint8_T *id, const int_T p_width0);
|
|
|
|
extern void hal_sbus_in_Outputs_wrapper(HAL_sbus_in_t *sbus,
|
|
int32_T *ErrorCode,
|
|
const uint8_T *id, const int_T p_width0);
|
|
|
|
extern void hal_sbus_in_Terminate_wrapper(const uint8_T *id, const int_T p_width0);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
%closefile externs
|
|
%<LibCacheExtern(externs)>
|
|
|
|
%endif
|
|
%%
|
|
%endfunction
|
|
|
|
|
|
%% Function: Start ============================================================
|
|
%%
|
|
%function Start(block, system) Output
|
|
/* %<Type> Block: %<Name> */
|
|
%assign nelements1 = LibBlockParameterSize(P1)
|
|
%assign param_width1 = nelements1[0] * nelements1[1]
|
|
%if (param_width1) > 1
|
|
%assign pp1 = LibBlockMatrixParameterBaseAddr(P1)
|
|
%else
|
|
%assign pp1 = LibBlockParameterAddr(P1, "", "", 0)
|
|
%endif
|
|
hal_sbus_in_Start_wrapper(%<pp1>, %<param_width1>);
|
|
%endfunction
|
|
%% Function: Outputs ==========================================================
|
|
%%
|
|
%% Purpose:
|
|
%% Code generation rules for mdlOutputs function.
|
|
%%
|
|
%function Outputs(block, system) Output
|
|
%%
|
|
%assign py0 = LibBlockOutputSignalAddr(0, "", "", 0)
|
|
%assign py1 = LibBlockOutputSignalAddr(1, "", "", 0)
|
|
%assign nelements1 = LibBlockParameterSize(P1)
|
|
%assign param_width1 = nelements1[0] * nelements1[1]
|
|
%if (param_width1) > 1
|
|
%assign pp1 = LibBlockMatrixParameterBaseAddr(P1)
|
|
%else
|
|
%assign pp1 = LibBlockParameterAddr(P1, "", "", 0)
|
|
%endif
|
|
|
|
%if IsModelReferenceSimTarget() || CodeFormat == "S-Function" || ::isRAccel
|
|
%assign sbusBUS_ptr = LibBlockDWorkAddr(sbusBUS, "", "", 0)
|
|
hal_sbus_in_Outputs_wrapper_accel(%<py0>, %<sbusBUS_ptr>, %<py1>, %<pp1>, %<param_width1>);
|
|
%else
|
|
hal_sbus_in_Outputs_wrapper(%<py0>, %<py1>, %<pp1>, %<param_width1>);
|
|
%endif
|
|
|
|
%%
|
|
%endfunction
|
|
|
|
|
|
%% [EOF] hal_sbus_in.tlc
|
|
|