The init driver is used to initialize IO (demo or terminal mode), power reduction features, USART1, ADC, Timer1 (demo or terminal mode) and touch sensing (QTB0)
Functions | |
void | adc_init (void) |
Function to setup ADC. More... | |
void | io_init_demo_mode (void) |
Function to setup IO for demo mode. More... | |
void | io_init_terminal_mode (void) |
Function to setup IO for terminal mode. More... | |
void | power_reduction_enable (void) |
Function to reduce power consumption. More... | |
void | qt_set_parameters (void) |
Function to set values for touch sensing. More... | |
void | stop_timer1_lightdemo (void) |
Function to stop timer1 used in the light sensor demo. More... | |
void | timer1_init (void) |
Function to setup timer1 as a time base for the touch lib. More... | |
void | timer1_lightdemo_init (void) |
Function to setup timer1 for light sensor demo. More... | |
void | touch_init (void) |
Function to setup touch button. More... | |
void | usart1_init (void) |
Function to setup USART1. More... | |
Variables | |
TOUCH_DATA_T | SNS_array [2][2] |
TOUCH_DATA_T | SNSK_array [2][2] |
void adc_init | ( | void | ) |
Function to setup ADC.
ADC configuration:
void io_init_demo_mode | ( | void | ) |
Function to setup IO for demo mode.
Configure all I/O as input pull-up enabled to make sure all I/Os have a defined level. Light sensor and NTC sensor (PA6 and PA7): input pull-up disable. Enable pinchange interrupt for SW0:2 used to toggle through operating modes
void io_init_terminal_mode | ( | void | ) |
Function to setup IO for terminal mode.
Configure all I/O as input pull-up enabled to make sure all I/Os have a defined level except LEDs (PB3:0) which is configured as outputs. Light sensor and NTC sensor (PA6 and PA7): input pull-up disable.
void power_reduction_enable | ( | void | ) |
Function to reduce power consumption.
This function will turn off clocks to all IO modules except for Timer2 which is used in power-save mode. The function will also shutdown analog modules like the AC and ADC.
static void qt_set_parameters | ( | void | ) |
Function to set values for touch sensing.
The function will fill the default threshold values in the configuration data structure. The user can change the values of these parameters to fit the application.
References DEF_QT_DI, DEF_QT_DRIFT_HOLD_TIME, DEF_QT_MAX_ON_DURATION, DEF_QT_NEG_DRIFT_RATE, DEF_QT_POS_DRIFT_RATE, DEF_QT_POS_RECAL_DELAY, DEF_QT_RECAL_THRESHOLD, qt_config_data, tag_qt_touch_lib_config_data_t::qt_di, tag_qt_touch_lib_config_data_t::qt_drift_hold_time, tag_qt_touch_lib_config_data_t::qt_max_on_duration, tag_qt_touch_lib_config_data_t::qt_neg_drift_rate, tag_qt_touch_lib_config_data_t::qt_pos_drift_rate, tag_qt_touch_lib_config_data_t::qt_pos_recal_delay, and tag_qt_touch_lib_config_data_t::qt_recal_threshold.
void stop_timer1_lightdemo | ( | void | ) |
Function to stop timer1 used in the light sensor demo.
All timer1 registers are set to default state
void timer1_init | ( | void | ) |
Function to setup timer1 as a time base for the touch lib.
In this mode Timer1 is used to generate PWM signal on the LEDs.
Timer1 configuration:
References qt_measurement_period_msec, and TICKS_PER_MS.
Referenced by touch_init().
void timer1_lightdemo_init | ( | void | ) |
Function to setup timer1 for light sensor demo.
In this mode Timer1 is used to generate PWM signal on the LEDs.
Timer1 configuration:
void touch_init | ( | void | ) |
Function to setup touch button.
This function will configure touch sensing for the QTB0 touch button. LED1 is used as touch indication. Touch detected: LED1 on, touch not detected: LED1 off.
References CHANNEL_0, HYST_6_25, NO_AKS_GROUP, qt_enable_key(), qt_filter_callback, qt_init_sensing, qt_set_parameters(), SNS_array, SNSK_array, and timer1_init().
void usart1_init | ( | void | ) |
Function to setup USART1.
USART1 is used to communicate with the boardcontroller (AT32UC3256B1).
USART1 configuration:
TOUCH_DATA_T SNS_array[2][2] |
Referenced by touch_init().
TOUCH_DATA_T SNSK_array[2][2] |
Referenced by touch_init().