Arrow / Mbed OS DAPLink Reset
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers rl_usb.h Source File

rl_usb.h

Go to the documentation of this file.
00001 /**
00002  * @file    rl_usb.h
00003  * @brief   USB Device Library header
00004  *
00005  * DAPLink Interface Firmware
00006  * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved
00007  * SPDX-License-Identifier: Apache-2.0
00008  *
00009  * Licensed under the Apache License, Version 2.0 (the "License"); you may
00010  * not use this file except in compliance with the License.
00011  * You may obtain a copy of the License at
00012  *
00013  * http://www.apache.org/licenses/LICENSE-2.0
00014  *
00015  * Unless required by applicable law or agreed to in writing, software
00016  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00017  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00018  * See the License for the specific language governing permissions and
00019  * limitations under the License.
00020  */
00021 
00022 #ifndef __RL_USB_H__
00023 #define __RL_USB_H__
00024 
00025 #ifdef __cplusplus
00026 extern "C"  {
00027 #endif
00028 
00029 #include <stdint.h>
00030 #include "usb.h"
00031 
00032 /*****************  Functions *************************************************/
00033 
00034 /* USB Device functions exported from USB Device Core module                  */
00035 extern void  usbd_init(void);
00036 extern void  usbd_connect(BOOL con);
00037 extern void  usbd_reset_core(void);
00038 extern BOOL  usbd_configured(void);
00039 
00040 /* USB Device user functions imported to USB HID Class module                 */
00041 extern void  usbd_hid_init(void);
00042 extern BOOL  usbd_hid_get_report_trigger(U8 rid,   U8 *buf, int len);
00043 extern int   usbd_hid_get_report(U8 rtype, U8 rid, U8 *buf, U8  req);
00044 extern void  usbd_hid_set_report(U8 rtype, U8 rid, U8 *buf, int len, U8 req);
00045 extern U8    usbd_hid_get_protocol(void);
00046 extern void  usbd_hid_set_protocol(U8 protocol);
00047 
00048 /* USB Device user functions imported to USB Mass Storage Class module        */
00049 extern void  usbd_msc_init(void);
00050 extern void  usbd_msc_read_sect(U32 block, U8 *buf, U32 num_of_blocks);
00051 extern void  usbd_msc_write_sect(U32 block, U8 *buf, U32 num_of_blocks);
00052 extern void  usbd_msc_start_stop(BOOL start);
00053 
00054 /* USB Device user functions imported to USB Audio Class module               */
00055 extern void  usbd_adc_init(void);
00056 
00057 /* USB Device CDC ACM class functions called automatically by USBD Core module*/
00058 extern int32_t  USBD_CDC_ACM_Initialize(void);
00059 extern int32_t  USBD_CDC_ACM_Uninitialize(void);
00060 extern int32_t  USBD_CDC_ACM_Reset(void);
00061 /* USB Device CDC ACM class user functions                                    */
00062 extern int32_t  USBD_CDC_ACM_PortInitialize(void);
00063 extern int32_t  USBD_CDC_ACM_PortUninitialize(void);
00064 extern int32_t  USBD_CDC_ACM_PortReset(void);
00065 extern int32_t  USBD_CDC_ACM_PortSetLineCoding(CDC_LINE_CODING *line_coding );
00066 extern int32_t  USBD_CDC_ACM_PortGetLineCoding(CDC_LINE_CODING *line_coding );
00067 extern int32_t  USBD_CDC_ACM_PortSetControlLineState(uint16_t ctrl_bmp);
00068 extern int32_t  USBD_CDC_ACM_DataSend(const uint8_t *buf, int32_t len);
00069 extern int32_t  USBD_CDC_ACM_DataFree(void);
00070 extern int32_t  USBD_CDC_ACM_PutChar(const uint8_t  ch);
00071 extern int32_t  USBD_CDC_ACM_DataRead(uint8_t *buf, int32_t len);
00072 extern int32_t  USBD_CDC_ACM_GetChar(void);
00073 extern int32_t  USBD_CDC_ACM_DataAvailable(void);
00074 extern int32_t  USBD_CDC_ACM_Notify(uint16_t stat);
00075 /* USB Device CDC ACM class overridable functions                             */
00076 extern int32_t  USBD_CDC_ACM_SendEncapsulatedCommand(void);
00077 extern int32_t  USBD_CDC_ACM_GetEncapsulatedResponse(void);
00078 extern int32_t  USBD_CDC_ACM_SetCommFeature(uint16_t feat);
00079 extern int32_t  USBD_CDC_ACM_GetCommFeature(uint16_t feat);
00080 extern int32_t  USBD_CDC_ACM_ClearCommFeature(uint16_t feat);
00081 extern int32_t  USBD_CDC_ACM_SetLineCoding(void);
00082 extern int32_t  USBD_CDC_ACM_GetLineCoding(void);
00083 extern int32_t  USBD_CDC_ACM_SetControlLineState(uint16_t ctrl_bmp);
00084 extern int32_t  USBD_CDC_ACM_SendBreak(uint16_t dur);
00085 
00086 /* USB Device user functions imported to USB Custom Class module              */
00087 extern void  usbd_cls_init(void);
00088 extern void  usbd_cls_sof(void);
00089 extern BOOL  usbd_cls_dev_req(BOOL setup);
00090 extern BOOL  usbd_cls_if_req(BOOL setup);
00091 extern BOOL  usbd_cls_ep_req(BOOL setup);
00092 
00093 extern void  usbd_bulk_init(void);
00094 
00095 #ifdef __cplusplus
00096 }
00097 #endif
00098 
00099 #endif  /* __RL_USB_H__ */