4.2 Source Files

The source files are available through www.microchip.com.

The projects contain the following files:

  • Common files:
    • oled1_xpro_attiny817.h - Defines, and code to configure buttons and LEDs for the examples.
    • classb_error_handler.h - Error handler variable and error handler functions.
    • classb_compiler.h - Code to make Class B library work in both IAR and GCC.
  • Analog test:
    • classb_analog.h - Test of ADC, DAC, and Vref.
    • main_analog.c - Example code for the analog tests.
  • CRC test:
    • main_crc.c - Demo application for the CRC tests.
    • classb_crc.h - Defines for CRC test.
    • classb_crc_hw.h - Simple interface for the HW CRCSCAN module.
    • CRC_16bit_alg.h - Code for algorithm-based 16-bit CRC scan.
    • CRC_16bit_lookup.h - Code for 16-bit CRC scan performed by using a lookup-table.
    • CRC_32bit_alg.h - Code for algorithm-based 32-bit CRC scan.
    • CRC_32bit_lookup.h - Code for 32-bit CRC scan performed by using a lookup-table.
  • Frequency test:
    • classb_freq.h - Code for frequency test.
    • classb_rtc - RTC config code
    • main_frequency.c - Example code.
  • Interrupt monitor:
    • classb_interrupt_monitor.h. Code for interrupt monitor test.
    • main_interrupts.c - Example code.
  • Register test:
    • classb_cpu.h - Macros used for register test.
    • classb_cpu_gcc.c - Test code used when compiled by GCC.
    • classb_cpu_gcc_asm.s - Assembly code for GCC register tests.
    • classb_cpu_iar.c - Test code used when compiled by IAR.
    • classb_cpu_iar_asm.s - Assembly code for IAR register tests.
    • main_registers.c - Example code.
  • SRAM test:
    • classb_sram.c - MarchX test code.
    • classb_sram.h - Defines.
    • main_sram.c - Example code.
  • WDT test:
    • classb_wdt_test.c - WDT test function.
    • classb_wdt_test.h - Defines and attributes used to make the test run before initialization and before entering main.
    • main_wdt.c - Example code.
Note: Some of the *.h files contain function definitions. The reason for this is that GCC is then capable of optimizing the code more easily. This is especially the case with inline functions. When done this way it allows GCC to produce code optimization comparable to what the -flto optimization flag would give. One difference is that the -flto option will currently not preserve debug information. The -flto option will still give better code size in many cases. The -flto option combined with -Os gives size optimization that is in some cases comparable to IAR.