FEEU Ultra-Low-Power Apollo Evaluation Kit Platform
Chapter 2 Using the Hardware
EEU-UG-2017120001-10
- 22 -
© Fujitsu Electronics Europe GmbH
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
):
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:
#define APOLLOCTIMER_ENABLED 1
#define APOLLOGPIO_ENABLED 1
#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
//50% duty cycle
while(1)
{
__NOP();
}
}