View source for Matlab/Simulink files
You do not have permission to edit this page, for the following reason:
You can view and copy the source of this page.
Return to Matlab/Simulink files.
You do not have permission to edit this page, for the following reason:
The action you have requested is limited to users in one of the groups: Administrators, Bureaucrats.
You can view and copy the source of this page.
Return to Matlab/Simulink files.
Creating a custom S-function block requires the addition of four files to the MatLAB/Simulink project.
File location: ./blockset/toolbox/STM32/blocks/sfcn_signal_tower.m
Each layer of the signal tower requires three input ports: one for each RGB color.
As there are four layers, a total of twelve input ports are created in the setup function.
Notice that the DataTtypeID of each port is set to 3, which means that the ports requires data of type uint8_T.
The range of a uint8_T variable is 0-255.
The S-function requires two dialog parameters:
This number of parameters is set by the following line of code:
block.NumDialogPrms = 2;
File location: .\blockset\toolbox\STM32\blocks\sfcn_signal_tower_chk.m
The Olimexino STM32 features two SPI channels. This function checks if there more than two signal tower blocks in the model and will generate an error message.
File location: .\blockset\toolbox\STM32\blocks\sfcn_signal_tower_mcb.m
File location: .\blockset\toolbox\STM32\blocks\tlc_csfcn_signal_tower.tlc