Device Driver Blocks
A device driver block is a specialized form of the MATLAB System block that generates custom C/C++ device driver code when deployed to a Raspberry Pi™ hardware board. Device driver blocks provide easy access to hardware board features, such as communication protocols or hardware libraries, that are not included in the default Simulink Support Package for Raspberry Pi Hardware.
You can develop a device driver block from a template System object™ and then share the completed blocks with other users.
Learn the system requirements and recommended skills to develop device driver blocks for Raspberry Pi hardware boards.
Understand the concepts and operation of device driver blocks implemented using System object.
Create a Digital Write block using a System object.
- STEP 1: Create a Project Folder
- STEP 2: Write the Hardware Specific C/C++ Code
- STEP 3: Select a System Object Template
- STEP 4: Specify the Initialization, Output, and Termination Behavior
- STEP 5: Test System Object on MATLAB Command Line
- STEP 6: Create the MATLAB System Block
- STEP 7: Generate Code and Deploy the Model to the Hardware
Create a Digital Read block using a System object.
- STEP 1: Select System Object Template
- STEP 2: Specify the Initialization, Output, and Termination
- STEP 3: Set Output Port Properties
- STEP 4: Test System Object
Create block masks for your device driver blocks.
- STEP 1: Add Description for Users
- STEP 2: Add Pin Number Property
- STEP 3: Add Push Button to View Pin Map
Choose and implement a data simulation mode for device driver blocks.
Package and distribute your device driver blocks.