Microchip® Advanced Software Framework

pwm_led_example.c File Reference

PWM LED example for SAM.

Copyright (c) 2011-2018 Microchip Technology Inc. and its subsidiaries.

#include "asf.h"
#include "stdio_serial.h"
#include "conf_board.h"
#include "conf_clock.h"

Macros

#define INIT_DUTY_VALUE   0
 Initial duty cycle value. More...
 
#define PERIOD_VALUE   100
 Period value of PWM output waveform. More...
 
#define PWM_FREQUENCY   1000
 PWM frequency in Hz. More...
 
#define STRING_EOL   "\r"
 
#define STRING_HEADER
 

Functions

static void configure_console (void)
 Configure the Console UART. More...
 
int main (void)
 Application entry point for PWM with LED example. More...
 
void PWM_Handler (void)
 Interrupt handler for the PWM controller. More...
 

Variables

pwm_channel_t g_pwm_channel_led
 PWM channel instance for LEDs. More...
 

#define INIT_DUTY_VALUE   0

Initial duty cycle value.

Referenced by main(), and PWM_Handler().

#define PERIOD_VALUE   100

Period value of PWM output waveform.

Referenced by main(), and PWM_Handler().

#define PWM_FREQUENCY   1000

PWM frequency in Hz.

Referenced by main(), and PWM_Handler().

#define STRING_EOL   "\r"
#define STRING_HEADER
Value:
"-- PWM LED Example --\r\n" \
"-- "BOARD_NAME" --\r\n" \
"-- Compiled: "__DATE__" "__TIME__" --"STRING_EOL
#define STRING_EOL
Definition: pwm_led_example.c:76
#define BOARD_NAME
Definition: fatfs_access_example.c:112

Referenced by main().

static void configure_console ( void  )
static

Configure the Console UART.

References uart_rs232_options::baudrate, stdio_serial_init(), and sysclk_enable_peripheral_clock().

Referenced by main().

void PWM_Handler ( void  )

pwm_channel_t g_pwm_channel_led

PWM channel instance for LEDs.