Visible to Intel only — GUID: iga1430780235804
Ixiasoft
Visible to Intel only — GUID: iga1430780235804
Ixiasoft
1.8. Understanding the Hardware-Specific INSTANCE and INIT Macros
The INSTANCE macro creates the alt_dev structure, which represents the component instance. This macro creates unique component instance-specific data structures.
The INIT macro must perform the following tasks:
- Create mutual exclusion resources
- Install the component's ISR with alt_ic_isr_register()
The my_uart_driver example driver supports both the enhanced and the legacy HAL interrupt APIs. Supporting both APIs ensures that the driver can be used in combination with legacy drivers supporting only the legacy API. For information about supporting both APIs, refer to "Interrupt Service Routines" in the "Exception Handling" chapter in the Nios II Software Developer's Handbook.
- Register the alt_dev structure with alt_dev_reg()
- Enable interrupts