Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Custom Driver

Procedures for creating custom driver blocks

Because of the unique requirements of your board, you can be required to write a custom driver for your board. To write a custom driver for your board, see Custom Simulink Real-Time Drivers.

Functions

slrtdrivertool Construct skeleton for custom driver

C/C++ API

xpcPCIDevice Type definition for PCI configuration space structure
xpcTime Type definition of time structure
xpcAllocPhysicalMemory Allocate physical memory
xpcBusyWait Wait for specified length of time in seconds
xpcFreePhysicalMemory Free physical memory
xpcGetElapsedTime Return time since system boot
xpcGetPCIDeviceInfo Return information for PCI device
xpcInpB Read 8-bit data from data register
xpcInpW Read 16-bit data from data register
xpcInpDW Read 32-bit data from data register
xpcIsModelInit Return real-time application load state
xpcOutpB Write 8-bit data to data register
xpcOutpW Write 16-bit data to data register
xpcOutpDW Write 32-bit data to data register
xpcReserveMemoryRegion Return virtual address that corresponds to physical address and mark region as readable/writable
xpcShowPCIDeviceInfo Display contents of PCIDevice structure
xpcSubtractTime Return difference between two times

Topics

Before You Start

Collecting the bus, I/O, and register requirements for the custom board.

S-Function Guidelines

Writing an S-function for a custom driver.

Accessing Registers

Read and write I/O space and memory-mapped registers for your driver.

Creating a Custom Driver

Create a generic device driver block.

Preparations for Debugging

Debug your device driver.

Was this topic helpful?