Fujitsu SK-AMAPOLLO-BASE-V11 Panduan Pengguna - Halaman 22
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
2.7.3 Using PWM
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 and skamapollobase.h in you
C-file. Following code gives an example how to use a PWM at D2:
#include "mcu.h"
#include "skamapollobase.h"
#include "apollogctimer.h"
int ain(void)
{
ApolloCTimer_PwmInitByGpio(ARDUINO_D2,TRUE);
ApolloCTimer_PwmSetDutyByGpio(ARDUINO_D2,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
- 22 -
//50% duty cycle
© Fujitsu Electronics Europe GmbH