Microchip® Advanced Software Framework

thirdparty/qtouch/devspecific/sam0/samd/examples/example_selfcap/main.c File Reference

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_SELFCAP_ROTOR_SLIDER_POSITION(ROTOR_SLIDER_NUMBER)
 
#define GET_SELFCAP_SENSOR_STATE(SENSOR_NUMBER)
 
#define LED_1_PIN   PIN_PB03
 Discrete LED output pin definitions. More...
 
#define LED_2_PIN   PIN_PA05
 
#define LED_3_PIN   PIN_PA04
 
#define LED_4_PIN   PIN_PA10
 
#define LED_5_PIN   PIN_PA11
 
#define LED_6_PIN   PIN_PA20
 
#define LED_7_PIN   PIN_PA21
 
#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. 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_SELFCAP_ROTOR_SLIDER_POSITION (   ROTOR_SLIDER_NUMBER)
Value:
ROTOR_SLIDER_NUMBER]
touch_measure_data_t * p_selfcap_measure_data
Self Cap sensors measured data pointer.
Definition: thirdparty/qtouch/devspecific/sam0/samd/examples/example_selfcap/qtouch/touch.c:99
uint8_t * p_rotor_slider_values
Definition: touch_api_SAMD.h:764

Referenced by main().

#define GET_SELFCAP_SENSOR_STATE (   SENSOR_NUMBER)
Value:
p_sensor_states[(SENSOR_NUMBER / \
8)] & (1 << (SENSOR_NUMBER % 8))
touch_measure_data_t * p_selfcap_measure_data
Self Cap sensors measured data pointer.
Definition: thirdparty/qtouch/devspecific/sam0/samd/examples/example_selfcap/qtouch/touch.c:99

Referenced by main().

#define LED_1_PIN   PIN_PB03

Discrete LED output pin definitions.

Referenced by main().

#define LED_2_PIN   PIN_PA05

Referenced by main().

#define LED_3_PIN   PIN_PA04

Referenced by main().

#define LED_4_PIN   PIN_PA10

Referenced by main().

#define LED_5_PIN   PIN_PA11

Referenced by main().

#define LED_6_PIN   PIN_PA20

Referenced by main().

#define LED_7_PIN   PIN_PA21

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.

Referenced by timer_init().

void configure_port_pins ( void  )

Prototypes.

LED Port Pin Configuration.

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.

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.

Update touch status once measurement complete flag is set.

Get touch sensor states

Clear all slider controlled LEDs

If slider is activated

Parse slider position

References configure_port_pins(), delay_init(), GET_SELFCAP_ROTOR_SLIDER_POSITION, GET_SELFCAP_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_selfcap_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  )

volatile uint8_t PWM_Count
const uint8_t PWM_RGB_values[64][3]

Referenced by rtc_overflow_callback().

uint8_t rotor_position
uint8_t rotor_state

Variables.

Referenced by demo_start(), main(), and rtc_overflow_callback().

struct rtc_module rtc_instance

[rtc_module_instance]

[rtc_module_instance]

[rtc_module_inst]

volatile uint16_t touch_time_counter = 0u

Referenced by rtc_overflow_callback().