This package contains a guide that explains, in a step-by-step fashion, how to develop device driver blocks (blocks that perform target-specific functions when executed on a target platform).
Example drivers for:
-) Arduino digital output
-) Arduino digital input
-) Arduino analog output
-) Arduino encoder read
While the examples are built using the Arduino as the hardware platform (specifically relying on the Simulink Support Package for Arduino), the method applies to any other supported target.
The first part of the guide describes a method based on the S-Function builder, while the final part of the guide illustrates a method based on the MATLAB Function block (examples for the latter method are given in the zip file EML2.zip). Advantages and disadvantages of each method are discussed in the guide.
Finally, note that for MATLAB 2013b you will need to apply a fix for the S-Function builder to develop blocks with no input. To do so, go to the following page: http://www.mathworks.com/support/bugreports/1006532 , scroll down to the bottom, and follow the instructions therein.