How to Specify the Target of Code Generation
Description of how to specify a target by placing the model inside a super block with the Target parameter.
To generate custom code for different targets, select the code generation GUI option Custom wrapper. The specific target is not defined in the GUI. This information must be provided by the model. A Wrapper block does not specify or even know, its target (i.e., which code generator is being used). In fact, the same Wrapper block can be used by multiple code generators for different targets. So, using Wrapper blocks from a library does not specify the target either.
To specify the target, the model should be placed inside a super block with a parameter called Target. This parameter defines the name of the target, which defines the code generator function to be used when the super block is selected for code generation with the Custom wrapper option.

In this case, all Wrapper blocks placed inside the super block will be used for code generation for target RaspberryPi. Every target library must include such a super block.
The base frequency defines the frequency of the main loop in main. All SampleCLK frequencies used inside the super block must be a divisor of the Base frequency.
In addition to the main loop, activations through interrupts can also be defined inside the super block. Each interrupt itself is defined using a special super block, which defines the type and properties of the interrupt. Wrapper blocks placed inside interrupt super blocks are activated by the corresponding interrupts.

If the target super block does not contain any blocks other than the interrupt super blocks, the main loop in main.c will be empty. All the activations will be handled through interrupts. In particular, all the wrapper blocks inside interrupt_0 will be activated by interrupt 0, and the Wrapper blocks inside interrupt_1 will be activated by interrupt 1. If Wrapper blocks are added outside the interrupt super blocks, their activations will be handled by the main loop.
When a library is developed for a new custom target, the target super block should be made available in the library palette (not inlined). The super block can include the interrupt super blocks, already properly parametrized (inlined).