Microchip® Advanced Software Framework

at42qt1060_controller.c File Reference
#include "board.h"
#include "gpio.h"
#include "controller.h"
#include "twim.h"
#include "at42qt1060.h"
#include "conf_at42qt1060.h"
#include "cycle_counter.h"
#include <includes.h>

Data Structures

struct  at42qt1060_data
 

Macros

#define JOYSTICK_KEY_DEBOUNCE_MS   200
 

Functions

CPU_INT32U BSP_INTC_IntReg (CPU_FNCT_VOID handler, CPU_INT32U irq, CPU_INT32U int_level)
 
bool controller_connect (void)
 
static void controller_detect_int_handler (void)
 
void controller_init (U32 fcpu_hz, U32 fhsb_hz, U32 fpbb_hz, U32 fpba_hz)
 Initialization function of the controller interface. More...
 
bool controller_inquiry (void)
 
bool controller_select (void)
 
bool controller_send (void)
 
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...
 
static void twi_init (U32 fpba_hz)
 

Variables

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

#define JOYSTICK_KEY_DEBOUNCE_MS   200

Referenced by controller_init().

CPU_INT32U BSP_INTC_IntReg ( CPU_FNCT_VOID  handler,
CPU_INT32U  irq,
CPU_INT32U  int_level 
)
bool controller_connect ( void  )

References at42qt1060_data::detect_status, and touch_data.

Referenced by app_engine().

static void controller_detect_int_handler ( void  )
static
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.

References AT42QT1060_DETECT_PIN, at42qt1060_init(), BSP_INTC_IntReg(), controller_detect_int_handler(), cpu_delay_ms(), cpu_ms_2_cy(), cpu_set_timeout(), Disable_global_interrupt, Enable_global_interrupt, gpio_clear_pin_interrupt_flag(), gpio_enable_pin_interrupt(), GPIO_FALLING_EDGE, JOYSTICK_KEY_DEBOUNCE_MS, static_fcpu_hz, and twi_init().

Referenced by app_engine().

bool controller_inquiry ( void  )

References at42qt1060_data::detect_status, and touch_data.

Referenced by app_engine().

bool controller_select ( void  )

References at42qt1060_data::detect_status, and touch_data.

Referenced by app_engine().

bool controller_send ( void  )

References at42qt1060_data::detect_status, and touch_data.

Referenced by app_engine().

void controller_task ( void  )
void touch_detect_callback ( void  )

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

References touch_detect.

t_cpu_time joystick_key_sensibility_timer
U32 static_fcpu_hz
static

Referenced by controller_init().

volatile bool touch_detect = false