设备驱动模块
创建设备驱动模块以访问硬件板的特定功能
设备驱动模块是一种专用的 MATLAB System 模块,当部署到 ARM® Cortex®-A 派生的硬件板时,它会生成自定义 C/C++ 设备驱动代码。通过设备驱动模块可轻松访问硬件板功能,例如访问支持包中不提供的通信协议或硬件库。
您可以从 System object™ 模板开发设备驱动模块,然后与其他用户共享完成的模块。
主题
- Prerequisites
Learn the system requirements and recommended skills to develop device driver blocks for ARM Cortex-A based hardware boards.
- Structure of Device Driver System Object
Understand the concepts and operation of device driver blocks implemented using System object.
- 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.
- 创建 Digital Write 模块
使用 System object 创建 Digital Write 模块。
- 步骤 1: Create a Project Folder
- 步骤 2: Write the Hardware-Specific C/C++ Code
- 步骤 3: Select a System Object Template
- 步骤 4: Specify the Initialization, Output, and Termination Behavior
- 步骤 5: Test System Object on MATLAB Command Line
- 步骤 6: Create the MATLAB System Block
- 步骤 7: Generate Code and Deploy the Model to the Hardware
- 创建 Digital Read 模块
使用一个 System object 创建 Digital Read 模块。
- Block Mask
Create block masks for your device driver blocks.
- 步骤 1: Add Description for Users
- 步骤 2: Add Pin Number Property
- 步骤 3: Add Push Button to View Pin Map