#include <avr32/io.h>
#include <stdio.h>
#include "compiler.h"
#include "print_funcs.h"
#include "board.h"
#include "power_clocks_lib.h"
#include "twim.h"
#include "gpio.h"
#include "pdca.h"
#include "cycle_counter.h"
#include "flashc.h"
#include "at42qt1060.h"
#include "conf_at42qt1060.h"
#include "pevc.h"
Macros | |
#define | FCPU_HZ 60000000 |
#define | FPBA_HZ 60000000 |
#define | PDCA_CHANNEL_IRQ AVR32_PDCA_IRQ_0 |
#define | PDCA_CHANNEL_USART 0 |
The PDCA channel instance for the USART0 Tx. More... | |
#define | PEVC_PDCA_SOT_USER AVR32_PEVC_ID_USER_PDCA_0 |
#define | STRING_TRANSFER_SIZE 36 |
Functions | |
void | init_pdca (void) |
void | init_pevc (void) |
Init PEVC Toggle LED when the Busy pin change. More... | |
ISR (pdca_int_handler, AVR32_PDCA_IRQ_GROUP0, 0) | |
PDCA Interrupts handler. More... | |
ISR (pevc_int_handler, AVR32_PEVC_IRQ_GROUP, 0) | |
PEVC overrun and trigger Interrupt handler. More... | |
int | main (void) |
static void | twi_init (void) |
Initializes the TWI for AT42QT1060. More... | |
Variables | |
unsigned char | aDataTransfered [STRING_TRANSFER_SIZE] |
volatile avr32_pdca_channel_t * | pdca_channel |
volatile avr32_pevc_t * | ppevc = &AVR32_PEVC |
volatile bool | touch_detect = false |
static volatile U32 | u32PdcaIsr |
#define FCPU_HZ 60000000 |
Referenced by init_usart(), and main().
#define FPBA_HZ 60000000 |
Referenced by audio_mixer_dacs_setup_direct(), audio_mixer_dacs_start_direct(), main(), start_scheduler(), twi_init(), and twim_init().
#define PDCA_CHANNEL_IRQ AVR32_PDCA_IRQ_0 |
Referenced by init_pdca().
#define PDCA_CHANNEL_USART 0 |
The PDCA channel instance for the USART0 Tx.
Referenced by init_pdca(), and ISR().
#define PEVC_PDCA_SOT_USER AVR32_PEVC_ID_USER_PDCA_0 |
Referenced by init_pevc().
#define STRING_TRANSFER_SIZE 36 |
void init_pdca | ( | void | ) |
References aDataTransfered, pdca_channel_options_t::addr, cpu_irq_restore(), cpu_irq_save(), irq_register_handler, pdca_channel, PDCA_CHANNEL_IRQ, PDCA_CHANNEL_USART, pdca_enable(), pdca_enable_interrupt_transfer_complete(), pdca_enable_interrupt_transfer_error(), pdca_get_handler(), pdca_init_channel(), pdca_int_handler(), and PDCA_TRANSFER_SIZE_BYTE.
Referenced by main().
void init_pevc | ( | void | ) |
Init PEVC Toggle LED when the Busy pin change.
References AVR32_PEVC_ID_GEN_PAD_2, AVR32_PEVC_ID_USER_PDCA_0, cpu_irq_restore(), cpu_irq_save(), FAIL, gpio_clr_gpio_pin(), gpio_enable_module(), pevc_evs_opt_t::igfdr, irq_register_handler, pevc_channel_configure(), PEVC_CHANNELS_ENABLE, pevc_channels_enable_overrun_interrupt(), pevc_channels_enable_trigger_interrupt(), PEVC_EVS_EVF_ON, PEVC_EVS_EVR_ON, PEVC_EVS_IGF_OFF, PEVC_PDCA_SOT_USER, ppevc, and print_dbg().
Referenced by dac_task_init(), and main().
ISR | ( | pdca_int_handler | , |
AVR32_PDCA_IRQ_GROUP0 | , | ||
0 | |||
) |
PDCA Interrupts handler.
References aDataTransfered, pdca_channel, PDCA_CHANNEL_USART, pdca_reload_channel(), print_dbg(), and u32PdcaIsr.
ISR | ( | pevc_int_handler | , |
AVR32_PEVC_IRQ_GROUP | , | ||
0 | |||
) |
PEVC overrun and trigger Interrupt handler.
References gpio_tgl_gpio_pin(), i, pevc_channel_clear_overrun_interrupt(), pevc_channel_clear_trigger_interrupt(), pevc_channel_is_overrun_interrupt_raised(), pevc_channel_is_trigger_interrupt_raised(), PEVC_NUMBER_OF_EVENT_USERS, ppevc, and touch_detect.
int main | ( | void | ) |
References aDataTransfered, AT42QT1060_DETECTION_STATUS, at42qt1060_init(), AT42QT1060_INPUT_PORT_STATUS, at42qt1060_read_reg(), cpu_delay_ms(), cpu_irq_enable, cpu_ms_2_cy(), cpu_set_timeout(), FCPU_HZ, FPBA_HZ, gpio_set_gpio_pin(), gpio_tgl_gpio_pin(), i, init_dbg_rs232(), init_pdca(), init_pevc(), init_sys_clocks(), irq_initialize_vectors, print_dbg(), touch_detect, and twi_init().
Referenced by jinit_c_main_controller(), jinit_d_main_controller(), METHODDEF(), and process_data_simple_main().
|
static |
Initializes the TWI for AT42QT1060.
References AT42QT1060_TWI, AT42QT1060_TWI_ADDRESS, AT42QT1060_TWI_MASTER_SPEED, AT42QT1060_TWI_SCL_FUNCTION, AT42QT1060_TWI_SCL_PIN, AT42QT1060_TWI_SDA_FUNCTION, AT42QT1060_TWI_SDA_PIN, FPBA_HZ, gpio_enable_module(), twi_master_init, and twi_options_t.
Referenced by main().
unsigned char aDataTransfered[STRING_TRANSFER_SIZE] |
Referenced by init_pdca(), ISR(), main(), and pdca_int_handler().
volatile avr32_pdca_channel_t* pdca_channel |
Referenced by init_pdca(), ISR(), pdca_disable(), pdca_disable_interrupt_reload_counter_zero(), pdca_disable_interrupt_transfer_complete(), pdca_disable_interrupt_transfer_error(), pdca_enable(), pdca_enable_interrupt_reload_counter_zero(), pdca_enable_interrupt_transfer_complete(), pdca_enable_interrupt_transfer_error(), pdca_get_channel_status(), pdca_get_handler(), pdca_get_load_size(), pdca_get_reload_size(), pdca_get_transfer_status(), pdca_init_channel(), pdca_int_handler(), pdca_load_channel(), pdca_reload_channel(), pdca_set_peripheral_select(), and pdca_set_transfer_size().
volatile avr32_pevc_t* ppevc = &AVR32_PEVC |
Referenced by init_pdca(), init_pevc(), and ISR().
Referenced by controller_task(), ISR(), main(), and touch_detect_callback().