Microchip® Advanced Software Framework

uc3c_ek-can-lin-loopbacks-demo/controller.c File Reference

Application Controller for AT42QT1060 Touch Management.

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

#include "board.h"
#include "gpio.h"
#include "intc.h"
#include "controller.h"
#include "at42qt1060.h"
#include "conf_at42qt1060.h"
#include "delay.h"

Data Structures

struct  at42qt1060_data
 

Macros

#define JOYSTICK_KEY_DEBOUNCE_MS   200
 

Functions

void controller_init (uint32_t fcpu_hz, uint32_t fhsb_hz, uint32_t fpbb_hz, uint32_t fpba_hz)
 Initialization function of the controller interface. More...
 
bool controller_key_fct1 (void)
 Local definition for controller Key 1: Right Button (Input+Noise Signal) More...
 
bool controller_key_fct2 (void)
 Local definition for controller Key 2: Left Button (Input Signal) More...
 
bool controller_key_fct3 (void)
 Local definition for controller Key 3: Up Button (FPU Signal) More...
 
bool controller_key_fct4 (void)
 Local definition for controller Key 4: Down Button (FP Signal) More...
 
bool controller_key_fct5 (void)
 Local definition for controller Key 5: Middle Button (Noise Signal) More...
 
void controller_task (void)
 Refresh the controller. More...
 
void touch_detect_callback (void)
 Callback function for a detect event of the touch sensor device. More...
 

Variables

t_cpu_time joystick_key_sensibility_timer
 
static uint32_t static_fcpu_hz
 
struct at42qt1060_data touch_data
 
volatile bool touch_detect = false
 

#define JOYSTICK_KEY_DEBOUNCE_MS   200

Referenced by controller_init().

void controller_init ( U32  fcpu_hz,
U32  fhsb_hz,
U32  fpbb_hz,
U32  fpba_hz 
)

Initialization function of the controller interface.

Parameters
fcpu_hzCPU frequency.
fhsb_hzHSB frequency.
fpbb_hzPBB frequency.
fpba_hzPBA frequency.

Referenced by app_engine(), and main().

bool controller_key_fct1 ( void  )

Local definition for controller Key 1: Right Button (Input+Noise Signal)

References at42qt1060_data::detect_status, and touch_data.

bool controller_key_fct2 ( void  )

Local definition for controller Key 2: Left Button (Input Signal)

References at42qt1060_data::detect_status, and touch_data.

bool controller_key_fct3 ( void  )

Local definition for controller Key 3: Up Button (FPU Signal)

References at42qt1060_data::detect_status, and touch_data.

bool controller_key_fct4 ( void  )

Local definition for controller Key 4: Down Button (FP Signal)

References at42qt1060_data::detect_status, and touch_data.

bool controller_key_fct5 ( void  )

Local definition for controller Key 5: Middle Button (Noise Signal)

References at42qt1060_data::detect_status, and touch_data.

void touch_detect_callback ( void  )

Callback function for a detect event of the touch sensor device.

t_cpu_time joystick_key_sensibility_timer
uint32_t static_fcpu_hz
static

Referenced by controller_init().

struct at42qt1060_data touch_data
volatile bool touch_detect = false