Functions | |
void | accelero_init (void) |
Initialization of acceleroShould be done before main. More... | |
void | accelero_off (void) |
Disable the accelero. More... | |
void | accelero_on (void) |
Enables the accelero. More... | |
void | accelero_read (unsigned char address, unsigned char *addr_ptr) |
read the accelero More... | |
void | accelero_write (unsigned char data, unsigned char address) |
read the accelero More... | |
static void | app_task (void) |
Application task and state machine. More... | |
static void | buzzer_control (void) |
Buzzer Control. More... | |
static void | buzzer_init (void) |
Buzzer initialization. More... | |
static void | extended_delay_ms (uint16_t delay_ms) |
Extended blocking delay. More... | |
static void | indicate_fault_behavior (void) |
Indicating malfunction. More... | |
static void | init_system (void) |
initialise host app, pins, watchdog, etc More... | |
ISR (INT2_vect) | |
Prox ISR. More... | |
ISR (INT3_vect) | |
Accelero ISR. More... | |
ISR (TIMER0_COMPA_vect) | |
timer 0 compare ISR More... | |
static void | led0_off (void) |
led0 off More... | |
static void | led0_on (void) |
led0 on More... | |
static void | led0_toggle (void) |
led0 Toggle More... | |
static void | led1_off (void) |
led1 off More... | |
static void | led1_on (void) |
led1 on More... | |
static void | led1_toggle (void) |
Led1 Toggle. More... | |
int | main (void) |
Main function - Initialization of RF4CE and QTouch are done. More... | |
void | prox_init (void) |
Initialization of ProxShould be done before main. More... | |
void | prox_off (void) |
Disable the prox. More... | |
void | prox_on (void) |
Enable the prox. More... | |
static void | sleep_led_control (void) |
This function controls the LED in a definitive fashion before going to sleep. More... | |
static void | start_awake_timer_cb (void *callback_parameter) |
The callback function for the awake timer after the sleep period is over. More... | |
static void | start_warm_reset_cb (void *callback_parameter) |
The callback function for the warm-reset timeout. More... | |
Variables | |
uint32_t | timer_int |
timer 0 compare ISR More... | |
void accelero_init | ( | void | ) |
Initialization of acceleroShould be done before main.
References accelero_on(), accelero_read(), tag_memory_map_body_t::accelero_status, accelero_write(), tag_memory_map_t::body, CTRL_REG1_PC1, CTRL_REG1_RES, CTRL_REG1_TPE, CTRL_REG1_WUFE, CTRL_REG2_DOM, CTRL_REG2_FDM, CTRL_REG2_FUM, CTRL_REG2_LEM, CTRL_REG2_RIM, CTRL_REG2_UPM, CTRL_REG3_OTDT_400HZ, CTRL_REG3_OTP_6_3HZ, CTRL_REG3_OWUF_50HZ, CTRL_REG3_SRST, DATA_CTRL_ODR_200HZ, KXTF9_CTRL_REG1, KXTF9_CTRL_REG2, KXTF9_CTRL_REG3, KXTF9_DATA_CTRL_REG, KXTF9_INT_CTRL_REG1, KXTF9_INT_REL, KXTF9_TILT_TIMER, KXTF9_WHO_AM_I, KXTF9_WUF_THRESH, KXTF9_WUF_TIMER, memory_map, pal_timer_delay(), TILT_TIMER_INIT, twi_master_initialise(), and WUF_TIMER_INIT.
Referenced by app_task(), and main().
void accelero_off | ( | void | ) |
Disable the accelero.
Referenced by app_task().
void accelero_on | ( | void | ) |
Enables the accelero.
Referenced by accelero_init().
void accelero_read | ( | unsigned char | address, |
unsigned char * | addr_ptr | ||
) |
read the accelero
address | of read location |
address | of variable to store the read data. |
References FALSE, TWI_statusReg::lastTransOK, TRUE, twi_get_data_from_transceiver(), twi_start_transceiver_with_data(), and twi_transceiver_busy().
Referenced by accelero_init(), and app_task().
void accelero_write | ( | unsigned char | data, |
unsigned char | address | ||
) |
read the accelero
data | Yhe data to be written |
address | of register to write the data |
References FALSE, and twi_start_transceiver_with_data().
Referenced by accelero_init().
|
static |
Application task and state machine.
References accelero_init(), accelero_off(), accelero_read(), tag_memory_map_body_t::accelero_status, allow_to_sleep, AVR477_ACTIVE_DURATION_IN_QT_MEASURE_PERIOD, AVR477_SLEEP_DURATION_IN_US, tag_memory_map_t::body, burst_flag, buzzer_control(), COLD_START, count, CTRL_REG2_DOM, CTRL_REG2_UPM, current_time_ms_touch, delivery, enable_sleep_counter, FUNC_PTR, IDLE, KXTF9_INT_REL, KXTF9_INT_SRC_REG2, KXTF9_TILT_POS_CUR, memory_map, nlme_reset_request(), nlme_rx_enable_request(), node_status, NULL, nwk_stack_idle(), pal_sleep_mode(), pal_timer_start(), pal_timer_stop(), prox_int_flag, prox_off(), prox_on(), QDebug_SendData(), qt_measure_data, qt_measure_sensors(), tag_qt_touch_lib_measure_data_t::qt_touch_status, QTLIB_BURST_AGAIN, RESET, tag_qt_touch_status_t::rotor_slider_values, RX_DURATION_INFINITY, RX_DURATION_OFF, tag_qt_touch_status_t::sensor_states, tag_memory_map_body_t::sensor_status, SET_SLEEP_MODE, sleep_led_control(), SLEEP_MODE, start_awake_timer_cb(), status_flag, SUBS_DELTA, SUBS_GLOBAL_CONFIG, SUBS_REF, SUBS_SENSOR_CONFIG, SUBS_SIGN_ON, SUBS_SIGNALS, SUBS_STATES, T_LED_TIMER, time_to_measure_touch, TIMEOUT_RELATIVE, Transmit_Delta(), Transmit_Global_Config(), Transmit_Ref(), Transmit_Sensor_Config(), Transmit_Sign_On(), Transmit_Signals(), Transmit_State(), TRANSMITTING, TRX_OFF_CONFIRM, TRX_OFF_START, TRX_ON_START, WDT_DISABLE, WDT_RESET, and tag_memory_map_body_t::wheel_position.
Referenced by main().
|
static |
Buzzer Control.
Delay is introduced to make it audible
Referenced by app_task(), and start_warm_reset_cb().
|
static |
Buzzer initialization.
Referenced by BSP_InitQTouch().
|
static |
Extended blocking delay.
delay_ms | Delay value in ms |
References pal_timer_delay().
Referenced by indicate_fault_behavior(), and sleep_led_control().
|
static |
Indicating malfunction.
References extended_delay_ms(), led0_off(), led0_on(), led1_off(), and led1_on().
Referenced by main(), nlde_data_confirm(), nlme_reset_confirm(), nlme_rx_enable_confirm(), nlme_start_confirm(), and pbp_pair_confirm().
|
static |
initialise host app, pins, watchdog, etc
Referenced by BSP_InitQTouch().
ISR | ( | INT2_vect | ) |
Prox ISR.
References prox_int_flag.
ISR | ( | INT3_vect | ) |
Accelero ISR.
References acclero_int_flag.
ISR | ( | TIMER0_COMPA_vect | ) |
timer 0 compare ISR
References current_time_ms_touch, qt_measurement_period_msec, and time_to_measure_touch.
|
inlinestatic |
led0 off
Referenced by indicate_fault_behavior(), and sleep_led_control().
|
inlinestatic |
led0 on
Referenced by indicate_fault_behavior(), and sleep_led_control().
|
inlinestatic |
led0 Toggle
Referenced by Touch_measurement().
|
inlinestatic |
led1 off
Referenced by indicate_fault_behavior(), and sleep_led_control().
|
inlinestatic |
led1 on
Referenced by indicate_fault_behavior(), and sleep_led_control().
|
inlinestatic |
Led1 Toggle.
Referenced by Touch_measurement().
int main | ( | void | ) |
Main function - Initialization of RF4CE and QTouch are done.
Main function.
Then app_task() and nwk_task() is called in a loop.
The SAM3X_EK, SAM3X Arduino board and SAM4C_EK use two bytes length internal address EEPROM.
TWI and QT600 interface initialization
References accelero_init(), app_task(), AVR477_WARM_RESET_WAIT_DURATION_IN_US, burst_len_config(), buzzer_init(), config_sensors(), FUNC_PTR, indicate_fault_behavior(), init_system(), init_timer_isr(), node_status, NULL, nwk_init(), NWK_SUCCESS, nwk_task(), pal_global_irq_enable(), pal_timer_start(), prox_init(), QDebug_Init(), qt_avr477_filter_cb(), qt_filter_callback, qt_init_sensing, qt_set_parameters(), RESET, start_warm_reset_cb(), T_LED_TIMER, and TIMEOUT_RELATIVE.
void prox_init | ( | void | ) |
void prox_off | ( | void | ) |
Disable the prox.
Referenced by app_task(), and prox_init().
void prox_on | ( | void | ) |
Enable the prox.
Referenced by app_task().
|
static |
This function controls the LED in a definitive fashion before going to sleep.
References extended_delay_ms(), led0_off(), led0_on(), led1_off(), and led1_on().
Referenced by app_task().
|
static |
The callback function for the awake timer after the sleep period is over.
callback_parameter | Callback parameter (unused) |
References UNUSED.
Referenced by app_task().
|
static |
The callback function for the warm-reset timeout.
callback_parameter | Callback parameter (unused) |
References allow_to_sleep, buzzer_control(), EE_QDEBUG_OFFSET, INTERN_EEPROM, nlme_reset_request(), node_status, pal_ps_get(), qgSubsAllways, qgSubsChange, qgSubsOnce, UNUSED, and WARM_START.
Referenced by main().
uint32_t timer_int |
timer 0 compare ISR
Referenced by ISR().