Fujitsu SK-AMAPOLLO-BASE-V11 사용자 설명서 - 페이지 16
{카테고리_이름} Fujitsu SK-AMAPOLLO-BASE-V11에 대한 사용자 설명서을 온라인으로 검색하거나 PDF를 다운로드하세요. Fujitsu SK-AMAPOLLO-BASE-V11 46 페이지. Ambiq micro apollo 1 / 2 evaluation board
2.5 User Buttons
User buttons are connected as followed:
Figure 1-9: Buttons SW1 and SW2 at EVK-Apollo-Base
SW1 connects to GPIO28 and SW2 to GPIO17.
2.5.1 Drive buttons via GPIO
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 in you C-file. Following code gives
an example how to poll the GPIO:
#include "mcu.h"
#include "apollogpio.h"
int main(void)
{
ApolloGpio_GpioInputEnable(PIN_GPIO28,TRUE);
ApolloGpio_GpioInputEnable(PIN_GPIO17,TRUE);
while(1)
{
if (ApolloGpio_GpioIsSet(PIN_GPIO28)) //button SW1 is pressed
{
//do the script executing code
}
}
}
EEU-UG-2017120001-10
FEEU Ultra-Low-Power Apollo Evaluation Kit Platform
Chapter 2 Using the Hardware
- 16 -
//set GPIO28
//to input
//set GPIO17
//to input
© Fujitsu Electronics Europe GmbH