usb.h
Go to the documentation of this file.
1 /********************************************************************************************************
2  * @file usb.h
3  *
4  * @brief This is the header file for TLSR8258
5  *
6  * @author Driver Group
7  * @date May 8, 2018
8  *
9  * @par Copyright (c) 2018, Telink Semiconductor (Shanghai) Co., Ltd.
10  * All rights reserved.
11  *
12  * The information contained herein is confidential property of Telink
13  * Semiconductor (Shanghai) Co., Ltd. and is available under the terms
14  * of Commercial License Agreement between Telink Semiconductor (Shanghai)
15  * Co., Ltd. and the licensee or the terms described here-in. This heading
16  * MUST NOT be removed from this file.
17  *
18  * Licensees are granted free, non-transferable use of the information in this
19  * file under Mutual Non-Disclosure Agreement. NO WARRENTY of ANY KIND is provided.
20  * @par History:
21  * 1.initial release(DEC. 26 2018)
22  *
23  * @version A001
24  *
25  *******************************************************************************************************/
26 
27 #ifndef USB_H_
28 #define USB_H_
29 
30 #include "usbhw.h"
31 #include "usbhw_i.h"
32 #include "printf.h"
33 #include "usb_desc.h"
34 
35 extern unsigned char usb_g_config;
36 
37 #if(USB_MODE_CDC_EN)
38 extern unsigned char usb_cdc_data[USB_CDC_TX_RX_EPSIZE];
39 extern unsigned short usb_cdc_data_len;
40 #endif
41 
42 #if(USB_MODE_MICPHONE_EN||USB_MODE_SPEAKER_EN)
43 extern unsigned char usb_audio_mic_cnt;
44 extern unsigned char usb_audio_speaker_cnt;
45 #endif
46 
47 enum{
50 };
57 void audio_rx_data_from_usb(void);
58 
67 
73 void usb_irq_init(void);
74 
80 void usb_handle_request_process(unsigned char data_request);
81 
88 
94 void usb_handle_ctl_ep_data(void);
95 
102 
108 void usb_handle_irq_process(void);
109 
110 #if USB_MODE_CDC_EN
111 
117 void usb_cdc_tx_data_to_host(unsigned char * data_ptr, unsigned short data_len);
118 #endif
119 
120 #if(USB_MODE_KEYBOARD_EN)
121 
126 int usb_keyboard_hid_report(unsigned char *data);
127 #endif
128 
129 #if USB_MODE_MOUSE_EN
130 
135 int usb_mouse_hid_report(unsigned char * p);
136 #endif
137 
138 #endif /* USB_H_ */
139  //end of GP16
void usb_handle_irq_process(void)
This function serves to handle interrupt request from USB host.
int usb_mouse_hid_report(unsigned char *p)
This function serves to send HID report of Mouse.
Definition: usb.h:48
Definition: usb.h:49
unsigned char usb_audio_mic_cnt
void usb_cdc_tx_data_to_host(unsigned char *data_ptr, unsigned short data_len)
This function serves to send data to USB host in CDC device.
void audio_rx_data_from_usb(void)
This function servers to set USB Input.
void audio_tx_data_to_usb(AudioInput_Typedef Input_Type, AudioRate_Typedef Audio_Rate)
This function serves to send data to USB.
AudioRate_Typedef
Definition: audio.h:40
unsigned char usb_cdc_data[USB_CDC_TX_RX_EPSIZE]
void usb_handle_ctl_ep_status()
This function serves to handle STATUS process.
void usb_irq_init(void)
This function serves to enable manual interrupt.
void usb_handle_ctl_ep_data(void)
This function serves to handle DATA process.
void usb_handle_request_process(unsigned char data_request)
This function serves to handle interrupt request.
int usb_keyboard_hid_report(unsigned char *data)
This function serves to send HID report of Keyboard.
void usb_handle_ctl_ep_setup()
This function serves to handle SETUP process.
unsigned short usb_cdc_data_len
unsigned char usb_g_config
#define USB_CDC_TX_RX_EPSIZE
Definition: usb_desc.h:119
unsigned char usb_audio_speaker_cnt
AudioInput_Typedef
Definition: audio.h:50