#include "board.h"
#include "gpio.h"
#include "conf_at42qt1060.h"
#include "at42qt1060.h"
#include "intc.h"
#include "cycle_counter.h"
#include "twim.h"
Functions | |
void | at42qt1060_detect_int_handler (void) |
Interrupt handler for the pin interrupt-. More... | |
uint8_t | at42qt1060_get_detect_status (void) |
Gets the touch detect status of the sensor. More... | |
uint8_t | at42qt1060_get_status (void) |
void | at42qt1060_init (int32_t fcpu) |
Initialize touch sensor with default configuration values. More... | |
uint8_t | at42qt1060_read_reg (uint8_t reg_index) |
Read device register content. More... | |
void | at42qt1060_register_int (void(*touch_detect_callback)(void)) |
Register a normal pin interrupt for the touch event. More... | |
void | at42qt1060_write_reg (uint8_t reg_index, uint8_t data) |
Write device register content. More... | |
Variables | |
struct { | |
void(* touch_detect_callback )(void) | |
} | at42qt1060 |
Local driver data. More... | |
static uint32_t | cpu_hz |
void at42qt1060_detect_int_handler | ( | void | ) |
Interrupt handler for the pin interrupt-.
References at42qt1060, AT42QT1060_DETECT_PIN, gpio_clear_pin_interrupt_flag(), and gpio_get_pin_interrupt_flag().
Referenced by at42qt1060_register_int().
uint8_t at42qt1060_get_detect_status | ( | void | ) |
Gets the touch detect status of the sensor.
References AT42QT1060_DETECTION_STATUS, AT42QT1060_INPUT_PORT_STATUS, and at42qt1060_read_reg().
Referenced by at42qt1060_init().
uint8_t at42qt1060_get_status | ( | void | ) |
void at42qt1060_init | ( | int32_t | fcpu | ) |
Initialize touch sensor with default configuration values.
References AT42QT1060_DETECT_INTEGRATOR_VALUE, AT42QT1060_DI, at42qt1060_get_detect_status(), AT42QT1060_IO_MASK, AT42QT1060_KEY_0_NTHR, AT42QT1060_KEY_0_NTHR_VALUE, AT42QT1060_KEY_1_NTHR, AT42QT1060_KEY_1_NTHR_VALUE, AT42QT1060_KEY_2_NTHR, AT42QT1060_KEY_2_NTHR_VALUE, AT42QT1060_KEY_3_NTHR, AT42QT1060_KEY_3_NTHR_VALUE, AT42QT1060_KEY_4_NTHR, AT42QT1060_KEY_4_NTHR_VALUE, AT42QT1060_KEY_5_NTHR, AT42QT1060_KEY_5_NTHR_VALUE, AT42QT1060_KEY_MASK, AT42QT1060_KEY_MASK_VALUE, AT42QT1060_LP_MODE, at42qt1060_read_reg(), at42qt1060_write_reg(), and cpu_hz.
Referenced by controller_init().
uint8_t at42qt1060_read_reg | ( | uint8_t | reg_index | ) |
Read device register content.
Read register data.
reg_index | Register address. |
References twi_package_t::addr_length, AT42QT1060_TWI, AT42QT1060_TWI_ADDRESS, twi_package_t::buffer, twi_package_t::chip, cpu_delay_us(), cpu_hz, twi_package_t::length, twi_master_read(), twi_master_write(), and TWI_SUCCESS.
Referenced by at42qt1060_get_detect_status(), at42qt1060_init(), and controller_task().
void at42qt1060_register_int | ( | void(*)(void) | touch_detect_callback | ) |
Register a normal pin interrupt for the touch event.
Register a pin interrupt handler.
References at42qt1060, at42qt1060_detect_int_handler(), AT42QT1060_DETECT_PIN, Disable_global_interrupt, Enable_global_interrupt, gpio_clear_pin_interrupt_flag(), gpio_enable_pin_interrupt(), GPIO_FALLING_EDGE, INTC_register_interrupt(), and touch_detect_callback.
void at42qt1060_write_reg | ( | uint8_t | reg_index, |
uint8_t | data | ||
) |
Write device register content.
Write data to a sensor register.
reg_index | Register address. Use macros as defined in the header file. |
data | Data that should be written to the device register. |
References twi_package_t::addr_length, AT42QT1060_TWI, AT42QT1060_TWI_ADDRESS, twi_package_t::buffer, twi_package_t::chip, twi_package_t::length, twi_master_write(), and TWI_SUCCESS.
Referenced by at42qt1060_init().
struct { ... } at42qt1060 |
Local driver data.
Referenced by at42qt1060_detect_int_handler(), and at42qt1060_register_int().
|
static |
Referenced by at42qt1060_init(), and at42qt1060_read_reg().
void(* touch_detect_callback)(void) |
Referenced by at42qt1060_register_int(), and controller_detect_int_handler().