FEEU Ultra-Low-Power Apollo Evaluation Kit Platform
Chapter 2 Using the Hardware
EEU-UG-2017120001-10
- 20 -
© Fujitsu Electronics Europe GmbH
2.7.1 Using Digital IO
Digital IOs are available as A0…5 and D0..D13 and D18..19. Digital IOs can be also directly
addressed by using GPIO0..49.
The Naming is: ARDUINO_A<x>, ARDUINO_D<y> or PIN_GPIO<z>
Start with the FEEU MCU Temlate for Apollo 1 or Apollo 2. Enable GPIO FEEU Low-Level-
Driver for Apollo in
RTE_Device.h
(in
example\source\config
):
Add
apollogpio.c
to your project and include
apollogpio.h
and
skamapollobase.h
in you C-
file. Following code gives an example how to poll the GPIO:
#define APOLLOGPIO ENABLED 1
#include "mcu.h"
#include "skamapollobase.h"
#include "apollogpio.h"
int main(void)
{
ApolloGpio_GpioInputEnable(ARDUINO_D0,TRUE);
ApolloGpio_GpioOutputEnable(ARDUINO_D1,TRUE);
while(1)
{
if (ApolloGpio_GpioIsSet(ARDUINO_D0))
{
ApolloGpio_GpioSet(ARDUINO_D1);
}
else
{
ApolloGpio_GpioClear(ARDUINO_D1);
}
}
}