3 Software Structure

Opened with IAR Embedded Workbench®, the DALI2.0 SLAVE STACK example project tree view should look like the screen-shot in the figure below. Refer to Get Source Code from Atmel | START for more details.
Figure 3-1. DALI 2.0 Slave Project Tree

Due to the code size limitation of the MCU, an Atmel Studio package is not created.

The content of the folders are:
  • dali_slave:
    Provides the DALI application and stack files.
    • dali_bit, dali_bod, dali_eeprom and dali_timer

      These folders contain the application files for the DALI stack.

      • dali_bit

        DALI bits are decoded and encoded here. EXTINT (External Interrupt) peripheral is used for decoding.

      • dali_bod

        When power-down is detected, DALI slave will shut down PWM and LED to save power before Reset. The BOD interrupt deals with this detection.

      • dali_eeprom

        When the update flag rises for persistent memory, the EEPROM will update its corresponding contents. A backup page is utilized to avoid incomplete data copy during the system power-down. When the system powers on, the variables will be loaded from EEPROM to SRAM.

      • dali_timer

        System timers are provided here. They are used for DALI bit, frame, and fade timing, PWM and random address seeds.

    • dali_stack
      The DALI stack is located in this folder.
      • dali_frame

        Provides the DALI frame process files.

      • dali_cmd

        Provides the DALI command implementation files.

      • dali_hal

        Hardware abstraction layer, including a complete set of APIs for using hardware resources by DALI stack that is convenient for rapid design-in and smooth integration with varied peripherals.