Fujitsu SK-AMAPOLLO-BASE-V11 사용자 설명서 - 페이지 18
{카테고리_이름} Fujitsu SK-AMAPOLLO-BASE-V11에 대한 사용자 설명서을 온라인으로 검색하거나 PDF를 다운로드하세요. Fujitsu SK-AMAPOLLO-BASE-V11 46 페이지. Ambiq micro apollo 1 / 2 evaluation board
2.6 RBG LED
The user RGB LED is connected as followed:
Figure 1-10: RGB LED at EVK-Apollo-Base
Start with the FEEU MCU Temlate for Apollo 1 or Apollo 2. Enable CTIMER FEEU Low-
Level-Driver for Apollo in RTE_Device.h (in example\source\config):
#define APOLLOCTIMER_ENABLED 1
#define APOLLOGPIO_ENABLED
Add apolloctimer.c to your project and include apolloctimer.h in you C-file. Following code
gives an example how to use a PWM to dim a LED:
#include "mcu.h"
#include "apollogctimer.h"
int main(void)
{
ApolloCTimer_PwmInitByGpio(PIN_GPIO42,TRUE);
ApolloCTimer_PwmInitByGpio(PIN_GPIO43,TRUE); //set GPIO43
ApolloCTimer_PwmInitByGpio(PIN_GPIO46,TRUE); //set GPIO46 to
PWM
ApolloCTimer_PwmSetDutyByGpio(42,0.5f); //set red LED to
while(1)
{
__NOP();
}
}
EEU-UG-2017120001-10
FEEU Ultra-Low-Power Apollo Evaluation Kit Platform
Chapter 2 Using the Hardware
1
- 18 -
//set GPIO42
//to PWM
//to PWM
//50% duty cycle
© Fujitsu Electronics Europe GmbH