Simple Motor Control Example Application main file.
More...
|
static void | pwm_set (uint8_t new_setting) |
| Function for setting the PWM duty cycle. More...
|
|
static void | timer2_init (void) |
| Function for initializing the Timer 2 peripheral.
|
|
static void | gpiote_init (void) |
| Function for initializing the GPIO peripheral.
|
|
static void | ppi_init (void) |
| Function for initializing the PPI peripheral.
|
|
void | TIMER2_IRQHandler (void) |
| Function for handling the Timer 2 interrupt.
|
|
int | main (void) |
| Function for main application entry.
|
|
This file contains the source code for a sample application using PWM that could control a motor.
Use board setup A for this example.
#define PWM_OUTPUT_PIN_NUMBER (LED0) |
Pin number for PWM output.
#define TIMER_PRESCALER (4) |
Prescaler setting for timers.
#define LED_INTENSITY_HIGH (224U) |
#define LED_INTENSITY_LOW (32U) |
#define LED_INTENSITY_HALF (128U) |
Half intensity. Used to calculate timer parameters.
static void pwm_set |
( |
uint8_t |
new_setting | ) |
|
|
static |
- Parameters
-
[in] | new_setting | New duty cycle, where 128 results in 50% duty cycle. |