Specifications

Figure 7-1: Example Device Driver File Hierarchy and Naming
Hardware system generation files
custom_component_sw.tcl
custom_component_regs.h
HAL
inc
custom_component
inc
custom_component.h
Additional header files
src
component.mk
driver_source_file.c
Additional source files
Note: "inc" - Contains header file(s) that define the device hardware interfaces. Contents in this directory
are not HAL-specific and apply to a driver, regardless of whether it is based on the HAL,
MicroC/OS-II, or any other RTOS environment.
Note: "HAL" - Contains software files required to integrate the device with the Nios II hardware abstrac‐
tion layer. Files in this directory pertain specifically to the HAL.
Tcl Command Walkthrough for a Typical Driver or Software Package
The Tcl script excerpts in this section describe a typical device driver or software package.
The example in this section creates a device driver for a hardware peripheral whose component class
name is my_custom_component. The driver supports both HAL and MicroC/OS-II BSP types. It has a
single C source file (.c) and two C header files (.h).
7-20
Tcl Command Walkthrough for a Typical Driver or Software Package
NII5V2
2015.05.14
Altera Corporation
Developing Device Drivers for the Hardware Abstraction Layer
Send Feedback