FEEU Ultra-Low-Power Apollo Evaluation Kit Platform
Chapter 2 Using the Hardware
© Fujitsu Electronics Europe GmbH
- 15 -
EEU-UG-2017120001-10
Start with the FEEU MCU Temlate for Apollo 1 or Apollo 2. Enable UART FEEU Low-Level-
Driver for Apollo in
RTE_Device.h
(in
example\source\config
):
Add
apollouart.c
and
apollogpio.c
to your project and include
apollouart.h and apollogpio.h
in
you C-file. Following code gives an example how to poll the UART:
#define APOLLOUART_ENABLED 1
#define APOLLOGPIO ENABLED 1
#include "mcu.h"
#include "apollogpio.h"
#include "apollouart.h"
#ifdef APOLLO2_H
#define UART UART1
#endif
int main(void)
{
char c;
#ifdef APOLLO2_H
ApolloGpio_GpioSelectFunction(PIN_GPIO1,2); //use UART at GPIO1
ApolloGpio_GpioSelectFunction(PIN_GPIO2,2); //use UART at GPIO2
#else
ApolloGpio_GpioSelectFunction(PIN_GPIO0,2); //use UART at GPIO0
ApolloGpio_GpioSelectFunction(PIN_GPIO1,2); //use UART at GPIO1
#endif
ApolloUart_Init(UART,115200);
ApolloUart_PutString(“Hello World!\r\n”);
while(1)
{
if (ApolloUart_HasChar(UART)) //button SW1 is pressed
{
c = ApolloUart_GetChar(UART);
ApolloUart_PutChar(UART,c);
}
}
}