How to port AD594x Firmware Examples to other Micro controller Families
The AD594x example projects are written for the ADuCM3029 micro controller. There are also examples written for the NUCLEO-F411RE board. The example projects are designed to be easily ported to other micro controllers. This document details the steps involved.
Source Code Structure
This section describes the file structure for the firmware examples. The following image is a capture from the AD5940_BIA example project opened in Keil IDE.
AD5940Lib
Application
main.c
AD5940Main.c
BodyImpedance.c
This file handles the core measurement sequences including sequencer configuration, reading data from the
FIFO and processing the data. This file does not need to be modified when porting to a new MCU.
CMSIS
Device
Porting Functions in ADICUP3029Port.c
The main port file between the MCU and AD5940 is the ADICUP3029Port.c file. The following are the main functions and their purpose:
AD5940_CsSet(void)
This function sets the
GPIO pin connected to the AD5940 CS pin high.
AD5940_RstSet(void)
This function drives the
GPIO connected to the AD5940 reset pin high.
AD5940_RstClr(void)
This function drives the
GPIO pin connected the AD5940 reset pin low to initiate a hardware reset
AD5940_Delay10us(uint32_t time)
AD5940_GetMCUIntFlag(void)
AD5940_ClrMCUIntFlag(void)
AD5940_MCUResourceInit(void *pCfg)
Ext_Int0_Handler()
Porting Functions in main.c
The main.c file only implements 2 functions: