Bloques de controlador de dispositivos
Un bloque de controlador de dispositivos es una forma especializada del bloque MATLAB System que genera código C o C++ de controlador de dispositivos personalizado cuando se implementa en una placa de hardware de Arduino®. Los bloques de controlador de dispositivos permiten a los usuarios acceder a funcionalidades de placas de hardware, como protocolos de comunicación o bibliotecas de hardware, que no están disponibles en Simulink® Support Package for Arduino Hardware.
Puede desarrollar este tipo de bloques a partir de una plantilla System object™ y compartir los bloques completados con otros usuarios.
Funciones
arduino.supportpkg.getAVRLibraryRoot | Get Arduino AVR library root directory path (desde R2020b) |
arduino.supportpkg.getAVRRoot | Get Arduino AVR file root path (desde R2020b) |
arduino.supportpkg.getBoardInfo | Get properties of Arduino board in active Simulink model (desde R2020b) |
arduino.supportpkg.getIDERoot | Get Arduino IDE file root path (desde R2020b) |
arduino.supportpkg.getLibraryRoot | Get Arduino library root directory path (desde R2020b) |
arduino.supportpkg.getSAMDLibraryRoot | Get Arduino SAMD library root directory path (desde R2020b) |
arduino.supportpkg.getSAMDRoot | Get Arduino SAMD file root path (desde R2020b) |
arduino.supportpkg.getSAMLibraryRoot | Get Arduino SAM library root directory path (desde R2020b) |
arduino.supportpkg.getSAMRoot | Get Arduino SAM file root path (desde R2020b) |
Temas
- Prerequisites for Developing Device Driver Blocks
Learn the system requirements and recommended skills to develop device driver blocks for Arduino hardware boards.
- Structure of Device Driver System Object
Understand the concepts and operation of device driver blocks implemented using a System object.
- Create a Digital Write Block
Create a Digital Write block using a System object.
- PASO 1: Create a Project Folder
- PASO 2: Write the Hardware-Specific C/C++ Code
- PASO 3: Select a System Object Template
- PASO 4: Specify the Initialization, Output, and Termination Behavior
- PASO 5: Test System Object on MATLAB Command Line
- PASO 6: Create the MATLAB System Block
- PASO 7: Generate Code and Deploy the Model to the Hardware
- Create a Digital Read Block
Create a Digital Read block using a System object.
- PASO 1: Create a Project Folder
- PASO 2: Write the Hardware-Specific C/C++ Code
- PASO 3: Select System Object Template
- PASO 4: Specify the Initialization, Output, and Termination
- PASO 5: Set Output Port Properties
- PASO 6: Test System Object
- Block Mask
Create block masks for your device driver blocks.
- PASO 1: Add Description for Users
- PASO 2: Add Pin Number Property
- PASO 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.
- PASO 1: Create Project and Libraries Folder
- PASO 2: Write Hardware Specific C/C++ Code
- PASO 3: Select System Object Template
- PASO 4: Specify Initialization, Output, and Termination Behavior
- PASO 5: Update Paths for Source and Header Files
- PASO 6: Set Output Port Properties
- PASO 7: Create MATLAB System Block
- PASO 8: Generate Code and Deploy Model to Hardware
- 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 a Device Driver Block in Connected I/O
A guide to enable Connected I/O on a Simulink System object block that contains hardware specific code allowing access to hardware specific features.