Repostiory containing DAPLink source code with Reset Pin workaround for HANI_IOT board.
Upstream: https://github.com/ARMmbed/DAPLink
source/usb/rl_usb.h@0:01f31e923fe2, 2020-04-07 (annotated)
- Committer:
- Pawel Zarembski
- Date:
- Tue Apr 07 12:55:42 2020 +0200
- Revision:
- 0:01f31e923fe2
hani: DAPLink with reset workaround
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Pawel Zarembski |
0:01f31e923fe2 | 1 | /** |
Pawel Zarembski |
0:01f31e923fe2 | 2 | * @file rl_usb.h |
Pawel Zarembski |
0:01f31e923fe2 | 3 | * @brief USB Device Library header |
Pawel Zarembski |
0:01f31e923fe2 | 4 | * |
Pawel Zarembski |
0:01f31e923fe2 | 5 | * DAPLink Interface Firmware |
Pawel Zarembski |
0:01f31e923fe2 | 6 | * Copyright (c) 2009-2016, ARM Limited, All Rights Reserved |
Pawel Zarembski |
0:01f31e923fe2 | 7 | * SPDX-License-Identifier: Apache-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 8 | * |
Pawel Zarembski |
0:01f31e923fe2 | 9 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
Pawel Zarembski |
0:01f31e923fe2 | 10 | * not use this file except in compliance with the License. |
Pawel Zarembski |
0:01f31e923fe2 | 11 | * You may obtain a copy of the License at |
Pawel Zarembski |
0:01f31e923fe2 | 12 | * |
Pawel Zarembski |
0:01f31e923fe2 | 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
Pawel Zarembski |
0:01f31e923fe2 | 14 | * |
Pawel Zarembski |
0:01f31e923fe2 | 15 | * Unless required by applicable law or agreed to in writing, software |
Pawel Zarembski |
0:01f31e923fe2 | 16 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
Pawel Zarembski |
0:01f31e923fe2 | 17 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
Pawel Zarembski |
0:01f31e923fe2 | 18 | * See the License for the specific language governing permissions and |
Pawel Zarembski |
0:01f31e923fe2 | 19 | * limitations under the License. |
Pawel Zarembski |
0:01f31e923fe2 | 20 | */ |
Pawel Zarembski |
0:01f31e923fe2 | 21 | |
Pawel Zarembski |
0:01f31e923fe2 | 22 | #ifndef __RL_USB_H__ |
Pawel Zarembski |
0:01f31e923fe2 | 23 | #define __RL_USB_H__ |
Pawel Zarembski |
0:01f31e923fe2 | 24 | |
Pawel Zarembski |
0:01f31e923fe2 | 25 | #ifdef __cplusplus |
Pawel Zarembski |
0:01f31e923fe2 | 26 | extern "C" { |
Pawel Zarembski |
0:01f31e923fe2 | 27 | #endif |
Pawel Zarembski |
0:01f31e923fe2 | 28 | |
Pawel Zarembski |
0:01f31e923fe2 | 29 | #include <stdint.h> |
Pawel Zarembski |
0:01f31e923fe2 | 30 | #include "usb.h" |
Pawel Zarembski |
0:01f31e923fe2 | 31 | |
Pawel Zarembski |
0:01f31e923fe2 | 32 | /***************** Functions *************************************************/ |
Pawel Zarembski |
0:01f31e923fe2 | 33 | |
Pawel Zarembski |
0:01f31e923fe2 | 34 | /* USB Device functions exported from USB Device Core module */ |
Pawel Zarembski |
0:01f31e923fe2 | 35 | extern void usbd_init(void); |
Pawel Zarembski |
0:01f31e923fe2 | 36 | extern void usbd_connect(BOOL con); |
Pawel Zarembski |
0:01f31e923fe2 | 37 | extern void usbd_reset_core(void); |
Pawel Zarembski |
0:01f31e923fe2 | 38 | extern BOOL usbd_configured(void); |
Pawel Zarembski |
0:01f31e923fe2 | 39 | |
Pawel Zarembski |
0:01f31e923fe2 | 40 | /* USB Device user functions imported to USB HID Class module */ |
Pawel Zarembski |
0:01f31e923fe2 | 41 | extern void usbd_hid_init(void); |
Pawel Zarembski |
0:01f31e923fe2 | 42 | extern BOOL usbd_hid_get_report_trigger(U8 rid, U8 *buf, int len); |
Pawel Zarembski |
0:01f31e923fe2 | 43 | extern int usbd_hid_get_report(U8 rtype, U8 rid, U8 *buf, U8 req); |
Pawel Zarembski |
0:01f31e923fe2 | 44 | extern void usbd_hid_set_report(U8 rtype, U8 rid, U8 *buf, int len, U8 req); |
Pawel Zarembski |
0:01f31e923fe2 | 45 | extern U8 usbd_hid_get_protocol(void); |
Pawel Zarembski |
0:01f31e923fe2 | 46 | extern void usbd_hid_set_protocol(U8 protocol); |
Pawel Zarembski |
0:01f31e923fe2 | 47 | |
Pawel Zarembski |
0:01f31e923fe2 | 48 | /* USB Device user functions imported to USB Mass Storage Class module */ |
Pawel Zarembski |
0:01f31e923fe2 | 49 | extern void usbd_msc_init(void); |
Pawel Zarembski |
0:01f31e923fe2 | 50 | extern void usbd_msc_read_sect(U32 block, U8 *buf, U32 num_of_blocks); |
Pawel Zarembski |
0:01f31e923fe2 | 51 | extern void usbd_msc_write_sect(U32 block, U8 *buf, U32 num_of_blocks); |
Pawel Zarembski |
0:01f31e923fe2 | 52 | extern void usbd_msc_start_stop(BOOL start); |
Pawel Zarembski |
0:01f31e923fe2 | 53 | |
Pawel Zarembski |
0:01f31e923fe2 | 54 | /* USB Device user functions imported to USB Audio Class module */ |
Pawel Zarembski |
0:01f31e923fe2 | 55 | extern void usbd_adc_init(void); |
Pawel Zarembski |
0:01f31e923fe2 | 56 | |
Pawel Zarembski |
0:01f31e923fe2 | 57 | /* USB Device CDC ACM class functions called automatically by USBD Core module*/ |
Pawel Zarembski |
0:01f31e923fe2 | 58 | extern int32_t USBD_CDC_ACM_Initialize(void); |
Pawel Zarembski |
0:01f31e923fe2 | 59 | extern int32_t USBD_CDC_ACM_Uninitialize(void); |
Pawel Zarembski |
0:01f31e923fe2 | 60 | extern int32_t USBD_CDC_ACM_Reset(void); |
Pawel Zarembski |
0:01f31e923fe2 | 61 | /* USB Device CDC ACM class user functions */ |
Pawel Zarembski |
0:01f31e923fe2 | 62 | extern int32_t USBD_CDC_ACM_PortInitialize(void); |
Pawel Zarembski |
0:01f31e923fe2 | 63 | extern int32_t USBD_CDC_ACM_PortUninitialize(void); |
Pawel Zarembski |
0:01f31e923fe2 | 64 | extern int32_t USBD_CDC_ACM_PortReset(void); |
Pawel Zarembski |
0:01f31e923fe2 | 65 | extern int32_t USBD_CDC_ACM_PortSetLineCoding(CDC_LINE_CODING *line_coding); |
Pawel Zarembski |
0:01f31e923fe2 | 66 | extern int32_t USBD_CDC_ACM_PortGetLineCoding(CDC_LINE_CODING *line_coding); |
Pawel Zarembski |
0:01f31e923fe2 | 67 | extern int32_t USBD_CDC_ACM_PortSetControlLineState(uint16_t ctrl_bmp); |
Pawel Zarembski |
0:01f31e923fe2 | 68 | extern int32_t USBD_CDC_ACM_DataSend(const uint8_t *buf, int32_t len); |
Pawel Zarembski |
0:01f31e923fe2 | 69 | extern int32_t USBD_CDC_ACM_DataFree(void); |
Pawel Zarembski |
0:01f31e923fe2 | 70 | extern int32_t USBD_CDC_ACM_PutChar(const uint8_t ch); |
Pawel Zarembski |
0:01f31e923fe2 | 71 | extern int32_t USBD_CDC_ACM_DataRead(uint8_t *buf, int32_t len); |
Pawel Zarembski |
0:01f31e923fe2 | 72 | extern int32_t USBD_CDC_ACM_GetChar(void); |
Pawel Zarembski |
0:01f31e923fe2 | 73 | extern int32_t USBD_CDC_ACM_DataAvailable(void); |
Pawel Zarembski |
0:01f31e923fe2 | 74 | extern int32_t USBD_CDC_ACM_Notify(uint16_t stat); |
Pawel Zarembski |
0:01f31e923fe2 | 75 | /* USB Device CDC ACM class overridable functions */ |
Pawel Zarembski |
0:01f31e923fe2 | 76 | extern int32_t USBD_CDC_ACM_SendEncapsulatedCommand(void); |
Pawel Zarembski |
0:01f31e923fe2 | 77 | extern int32_t USBD_CDC_ACM_GetEncapsulatedResponse(void); |
Pawel Zarembski |
0:01f31e923fe2 | 78 | extern int32_t USBD_CDC_ACM_SetCommFeature(uint16_t feat); |
Pawel Zarembski |
0:01f31e923fe2 | 79 | extern int32_t USBD_CDC_ACM_GetCommFeature(uint16_t feat); |
Pawel Zarembski |
0:01f31e923fe2 | 80 | extern int32_t USBD_CDC_ACM_ClearCommFeature(uint16_t feat); |
Pawel Zarembski |
0:01f31e923fe2 | 81 | extern int32_t USBD_CDC_ACM_SetLineCoding(void); |
Pawel Zarembski |
0:01f31e923fe2 | 82 | extern int32_t USBD_CDC_ACM_GetLineCoding(void); |
Pawel Zarembski |
0:01f31e923fe2 | 83 | extern int32_t USBD_CDC_ACM_SetControlLineState(uint16_t ctrl_bmp); |
Pawel Zarembski |
0:01f31e923fe2 | 84 | extern int32_t USBD_CDC_ACM_SendBreak(uint16_t dur); |
Pawel Zarembski |
0:01f31e923fe2 | 85 | |
Pawel Zarembski |
0:01f31e923fe2 | 86 | /* USB Device user functions imported to USB Custom Class module */ |
Pawel Zarembski |
0:01f31e923fe2 | 87 | extern void usbd_cls_init(void); |
Pawel Zarembski |
0:01f31e923fe2 | 88 | extern void usbd_cls_sof(void); |
Pawel Zarembski |
0:01f31e923fe2 | 89 | extern BOOL usbd_cls_dev_req(BOOL setup); |
Pawel Zarembski |
0:01f31e923fe2 | 90 | extern BOOL usbd_cls_if_req(BOOL setup); |
Pawel Zarembski |
0:01f31e923fe2 | 91 | extern BOOL usbd_cls_ep_req(BOOL setup); |
Pawel Zarembski |
0:01f31e923fe2 | 92 | |
Pawel Zarembski |
0:01f31e923fe2 | 93 | extern void usbd_bulk_init(void); |
Pawel Zarembski |
0:01f31e923fe2 | 94 | |
Pawel Zarembski |
0:01f31e923fe2 | 95 | #ifdef __cplusplus |
Pawel Zarembski |
0:01f31e923fe2 | 96 | } |
Pawel Zarembski |
0:01f31e923fe2 | 97 | #endif |
Pawel Zarembski |
0:01f31e923fe2 | 98 | |
Pawel Zarembski |
0:01f31e923fe2 | 99 | #endif /* __RL_USB_H__ */ |