This file contains the SAMD QTouch library sample user application.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <asf.h>
Macros | |
#define | GET_MUTLCAP_ROTOR_SLIDER_POSITION(ROTOR_SLIDER_NUMBER) |
#define | GET_MUTLCAP_SENSOR_STATE(SENSOR_NUMBER) |
#define | LED_1_PIN PIN_PB01 |
Discrete LED output pin definitions. More... | |
#define | LED_2_PIN PIN_PB02 |
#define | LED_3_PIN PIN_PB03 |
#define | LED_4_PIN PIN_PA05 |
#define | LED_5_PIN PIN_PA06 |
#define | LED_6_PIN PIN_PA04 |
#define | LED_7_PIN PIN_PA07 |
#define | LED_B_PIN PIN_PA17 |
#define | LED_G_PIN PIN_PB15 |
#define | LED_R_PIN PIN_PB14 |
RGB LED output pin definitions. More... | |
#define | TIME_PERIOD_1MSEC 33u |
RTC Interrupt timing definition. More... | |
Functions | |
void | configure_port_pins (void) |
Prototypes. More... | |
void | configure_rtc_callbacks (void) |
Configure the RTC timer callback. More... | |
void | configure_rtc_count (void) |
Configure the RTC timer count after which interrupts comes. More... | |
int | main (void) |
Main function. More... | |
void | rtc_overflow_callback (void) |
RTC timer overflow callback. More... | |
void | timer_init (void) |
Initialize timer. More... | |
Variables | |
volatile uint8_t | PWM_Count |
const uint8_t | PWM_RGB_values [64][3] |
uint8_t | rotor_position |
uint8_t | rotor_state |
Variables. More... | |
struct rtc_module | rtc_instance |
[rtc_module_instance] More... | |
volatile uint16_t | touch_time_counter = 0u |
#define GET_MUTLCAP_ROTOR_SLIDER_POSITION | ( | ROTOR_SLIDER_NUMBER | ) |
Referenced by main().
#define GET_MUTLCAP_SENSOR_STATE | ( | SENSOR_NUMBER | ) |
Referenced by main().
#define LED_1_PIN PIN_PB01 |
Discrete LED output pin definitions.
Referenced by main().
#define LED_2_PIN PIN_PB02 |
Referenced by main().
#define LED_3_PIN PIN_PB03 |
Referenced by main().
#define LED_4_PIN PIN_PA05 |
Referenced by main().
#define LED_5_PIN PIN_PA06 |
Referenced by main().
#define LED_6_PIN PIN_PA04 |
Referenced by main().
#define LED_7_PIN PIN_PA07 |
Referenced by main().
#define LED_B_PIN PIN_PA17 |
Referenced by main().
#define LED_G_PIN PIN_PB15 |
Referenced by main().
#define LED_R_PIN PIN_PB14 |
RGB LED output pin definitions.
Referenced by main().
#define TIME_PERIOD_1MSEC 33u |
RTC Interrupt timing definition.
void configure_port_pins | ( | void | ) |
Prototypes.
Port pin configuration / assignments.
Configure Port pins
void configure_rtc_callbacks | ( | void | ) |
Configure the RTC timer callback.
void configure_rtc_count | ( | void | ) |
Configure the RTC timer count after which interrupts comes.
int main | ( | void | ) |
Main function.
Initialize and configure system and generic clocks. Use conf_clocks.h to configure system and generic clocks.
Enable global interrupts.
Initialize delay service.
Initialize timer.
Initialize QTouch library and configure touch sensors.
Configure port pins
Turn off all extension board LEDs
Goto STANDBY sleep mode, unless woken by timer or PTC interrupt.
Start touch sensor measurement, if touch_time.time_to_measure_touch flag is set by timer.
Get touch sensor states
Clear all slider controlled LEDs
If slider is activated
Parse slider position
References configure_port_pins(), delay_init(), GET_MUTLCAP_ROTOR_SLIDER_POSITION, GET_MUTLCAP_SENSOR_STATE, LED_1_PIN, LED_2_PIN, LED_3_PIN, LED_4_PIN, LED_5_PIN, LED_6_PIN, LED_7_PIN, LED_B_PIN, LED_G_PIN, LED_R_PIN, tag_touch_measure_data_t::measurement_done_touch, p_mutlcap_measure_data, port_pin_set_output_level(), PWM_Count, rotor_state, system_init(), system_interrupt_enable_global(), system_set_sleepmode(), system_sleep(), SYSTEM_SLEEPMODE_STANDBY, timer_init(), touch_sensors_init(), and touch_sensors_measure().
void rtc_overflow_callback | ( | void | ) |
RTC timer overflow callback.
Configure the RTC timer overflow callback.
void timer_init | ( | void | ) |
Initialize timer.
volatile uint8_t PWM_Count |
const uint8_t PWM_RGB_values[64][3] |
uint8_t rotor_position |
uint8_t rotor_state |
Variables.
struct rtc_module rtc_instance |
[rtc_module_instance]
[rtc_module_instance]
[rtc_module_inst]
volatile uint16_t touch_time_counter = 0u |