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

usb_hid_generic_api.c File Reference

#include "config.h"
#include "..\usb\usb_task.h"
#include "usb_hid_generic_api.h"
#include "lib_mcu\usb\usb_drv.h"

Go to the source code of this file.

Functions

U8 usb_read_continuous (U8 *buffer)
U8 usb_write_continuous (U8 *buffer, U8 data_length)

Variables

U16 data_state = 0
U8 send_data [15] = {'a','b','c','d','e','f','g','h','k','l','m','n'}
U8 get_data [8]
U8pointer
bit reset_to_bootloader = FALSE
volatile bit usb_continuous_mode
U8 send_free = 1
S_hid_set_control SetControlBytes
_MEM_TYPE_SLOW_ U8 usb_configuration_nb


Function Documentation

U8 usb_read_continuous U8 buffer  ) 
 

Definition at line 38 of file usb_hid_generic_api.c.

References EP_HID_OUT, Is_new_data_read, U8, Usb_ack_receive_out_hid, Usb_byte_counter_8, usb_configuration_nb, and usb_read_packet().

Referenced by user_application_task().

00039 { 00040 U8 number_of_byte; 00041 if (usb_configuration_nb != 0) 00042 { 00043 number_of_byte = 0; 00044 if (Is_new_data_read()) 00045 { 00046 number_of_byte = Usb_byte_counter_8(); 00047 usb_read_packet(EP_HID_OUT,buffer,number_of_byte); 00048 Usb_ack_receive_out_hid(); 00049 } 00050 return number_of_byte; 00051 } 00052 else 00053 { 00054 return 0; 00055 } 00056 }

U8 usb_write_continuous U8 buffer,
U8  data_length
 

Definition at line 74 of file usb_hid_generic_api.c.

References EP_HID_IN, LENGTH_OF_REPORT, send_free, U8, usb_configuration_nb, Usb_select_endpoint, Usb_send_control_in, and Usb_write_byte.

Referenced by user_application_task().

00075 { 00076 U8 remaining; 00077 U8 c; 00078 if (usb_configuration_nb != 0) 00079 { 00080 if (data_length > LENGTH_OF_REPORT) 00081 { 00082 data_length = LENGTH_OF_REPORT; 00083 } 00084 c = data_length; 00085 remaining = LENGTH_OF_REPORT - data_length; 00086 send_free=0; 00087 Usb_select_endpoint(EP_HID_IN); 00088 while(0 != c) // send data contained in buffer 00089 { 00090 Usb_write_byte(*buffer); 00091 c--; 00092 buffer++; 00093 } 00094 while(0!=remaining) // complete the report if necessary with 0xFF 00095 { 00096 Usb_write_byte(0xFF); 00097 remaining--; 00098 } 00099 00100 Usb_send_control_in(); 00101 return data_length; 00102 } 00103 else 00104 { 00105 return 0; 00106 } 00107 }


Variable Documentation

U16 data_state = 0
 

Definition at line 9 of file usb_hid_generic_api.c.

U8 send_data[15] = {'a','b','c','d','e','f','g','h','k','l','m','n'}
 

Definition at line 10 of file usb_hid_generic_api.c.

U8 get_data[8]
 

Definition at line 11 of file usb_hid_generic_api.c.

U8* pointer
 

Definition at line 12 of file usb_hid_generic_api.c.

Referenced by usb_user_read_request().

bit reset_to_bootloader = FALSE
 

Definition at line 13 of file usb_hid_generic_api.c.

volatile bit usb_continuous_mode
 

Definition at line 14 of file usb_hid_generic_api.c.

Referenced by usb_interrupt(), usb_task(), and usb_task_init().

U8 send_free = 1
 

Definition at line 15 of file usb_hid_generic_api.c.

S_hid_set_control SetControlBytes
 

Definition at line 16 of file usb_hid_generic_api.c.

Referenced by usb_task(), and usb_user_read_request().

_MEM_TYPE_SLOW_ U8 usb_configuration_nb
 

Definition at line 17 of file usb_hid_generic_api.c.


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