3 Source Code Overview

The following sections describe peripherals, initialization of the SPI Interface, the polling mode functions and DataFlash/EEPROM Read/Program functions.

Peripherals:

  • CPU clock : (default) 3.33 MHz.
  • Peripherals used:
    • SPI
      • PA1: MOSI
      • PA2: MISO
      • PA3: SCK
      • PA4: SS

The project configured in Atmel | START generates peripheral driver functions and files, as well as a main() function that initializes all drivers.

  • Peripheral driver header and source files are in the src and include folder.
  • In the atmel_start.c file, the function atmel_start_init() initializes MCU, peripheral drivers and middleware in the project.
  • DataFlash driver files: dataflash.c, dataflash.h
  • EEPROM driver files: eeprom.c, eeprom.h