Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

user_application.h File Reference

Go to the source code of this file.

Defines

#define HID_1   89
#define HID_2   90
#define HID_3   91
#define HID_4   92
#define HID_5   93
#define HID_6   94
#define HID_7   95
#define HID_8   96
#define HID_9   97
#define HID_0   98
#define HID_ENTER   88
#define HID_BACKSPACE   42
#define HID_LEFT   80
#define HID_RIGHT   79
#define HID_DIVIDE   84
#define HID_MULTIPLY   85
#define HID_MINUS   86
#define HID_PLUS   87
#define KEY_1_1   HID_LEFT
#define KEY_1_2   HID_RIGHT
#define KEY_1_3   HID_ENTER
#define KEY_1_4   HID_BACKSPACE
#define KEY_2_1   HID_1
#define KEY_2_2   HID_2
#define KEY_2_3   HID_3
#define KEY_2_4   HID_4
#define KEY_3_1   HID_5
#define KEY_3_2   HID_6
#define KEY_3_3   HID_7
#define KEY_3_4   HID_8
#define KEY_4_1   HID_9
#define KEY_4_2   HID_MULTIPLY
#define KEY_4_3   HID_PLUS
#define KEY_4_4   HID_DIVIDE

Functions

void user_application_task_init (void)
void user_application_task (void)


Define Documentation

#define HID_1   89
 

Definition at line 16 of file user_application.h.

#define HID_2   90
 

Definition at line 17 of file user_application.h.

#define HID_3   91
 

Definition at line 18 of file user_application.h.

#define HID_4   92
 

Definition at line 19 of file user_application.h.

#define HID_5   93
 

Definition at line 20 of file user_application.h.

#define HID_6   94
 

Definition at line 21 of file user_application.h.

#define HID_7   95
 

Definition at line 22 of file user_application.h.

#define HID_8   96
 

Definition at line 23 of file user_application.h.

#define HID_9   97
 

Definition at line 24 of file user_application.h.

#define HID_0   98
 

Definition at line 25 of file user_application.h.

#define HID_ENTER   88
 

Definition at line 26 of file user_application.h.

#define HID_BACKSPACE   42
 

Definition at line 27 of file user_application.h.

#define HID_LEFT   80
 

Definition at line 28 of file user_application.h.

#define HID_RIGHT   79
 

Definition at line 29 of file user_application.h.

#define HID_DIVIDE   84
 

Definition at line 30 of file user_application.h.

#define HID_MULTIPLY   85
 

Definition at line 31 of file user_application.h.

#define HID_MINUS   86
 

Definition at line 32 of file user_application.h.

#define HID_PLUS   87
 

Definition at line 33 of file user_application.h.

#define KEY_1_1   HID_LEFT
 

Definition at line 35 of file user_application.h.

#define KEY_1_2   HID_RIGHT
 

Definition at line 36 of file user_application.h.

#define KEY_1_3   HID_ENTER
 

Definition at line 37 of file user_application.h.

#define KEY_1_4   HID_BACKSPACE
 

Definition at line 38 of file user_application.h.

#define KEY_2_1   HID_1
 

Definition at line 39 of file user_application.h.

#define KEY_2_2   HID_2
 

Definition at line 40 of file user_application.h.

#define KEY_2_3   HID_3
 

Definition at line 41 of file user_application.h.

#define KEY_2_4   HID_4
 

Definition at line 42 of file user_application.h.

#define KEY_3_1   HID_5
 

Definition at line 43 of file user_application.h.

#define KEY_3_2   HID_6
 

Definition at line 44 of file user_application.h.

#define KEY_3_3   HID_7
 

Definition at line 45 of file user_application.h.

#define KEY_3_4   HID_8
 

Definition at line 46 of file user_application.h.

#define KEY_4_1   HID_9
 

Definition at line 47 of file user_application.h.

#define KEY_4_2   HID_MULTIPLY
 

Definition at line 48 of file user_application.h.

#define KEY_4_3   HID_PLUS
 

Definition at line 49 of file user_application.h.

#define KEY_4_4   HID_DIVIDE
 

Definition at line 50 of file user_application.h.


Function Documentation

void user_application_task_init void   ) 
 

Definition at line 52 of file user_application.c.

References Configure_led, data_to_send, Led_all_off, LED_PORT_10MA, LENGTH_OF_REPORT, and U8.

00053 { 00054 U8 c; 00055 Configure_led(0,LED_PORT_10MA); 00056 Configure_led(1,LED_PORT_10MA); 00057 Configure_led(2,LED_PORT_10MA); 00058 Configure_led(3,LED_PORT_10MA); 00059 Led_all_off(); 00060 for (c=0; c< LENGTH_OF_REPORT; c++) 00061 { 00062 data_to_send[c] = 0; 00063 } 00064 }

void user_application_task void   ) 
 

Definition at line 81 of file user_application.c.

References __API_JMP_BOOTLOADER, Configure_led, data_received, data_to_send, Enable_ale, INT0_button, Is_new_data_read, Is_write_data_ready, last_INT0_button_state, Led_0_off, Led_0_on, Led_1_off, Led_1_on, Led_2_off, Led_2_on, Led_3_off, Led_3_on, Led_all_off, MAP_BOOT, Pll_stop, reset_to_bootloader, STANDARD_PORT, TRUE, Usb_detach, Usb_disable, usb_read_continuous(), and usb_write_continuous().

00082 { 00083 if(Is_new_data_read()) 00084 { 00085 usb_read_continuous(data_received); 00086 00087 if((data_received[0]=='1')&&(data_received[1]=='1')) 00088 Led_0_on(); 00089 00090 if((data_received[0]=='0')&&(data_received[1]=='1')) 00091 Led_0_off(); 00092 00093 if((data_received[0]=='1')&&(data_received[1]=='2')) 00094 Led_1_on(); 00095 00096 if((data_received[0]=='0')&&(data_received[1]=='2')) 00097 Led_1_off(); 00098 00099 if((data_received[0]=='1')&&(data_received[1]=='3')) 00100 Led_2_on(); 00101 00102 if((data_received[0]=='0')&&(data_received[1]=='3')) 00103 Led_2_off(); 00104 00105 if((data_received[0]=='1')&&(data_received[1]=='4')) 00106 Led_3_on(); 00107 00108 if((data_received[0]=='0')&&(data_received[1]=='4')) 00109 Led_3_off(); 00110 } 00111 00112 00113 00114 if (INT0_button != last_INT0_button_state) // INT0 button pressed 00115 { 00116 if (Is_write_data_ready()) 00117 { 00118 data_to_send[0] = !INT0_button; 00119 usb_write_continuous(data_to_send, 1); 00120 last_INT0_button_state = INT0_button; 00121 } 00122 } 00123 00124 00125 if (reset_to_bootloader == TRUE) 00126 { 00127 Usb_detach(); 00128 Led_all_off(); 00129 Enable_ale(); 00130 Configure_led(0,STANDARD_PORT); 00131 Configure_led(1,STANDARD_PORT); 00132 Configure_led(2,STANDARD_PORT); 00133 Configure_led(3,STANDARD_PORT); 00134 for (data_received[0]=0; data_received[0]<250; data_received[0]++); 00135 Usb_disable(); 00136 Pll_stop(); 00137 EA = 0; 00138 MAP_BOOT; 00139 __API_JMP_BOOTLOADER(); 00140 } 00141 }


Generated on Mon Apr 10 17:23:31 2006 for Atmel by doxygen 1.3.7