Definition in file controller.h.
#include "compiler.h"
Go to the source code of this file.
Functions | |
void | controller_init (U32 fcpu_hz, U32 fhsb_hz, U32 fpbb_hz, U32 fpba_hz) |
Bool | controller_key_fct1 (void) |
Bool | controller_key_fct2 (void) |
Bool | controller_key_fct3 (void) |
Bool | controller_key_fct4 (void) |
Bool | controller_key_fct5 (void) |
void | controller_task (void) |
void controller_init | ( | U32 | fcpu_hz, | |
U32 | fhsb_hz, | |||
U32 | fpbb_hz, | |||
U32 | fpba_hz | |||
) |
Definition at line 88 of file controller.c.
References JOYSTICK_KEY_DEBOUNCE_MS, joystick_key_sensibility_timer, static_fcpu_hz, and touch_detect_callback().
Referenced by main().
00089 { 00090 // wait until the device settles its CHG line 00091 cpu_delay_ms(230, fcpu_hz); 00092 at42qt1060_init(fcpu_hz); 00093 at42qt1060_register_int(&touch_detect_callback); 00094 //static_fcpu_hz = fcpu_hz; 00095 cpu_set_timeout(cpu_ms_2_cy(JOYSTICK_KEY_DEBOUNCE_MS, static_fcpu_hz), 00096 &joystick_key_sensibility_timer); 00097 }
Bool controller_key_fct1 | ( | void | ) |
Definition at line 120 of file controller.c.
References at42qt1060_data::detect_status, and touch_data.
Referenced by state_machine_task().
00121 { 00122 if (touch_data.detect_status & (1 << 2)) 00123 { 00124 return TRUE; 00125 } 00126 return FALSE; 00127 }
Bool controller_key_fct2 | ( | void | ) |
Definition at line 130 of file controller.c.
References at42qt1060_data::detect_status, and touch_data.
Referenced by state_machine_task().
00131 { 00132 if (touch_data.detect_status & (1 << 3)) 00133 { 00134 return TRUE; 00135 } 00136 return FALSE; 00137 }
Bool controller_key_fct3 | ( | void | ) |
Definition at line 100 of file controller.c.
References at42qt1060_data::detect_status, and touch_data.
Referenced by state_machine_task().
00101 { 00102 if (touch_data.detect_status & (1 << 0)) 00103 { 00104 return TRUE; 00105 } 00106 return FALSE; 00107 }
Bool controller_key_fct4 | ( | void | ) |
Definition at line 110 of file controller.c.
References at42qt1060_data::detect_status, and touch_data.
Referenced by state_machine_task().
00111 { 00112 if (touch_data.detect_status & (1 << 1)) 00113 { 00114 return TRUE; 00115 } 00116 return FALSE; 00117 }
Bool controller_key_fct5 | ( | void | ) |
Definition at line 140 of file controller.c.
References at42qt1060_data::detect_status, and touch_data.
Referenced by state_machine_task().
00141 { 00142 if (touch_data.detect_status & (1 << 4)) 00143 { 00144 return TRUE; 00145 } 00146 return FALSE; 00147 }
void controller_task | ( | void | ) |
Definition at line 75 of file controller.c.
References at42qt1060_data::detect_status, touch_data, and touch_detect.
Referenced by main().
00076 { 00077 // if a touch is detected we read the status 00078 if(touch_detect) 00079 { 00080 touch_data.detect_status = 00081 at42qt1060_read_reg(AT42QT1060_DETECTION_STATUS); 00082 // need to read input port status too to reset CHG line 00083 at42qt1060_read_reg(AT42QT1060_INPUT_PORT_STATUS); 00084 touch_detect = FALSE; 00085 } 00086 }