Nios II Classic Software Developer’s Handbook

ID 683282
Date 5/14/2015
Public
Document Table of Contents

7.7.6.5. Provide a Software Initialization Function

The *INSTANCE() macro inserts a pointer to your initialization function in the alt_iniche_dev structure.

For more information, refer to the “Provide *INSTANCE and *INIT Macros” chapter.

Your software initialization function must perform at least the following three tasks:

  • Initialize the hardware and verify its readiness
  • Finish initializing the alt_iniche_dev structure
  • Call get_mac_addr()

The initialization function must perform any other initialization your driver needs, such as creation and initialization of custom data structures and ISRs.

For more information about the get_mac_addr() function, refer to the "Ethernet and the NicheStack TCP/IP Stack - Nios II Edition" chapter.

For more information about an example of a software initialization function, refer to alt_avalon_lan91c111_init() in <SMSC path> /src/iniche/smsc91x.c.