Microchip® Advanced Software Framework

uc3-l0_xplained_demo.c File Reference

UC3-L0 Xplained demo application that reads the board temperature sensor and changes the color of the board RGB LED based on touch input.

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

#include "compiler.h"
#include "board.h"
#include "gpio.h"
#include "sysclk.h"
#include "scif_uc3l.h"
#include "power_clocks_lib.h"
#include "pm_uc3l.h"
#include "flashcdw.h"
#include "adcifb.h"
#include "pwma.h"
#include "print_funcs.h"
#include "usart.h"
#include "uc3-l0_xplained_demo.h"

Functions

static void init_adc (void)
 Initialize ADC driver to read the board temperature sensor. More...
 
static void init_pwm (void)
 Initializes the PWM subsystem ready to generate the RGB LED PWM waves. More...
 
static void init_usart (void)
 Initializes the USART. More...
 
int main (void)
 Application main loop. More...
 

static void init_adc ( void  )
static

Initialize ADC driver to read the board temperature sensor.

Initializes the board's ADC driver module and configures the ADC channel connected to the onboard NTC temperature sensor ready for conversions.

References adcifb_channels_enable(), adcifb_configure(), adcifb_configure_trigger(), gpio_enable_module_pin(), adcifb_opt_t::resolution, and sysclk_enable_peripheral_clock().

Referenced by main().

static void init_pwm ( void  )
static

Initializes the PWM subsystem ready to generate the RGB LED PWM waves.

Initializes the on-chip PWM module and configures the RGB LED PWM outputs so the the brightness of the three individual channels can be adjusted.

References scif_gclk_opt_t::clock_source, EXAMPLE_PWMA_FREQUENCY, EXAMPLE_PWMA_GCLK_FREQUENCY, gpio_enable_module_pin(), PWM_CHANNEL_BLUE, PWM_CHANNEL_GREEN, PWM_CHANNEL_RED, pwma_config_enable(), pwma_set_channels_value(), SCIF_GCCTRL_CPUCLOCK, scif_start_gclk(), and sysclk_enable_peripheral_clock().

Referenced by main().

static void init_usart ( void  )
static

Initializes the USART.

Initializes the board USART ready for serial data to be transmitted and received.

References usart_options_t::baudrate, sysclk_enable_peripheral_clock(), sysclk_get_pba_hz(), USART, USART_1_STOPBIT, usart_init_rs232(), USART_NO_PARITY, USART_NORMAL_CHMODE, and usart_options.

Referenced by main().