00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
#ifndef _USB_API_H_
00014
#define _USB_API_H_
00015
00016 #define USB_HID_WAIT_MODE 0
00017 #define USB_HID_WAIT_REPORT 1
00018 #define USB_HID_RECEIVE_DATA_STANDARD 2
00019 #define USB_HID_SEND_DATA_STANDARD 3
00020 #define USB_HID_WAIT_SEND_DATA_STANDARD 4
00021 #define USB_HID_MODE_CONTINUOUS 5
00022 #define USB_HID_RECEIVE_DATA_CONTINUOUS 6
00023 #define USB_HID_SEND_DATA_CONTINUOUS 7
00024 #define USB_HID_WAIT_SEND_DATA_CONTINUOUS 8
00025
00026 #define DIR_OUT 0
00027 #define DIR_IN 1
00028
00029 #define MSK_AUXR1_ENBOOT 0x20
00030 #define MAP_BOOT AUXR1 |= MSK_AUXR1_ENBOOT;
00031 #define UNMAP_BOOT AUXR1 &= ~MSK_AUXR1_ENBOOT;
00032 #define __API_JMP_BOOTLOADER (*((const void(code*)(void)) 0xF400 ))
00033
00034 extern U8 send_free;
00035
00036 #define Is_new_data_read() (Usb_select_endpoint(EP_HID_OUT),Is_usb_receive_out_hid())
00037 #define Is_write_data_ready() (send_free == 1)
00038
00039
U8 usb_read_continuous (U8 *buffer);
00040
U8 usb_write_continuous (U8 *buffer, U8);
00041
void usb_standard_transfer(
void);
00042
00043
#endif