Example Software
To help you get started writing software for the Sapphire, Efinix provides a variety of example software code that performs functions such as communicating through the UART, controlling GPIO interrupts, performing Dhrystone benchmarking, etc. Each example includes a makefile and src directory that contains the source code.
Note: Many of these examples display messages on a UART. Refer to the following
topics for information on attaching a UART module and connecting to it in a terminal:
| Directory | Description |
|---|---|
| apb3Demo | This example shows how to implement an ABP3 slave. |
| Axi4Demo | This example illustrates how to implement a user AXI4 master. |
| bootloader | This software is the bootloader for the system. |
| common | Provides linking for the makefiles. |
| clintTimerInterruptDemo | This example shows how to use the clint timer with interrupt. |
| coremark | This example is a synthetic computing benchmark program. |
| customInstructionDemo | This example illustrates how to implement a custom instruction. |
| dCacheFlushDemo | This example illustrates how to invalidate the data cache. |
| dhrystone | This example is a synthetic computing benchmark program. |
| driver | This directory contains the system drivers for the peripherals (I2C, UART, SPI, etc.). Refer to API Reference for details. |
| FreeRTOS | This example shows the example software projects targeting the RTOS. |
| fpuDemo | This example shows how to use the floating-point unit. |
| gpioDemo | This example shows how to control the GPIO and its interrupt. |
| iCacheFlushDemo | This example illustrates how to invalidate the instruction cache. |
| inlineASMDemo | This example illustrates utilizing the inline assembly feature. |
| i2cDemo | This example shows how to connect to an MCP4725 digital-to-analog converter (DAC) using an I2C peripheral. |
| i2CEepromDemo | This example illustrates how to use I2C driver to communicate with the on-board EEPROM device, AT24C01 on either the T120F324 or T120F576 Development Kit. |
| i2cMasterDemo | This example illustrates how to effectively utilize the Sapphire SoC as an I2C master. |
| i2cMasterInterruptDemo | This example is based on the i2cMasterDemo for the Sapphire SoC, with an important enhancement on the timeout interrupt handling. |
| i2cSlaveDemo | This example illustrates how to effectively utilize the Sapphire SoC as an I2C slave. |
| memTest | This code performs a memory address and data test. |
| nestedInterruptDemo | This example shows how to set a higher priority to an interrupt routine, which allows the CPU to prioritize the task execution instead of other interrupts. |
| semihostingDemo | This examples shows how to use write and read debug messages through semihosting. |
| smpDemo | This example illustrates how to use multiple cores to execute the Tiny encryption algorithm in parallel. |
| spiDemo | This code reads the device ID and JEDEC ID of a SPI flash device and echoes the characters on a UART. |
| uartEchoDemo | This example shows how to use the UART. |
| uartInterruptDemo | This exmple shows how to use a UART interrupt. |
| userInterruptDemo | This example demonstrates user interrupts with UART messages. |
| userTimerDemo | This example shows how to use the user timer with interrupt. |