设备驱动程序模块
创建设备驱动程序模块以访问硬件板的特定功能
设备驱动程序模块是一种专用形式的 MATLAB System 模块,当部署到 Intel® SoC 设备时,它会生成自定义 C/C++ 代码。设备驱动程序模块使用户能够轻松访问硬件板的功能,如通信协议或硬件库,而这些功能在 Embedded Coder® Support Package for Intel SoC 设备 中没有提供。
本指南介绍了开发设备驱动程序模块的完整过程,包括从使用 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.
示例和操作指南
- Create a Digital Write Block
Create a Digital Write block using a System object.
- 步骤 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
- Create a Digital Read Block
Create a Digital Read block using a System object.
- 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