Fujitsu SK-AMAPOLLO-BASE-V11 Benutzerhandbuch - Seite 15

Blättern Sie online oder laden Sie pdf Benutzerhandbuch für Hauptplatine Fujitsu SK-AMAPOLLO-BASE-V11 herunter. Fujitsu SK-AMAPOLLO-BASE-V11 46 Seiten. Ambiq micro apollo 1 / 2 evaluation board

Fujitsu SK-AMAPOLLO-BASE-V11 Benutzerhandbuch
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):
#define APOLLOUART_ENABLED 1
#define APOLLOGPIO ENABLED 1
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:
#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))
{
c = ApolloUart_GetChar(UART);
ApolloUart_PutChar(UART,c);
}
}
}
© Fujitsu Electronics Europe GmbH
FEEU Ultra-Low-Power Apollo Evaluation Kit Platform
Chapter 2 Using the Hardware
- 15 -
//button SW1 is pressed
EEU-UG-2017120001-10