Skip to content

Commit df5baf6

Browse files
gpsimenosevedon
authored andcommitted
USB public APIs cleanup (ARMmbed#11034)
The contents of the usb directory were moved to appropriate locations and the usb directory removed. * Public USB headers moved under drivers/ * Internal USB headers moved under drivers/internal/ * USB Source code moved under drivers/source/usb/ * Moved usb/device/hal/ under hal/usb/ * Moved usb/device/USBPhy/ under hal/usb/ * Merged usb/device/targets/ into targets/ * Separated public and private USB API documentation under Doxygen groups drivers-public-api and drivers-internal-api.
1 parent 8013af2 commit df5baf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+214
-43
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2013-2018 Arm Limited. All rights reserved.
1+
# Copyright (c) 2013-2019 Arm Limited. All rights reserved.
22
#
33
# SPDX-License-Identifier: Apache-2.0
44
#
@@ -222,7 +222,7 @@ matrix:
222222
# Check that example compiles without rtos
223223
- sed -n '/``` cpp/,/```/{/```$/Q;/```/d;p;}' ${EVENTS}/README.md > main.cpp
224224
- |
225-
rm -r rtos usb features/cellular features/netsocket features/nanostack \
225+
rm -r rtos drivers/source/usb features/cellular features/netsocket features/nanostack \
226226
features/lwipstack features/frameworks/greentea-client \
227227
features/frameworks/utest features/frameworks/unity components BUILD
228228
- python tools/make.py -t GCC_ARM -m DISCO_F401VC --source=. --build=BUILD/DISCO_F401VC/GCC_ARM -j0

TESTS/usb_device/hid/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, ARM Limited, All Rights Reserved
2+
* Copyright (c) 2018-2019, ARM Limited, All Rights Reserved
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may

TESTS/usb_device/serial/main.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, ARM Limited, All Rights Reserved
2+
* Copyright (c) 2018-2019, ARM Limited, All Rights Reserved
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License"); you may

usb/device/USBAudio/USBAudio.h drivers/USBAudio.h

+12
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@
2828
#include "ByteBuffer.h"
2929
#include "rtos/EventFlags.h"
3030

31+
/** \ingroup drivers */
32+
/** \addtogroup drivers-public-api */
33+
/** @{*/
34+
/**
35+
* \defgroup drivers_USBAudio USBAudio class
36+
* @{
37+
*/
38+
39+
3140
/**
3241
* USBAudio example
3342
*
@@ -373,4 +382,7 @@ class USBAudio: protected USBDevice {
373382

374383
};
375384

385+
/** @}*/
386+
/** @}*/
387+
376388
#endif

usb/device/USBSerial/USBCDC.h drivers/USBCDC.h

+11
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727

2828
class AsyncOp;
2929

30+
/** \ingroup drivers */
31+
/** \addtogroup drivers-public-api */
32+
/** @{*/
33+
/**
34+
* \defgroup drivers_USBCDC USBCDC class
35+
* @{
36+
*/
37+
3038
class USBCDC: public USBDevice {
3139
public:
3240

@@ -224,4 +232,7 @@ class USBCDC: public USBDevice {
224232
uint32_t _rx_size;
225233
};
226234

235+
/** @}*/
236+
/** @}*/
237+
227238
#endif

usb/device/USBCDC_ECM/USBCDC_ECM.h drivers/USBCDC_ECM.h

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2018, Arm Limited and affiliates.
2+
* Copyright (c) 2018-2019, Arm Limited and affiliates.
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -38,6 +38,14 @@
3838
#define PACKET_TYPE_BROADCAST (1<<3)
3939
#define PACKET_TYPE_MULTICAST (1<<4)
4040

41+
/** \ingroup drivers */
42+
/** \addtogroup drivers-public-api */
43+
/** @{*/
44+
/**
45+
* \defgroup drivers_USBCDC_ECM USBCDC_ECM class
46+
* @{
47+
*/
48+
4149
class USBCDC_ECM: public USBDevice {
4250
public:
4351

@@ -267,4 +275,7 @@ class USBCDC_ECM: public USBDevice {
267275
void _notify_connect();
268276
};
269277

278+
/** @}*/
279+
/** @}*/
280+
270281
#endif

usb/device/USBHID/USBHID.h drivers/USBHID.h

+10
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,13 @@
2626
#include "OperationList.h"
2727

2828

29+
/** \ingroup drivers */
30+
/** \addtogroup drivers-public-api */
31+
/** @{*/
32+
/**
33+
* \defgroup drivers_USBHID USBHID class
34+
* @{
35+
*/
2936

3037
/**
3138
* USBHID example
@@ -268,4 +275,7 @@ class USBHID: public USBDevice {
268275

269276
};
270277

278+
/** @}*/
279+
/** @}*/
280+
271281
#endif

usb/device/USBHID/USBKeyboard.h drivers/USBKeyboard.h

+12-1
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ enum FUNCTION_KEY {
7474
UP_ARROW, /* Up arrow */
7575
};
7676

77+
/** \ingroup drivers */
78+
/** \addtogroup drivers-public-api */
79+
/** @{*/
80+
/**
81+
* \defgroup drivers_USBKeyboard USBKeyboard class
82+
* @{
83+
*/
84+
7785
/**
7886
* USBKeyboard example
7987
* @code
@@ -181,7 +189,7 @@ class USBKeyboard: public USBHID, public mbed::Stream {
181189
virtual void report_rx();
182190

183191
/**
184-
* Read status of lock keys. Useful to switch-on/off leds according to key pressed. Only the first three bits of the result is important:
192+
* Read status of lock keys. Useful to switch-on/off LEDs according to key pressed. Only the first three bits of the result is important:
185193
* - First bit: NUM_LOCK
186194
* - Second bit: CAPS_LOCK
187195
* - Third bit: SCROLL_LOCK
@@ -209,4 +217,7 @@ class USBKeyboard: public USBHID, public mbed::Stream {
209217

210218
};
211219

220+
/** @}*/
221+
/** @}*/
222+
212223
#endif

usb/device/USBMIDI/USBMIDI.h drivers/USBMIDI.h

+11
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,14 @@
3030

3131
#define DEFAULT_CONFIGURATION (1)
3232

33+
/** \ingroup drivers */
34+
/** \addtogroup drivers-public-api */
35+
/** @{*/
36+
/**
37+
* \defgroup drivers_USBMIDI USBMIDI class
38+
* @{
39+
*/
40+
3341
/**
3442
* USBMIDI example
3543
*
@@ -182,4 +190,7 @@ class USBMIDI: public USBDevice {
182190
bool _next_message();
183191
};
184192

193+
/** @}*/
194+
/** @}*/
195+
185196
#endif

usb/device/USBMSD/USBMSD.h drivers/USBMSD.h

+14-3
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,27 @@
2222
#include "USBDescriptor.h"
2323
#include "USBDevice_Types.h"
2424
#include "platform/Callback.h"
25-
#include "events/PolledQueue.h"
26-
#include "events/Task.h"
25+
#include "drivers/internal/PolledQueue.h"
26+
#include "drivers/internal/Task.h"
2727
#include "BlockDevice.h"
2828
#include "Mutex.h"
2929

3030
#include "USBDevice.h"
3131

32+
/** \ingroup drivers */
33+
/** \addtogroup drivers-public-api */
34+
/** @{*/
35+
/**
36+
* \defgroup drivers_USBMSD USBMSD class
37+
* @{
38+
*/
39+
3240
/**
3341
* USBMSD class: generic class in order to use all kinds of blocks storage chip
3442
*
3543
* Introduction
3644
*
37-
* USBMSD implements the MSD protocol. It permits to access a block device (flash, sdcard,...)
45+
* USBMSD implements the MSD protocol. It permits to access a block device (flash, SD Card,...)
3846
* from a computer over USB.
3947
*
4048
* @code
@@ -304,4 +312,7 @@ class USBMSD: public USBDevice {
304312
void fail();
305313
};
306314

315+
/** @}*/
316+
/** @}*/
317+
307318
#endif

usb/device/USBHID/USBMouse.h drivers/USBMouse.h

+11
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ enum MOUSE_TYPE {
4949
REL_MOUSE,
5050
};
5151

52+
/** \ingroup drivers */
53+
/** \addtogroup drivers-public-api */
54+
/** @{*/
55+
/**
56+
* \defgroup drivers_USBMouse USBMouse class
57+
* @{
58+
*/
59+
5260
/**
5361
*
5462
* USBMouse example
@@ -232,4 +240,7 @@ class USBMouse: public USBHID {
232240
bool mouse_send(int8_t x, int8_t y, uint8_t buttons, int8_t z);
233241
};
234242

243+
/** @}*/
244+
/** @}*/
245+
235246
#endif

usb/device/USBHID/USBMouseKeyboard.h drivers/USBMouseKeyboard.h

+12-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@
2828
#include "USBHID.h"
2929
#include "PlatformMutex.h"
3030

31+
/** \ingroup drivers */
32+
/** \addtogroup drivers-public-api */
33+
/** @{*/
34+
/**
35+
* \defgroup drivers_USBMouseKeyboard USBMouseKeyboard class
36+
* @{
37+
*/
38+
3139
/**
3240
* USBMouseKeyboard example
3341
* @code
@@ -207,7 +215,7 @@ class USBMouseKeyboard: public USBHID, public mbed::Stream {
207215
bool media_control(MEDIA_KEY key);
208216

209217
/**
210-
* Read status of lock keys. Useful to switch-on/off leds according to key pressed. Only the first three bits of the result is important:
218+
* Read status of lock keys. Useful to switch-on/off LEDs according to key pressed. Only the first three bits of the result is important:
211219
* - First bit: NUM_LOCK
212220
* - Second bit: CAPS_LOCK
213221
* - Third bit: SCROLL_LOCK
@@ -243,4 +251,7 @@ class USBMouseKeyboard: public USBHID, public mbed::Stream {
243251
virtual int _getc();
244252
};
245253

254+
/** @}*/
255+
/** @}*/
256+
246257
#endif

usb/device/USBSerial/USBSerial.h drivers/USBSerial.h

+11
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@
2222
#include "Stream.h"
2323
#include "Callback.h"
2424

25+
/** \ingroup drivers */
26+
/** \addtogroup drivers-public-api */
27+
/** @{*/
28+
/**
29+
* \defgroup drivers_USBSerial USBSerial class
30+
* @{
31+
*/
32+
2533
/**
2634
* USBSerial example
2735
*
@@ -216,4 +224,7 @@ class USBSerial: public USBCDC, public mbed::Stream {
216224
void (*_settings_changed_callback)(int baud, int bits, int parity, int stop);
217225
};
218226

227+
/** @}*/
228+
/** @}*/
229+
219230
#endif

usb/device/utilities/AsyncOp.h drivers/internal/AsyncOp.h

+10
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@
2525
#include "LinkEntry.h"
2626
#include "OperationListBase.h"
2727

28+
/** \ingroup drivers */
29+
/** \addtogroup drivers-internal-api */
30+
/** @{*/
31+
/**
32+
* \defgroup drivers_AsyncOp AsyncOp class
33+
* @{
34+
*/
2835
class AsyncOp: public LinkEntry {
2936
public:
3037

@@ -109,4 +116,7 @@ class AsyncOp: public LinkEntry {
109116
static void _host_unlock(rtos::Mutex *host_mutex);
110117
};
111118

119+
/** @}*/
120+
/** @}*/
121+
112122
#endif

usb/device/utilities/ByteBuffer.h drivers/internal/ByteBuffer.h

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020

2121
#include <stdint.h>
2222

23+
/** \ingroup drivers */
24+
/** \addtogroup drivers-internal-api */
25+
/** @{*/
26+
/**
27+
* \defgroup drivers_ByteBuffer ByteBuffer class
28+
* @{
29+
*/
2330
class ByteBuffer {
2431
public:
2532

@@ -116,5 +123,7 @@ class ByteBuffer {
116123
uint8_t *_buf;
117124
};
118125

126+
/** @}*/
127+
/** @}*/
119128

120129
#endif

usb/device/USBDevice/EndpointResolver.h drivers/internal/EndpointResolver.h

+10-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,14 @@
2929
* to check if the device has enough resources for the
3030
* given configuration.
3131
*
32-
* @ingroup usb_device_core
32+
*/
33+
34+
/** \ingroup drivers */
35+
/** \addtogroup drivers-internal-api */
36+
/** @{*/
37+
/**
38+
* \defgroup drivers_EndpointResolver EndpointResolver class
39+
* @{
3340
*/
3441
class EndpointResolver {
3542
public:
@@ -89,5 +96,7 @@ class EndpointResolver {
8996
bool _valid;
9097
};
9198

99+
/** @}*/
100+
/** @}*/
92101

93102
#endif

usb/device/utilities/LinkEntry.h drivers/internal/LinkEntry.h

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@
2020

2121
#include <cstddef>
2222

23+
/** \ingroup drivers */
24+
/** \addtogroup drivers-internal-api */
25+
/** @{*/
26+
/**
27+
* \defgroup drivers_LinkEntry LinkEntry class
28+
* @{
29+
*/
2330
class LinkEntry {
2431
public:
2532
LinkEntry(): _next(NULL)
@@ -32,5 +39,7 @@ class LinkEntry {
3239
LinkEntry *_next;
3340
};
3441

42+
/** @}*/
43+
/** @}*/
3544

3645
#endif

0 commit comments

Comments
 (0)