Gerätetreiber-Blöcke
Ein Gerätetreiberblock ist eine spezialisierte Form des MATLAB®-Systemblocks, der benutzerdefinierten C/C++-Gerätetreibercode generiert, wenn er auf einem Arduino®-Hardwareboard bereitgestellt wird. Gerätetreiberblöcke bieten einfachen Zugriff auf Hardware-Board-Funktionen wie Kommunikationsprotokolle oder Hardware-Bibliotheken, auf die Sie mit Funktionen und Blöcken im Simulink® Support Package für Arduino-Hardware nicht zugreifen können.
Sie können einen Gerätetreiber-Block aus einer System object™-Vorlage entwickeln und den resultierenden Block mit anderen Benutzern teilen.
Funktionen
arduino.supportpkg.getAVRLibraryRoot | Get Arduino AVR library root directory path |
arduino.supportpkg.getAVRRoot | Get Arduino AVR file root path |
arduino.supportpkg.getBoardInfo | Get properties of Arduino board in active Simulink model |
arduino.supportpkg.getIDERoot | Get Arduino IDE file root path |
arduino.supportpkg.getLibraryRoot | Get Arduino library root directory path |
arduino.supportpkg.getSAMDLibraryRoot | Get Arduino SAMD library root directory path |
arduino.supportpkg.getSAMDRoot | Get Arduino SAMD file root path |
arduino.supportpkg.getSAMLibraryRoot | Get Arduino SAM library root directory path |
arduino.supportpkg.getSAMRoot | Get Arduino SAM file root path |
Themen
- Prerequisites for Developing Device Driver Blocks
Understand the system requirements and recommended skills to develop device driver blocks for Arduino hardware boards.
- Structure of Device Driver System Object
Learn more about device driver block concepts and operation.
- Simulation with Device Driver Blocks
Choose and implement a data simulation mode for device driver blocks.
- Sharing Device Driver Blocks with Other Users
Package and distribute your device driver blocks.
- Measure Servo Motor Shaft Angle Using Device Driver Block in Connected I/O
Enable Connected I/O on a Simulink System object block that contains hardware-specific code allowing access to hardware-specific features.
- Create a Digital Write Block
Create a Digital Write block using a System object.
- SCHRITT 1: Create a Project Folder
- SCHRITT 2: Write the Hardware-Specific C/C++ Code
- SCHRITT 3: Select a System Object Template
- SCHRITT 4: Specify the Initialization, Output, and Termination Behavior
- SCHRITT 5: Test System Object on MATLAB Command Line
- SCHRITT 6: Create the MATLAB System Block
- SCHRITT 7: Generate Code and Deploy the Model to the Hardware
- Create a Digital Read Block
Create a Digital Read block using a System object.
- SCHRITT 1: Create a Project Folder
- SCHRITT 2: Write the Hardware-Specific C/C++ Code
- SCHRITT 3: Select System Object Template
- SCHRITT 4: Specify the Initialization, Output, and Termination
- SCHRITT 5: Set Output Port Properties
- SCHRITT 6: Test System Object
- Create Block Mask
Create block masks for your device driver blocks.
- SCHRITT 1: Add Description for Users
- SCHRITT 2: Add Pin Number Property
- SCHRITT 3: Add Push Button to View Pin Map
- Create Custom Device Driver Block for Arduino Library
Create a custom device driver block for Arduino hardware.
- SCHRITT 1: Create Project and Libraries Folder
- SCHRITT 2: Write Hardware Specific C/C++ Code
- SCHRITT 3: Select System Object Template
- SCHRITT 4: Specify Initialization, Output, and Termination Behavior
- SCHRITT 5: Update Paths for Source and Header Files
- SCHRITT 6: Set Output Port Properties
- SCHRITT 7: Create MATLAB System Block
- SCHRITT 8: Generate Code and Deploy Model to Hardware