Fujitsu SK-AMAPOLLO-BASE-V11 Panduan Pengguna - Halaman 20

Jelajahi secara online atau unduh pdf Panduan Pengguna untuk Motherboard Fujitsu SK-AMAPOLLO-BASE-V11. Fujitsu SK-AMAPOLLO-BASE-V11 46 halaman. Ambiq micro apollo 1 / 2 evaluation board

Fujitsu SK-AMAPOLLO-BASE-V11 Panduan Pengguna

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):
#define APOLLOGPIO ENABLED 1
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:
#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);
}
}
}
EEU-UG-2017120001-10
FEEU Ultra-Low-Power Apollo Evaluation Kit Platform
Chapter 2 Using the Hardware
- 20 -
© Fujitsu Electronics Europe GmbH