Skip to content

Commit 7d74165

Browse files
author
Seppo Takalo
authored
Merge pull request #11073 from ARMmbed/feature-public-headers
Feature public headers
2 parents 5f6379a + df85e8e commit 7d74165

File tree

277 files changed

+2076
-1093
lines changed

Some content is hidden

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

277 files changed

+2076
-1093
lines changed

.travis.yml

Lines changed: 4 additions & 4 deletions
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,14 +222,14 @@ 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
229229
# Run local equeue tests
230-
- make -C ${EVENTS}/equeue test
230+
- make -C ${EVENTS}/source test
231231
# Run profiling tests
232-
- make -C ${EVENTS}/equeue prof | tee prof
232+
- make -C ${EVENTS}/source prof | tee prof
233233
after_success:
234234
# Update status, comparing with master if possible.
235235
- |

TESTS/mbed_hal/lp_ticker/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include "lp_ticker_api_tests.h"
2222
#include "hal/lp_ticker_api.h"
2323
#include "hal/mbed_lp_ticker_wrapper.h"
24+
#include "hal/us_ticker_api.h"
2425

2526
#if !DEVICE_LPTICKER
2627
#error [NOT_SUPPORTED] Low power timer not supported for this target

TESTS/mbed_hal/qspi/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "mbed.h"
2828
#include "qspi_api.h"
29+
#include "hal/us_ticker_api.h"
2930

3031

3132
#if !defined(QSPI_FLASH_CHIP_STRING)

TESTS/mbed_hal/qspi/qspi_test_utils.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "utest/utest.h"
1818

1919
#include "hal/qspi_api.h"
20+
#include "hal/us_ticker_api.h"
2021
#include "qspi_test_utils.h"
2122

2223
#include "unity/unity.h"

TESTS/mbed_hal/sleep/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include "unity/unity.h"
2525
#include "greentea-client/test_env.h"
2626
#include "mbed_lp_ticker_wrapper.h"
27+
#include "hal/us_ticker_api.h"
2728

2829
#include "sleep_test_utils.h"
2930
#include "sleep_api_tests.h"

TESTS/mbed_hal/sleep_manager/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <limits.h>
2020
#include "mbed.h"
2121
#include "mbed_lp_ticker_wrapper.h"
22+
#include "hal/us_ticker_api.h"
2223
#include "../sleep/sleep_test_utils.h"
2324
#include "sleep_manager_api_tests.h"
2425

TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
#include "unity/unity.h"
2828
#include "greentea-client/test_env.h"
2929

30+
#include "platform/mbed_critical.h"
31+
3032
using namespace utest::v1;
3133

3234
#include <stdlib.h>

TESTS/usb_device/hid/main.cpp

Lines changed: 2 additions & 1 deletion
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
@@ -27,6 +27,7 @@
2727
#include "USBHID.h"
2828
#include "USBMouse.h"
2929
#include "USBKeyboard.h"
30+
#include "hal/us_ticker_api.h"
3031

3132
// Reuse the VID & PID from basic USB test.
3233
#define USB_HID_VID 0x0d28

TESTS/usb_device/serial/main.cpp

Lines changed: 2 additions & 1 deletion
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
@@ -26,6 +26,7 @@
2626
#include "usb_phy_api.h"
2727
#include "USBCDC.h"
2828
#include "USBSerial.h"
29+
#include "hal/us_ticker_api.h"
2930

3031
#define USB_CDC_VID 0x1f00
3132
#define USB_CDC_PID 0x2013

UNITTESTS/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,8 @@ set(unittest-includes-base
105105
"${PROJECT_SOURCE_DIR}/../drivers"
106106
"${PROJECT_SOURCE_DIR}/../hal"
107107
"${PROJECT_SOURCE_DIR}/../events"
108-
"${PROJECT_SOURCE_DIR}/../events/equeue"
108+
"${PROJECT_SOURCE_DIR}/../events/source"
109+
"${PROJECT_SOURCE_DIR}/../events/internal"
109110
"${PROJECT_SOURCE_DIR}/../rtos"
110111
"${PROJECT_SOURCE_DIR}/../rtos/TARGET_CORTEX"
111112
"${PROJECT_SOURCE_DIR}/../rtos/TARGET_CORTEX/rtx5/Include"

UNITTESTS/drivers/Watchdog/unittest.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ set(unittest-includes ${unittest-includes}
1212

1313
# Source files
1414
set(unittest-sources
15-
../drivers/Watchdog.cpp
15+
../drivers/source/Watchdog.cpp
1616
)
1717

1818
# Test files

UNITTESTS/stubs/SerialBase_stub.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* limitations under the License.
1616
*/
1717

18-
#include "SerialBase.h"
18+
#include "drivers/SerialBase.h"
1919

2020
namespace mbed {
2121

UNITTESTS/target_h/drivers/LowPowerTicker.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include "Callback.h"
2222

2323
namespace mbed {
24-
/** \addtogroup drivers */
2524

2625
/** mock Low Power Ticker
2726
*

components/802.15.4_RF/atmel-rf-driver/source/NanostackRfPhyAtmel.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
#include "SPI.h"
3333
#include "inttypes.h"
3434
#include "Timeout.h"
35+
#include "platform/mbed_error.h"
3536

3637
#define TRACE_GROUP "AtRF"
3738

components/802.15.4_RF/mcr20a-rf-driver/source/NanostackRfPhyMcr20a.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include <string.h>
2424
#include "rtos.h"
2525
#include "mbed_interface.h"
26+
#include "platform/mbed_error.h"
2627

2728
using namespace mbed;
2829
using namespace rtos;

components/802.15.4_RF/stm-s2lp-rf-driver/source/NanostackRfPhys2lp.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
#include "Timeout.h"
3030
#include "Thread.h"
3131
#include "mbed_wait_api.h"
32+
#include "platform/mbed_error.h"
3233

3334
using namespace mbed;
3435
using namespace rtos;

drivers/AnalogIn.h

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2006-2013 ARM Limited
2+
* Copyright (c) 2006-2019 ARM Limited
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,21 @@
2626
#include "platform/PlatformMutex.h"
2727

2828
namespace mbed {
29-
/** \addtogroup drivers */
29+
/** \defgroup mbed-os-public Public API */
30+
31+
/** \addtogroup drivers-public-api Drivers
32+
* \ingroup mbed-os-public
33+
*/
34+
35+
/** \defgroup drivers-public-api-gpio GPIO
36+
* \ingroup drivers-public-api
37+
*/
38+
39+
/**
40+
* \defgroup drivers_AnalogIn AnalogIn class
41+
* \ingroup drivers-public-api-gpio
42+
* @{
43+
*/
3044

3145
/** An analog input, used for reading the voltage on a pin
3246
*
@@ -48,7 +62,6 @@ namespace mbed {
4862
* }
4963
* }
5064
* @endcode
51-
* @ingroup drivers
5265
*/
5366
class AnalogIn {
5467

@@ -58,37 +71,20 @@ class AnalogIn {
5871
*
5972
* @param pin AnalogIn pin to connect to
6073
*/
61-
AnalogIn(PinName pin)
62-
{
63-
lock();
64-
analogin_init(&_adc, pin);
65-
unlock();
66-
}
74+
AnalogIn(PinName pin);
6775

6876
/** Read the input voltage, represented as a float in the range [0.0, 1.0]
6977
*
7078
* @returns A floating-point value representing the current input voltage, measured as a percentage
7179
*/
72-
float read()
73-
{
74-
lock();
75-
float ret = analogin_read(&_adc);
76-
unlock();
77-
return ret;
78-
}
80+
float read();
7981

8082
/** Read the input voltage, represented as an unsigned short in the range [0x0, 0xFFFF]
8183
*
8284
* @returns
8385
* 16-bit unsigned short representing the current input voltage, normalized to a 16-bit value
8486
*/
85-
unsigned short read_u16()
86-
{
87-
lock();
88-
unsigned short ret = analogin_read_u16(&_adc);
89-
unlock();
90-
return ret;
91-
}
87+
unsigned short read_u16();
9288

9389
/** An operator shorthand for read()
9490
*
@@ -129,8 +125,11 @@ class AnalogIn {
129125
analogin_t _adc;
130126
static SingletonPtr<PlatformMutex> _mutex;
131127
#endif //!defined(DOXYGEN_ONLY)
128+
132129
};
133130

131+
/** @}*/
132+
134133
} // namespace mbed
135134

136135
#endif

drivers/AnalogOut.h

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2006-2013 ARM Limited
2+
* Copyright (c) 2006-2019 ARM Limited
33
* SPDX-License-Identifier: Apache-2.0
44
*
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -25,7 +25,13 @@
2525
#include "platform/PlatformMutex.h"
2626

2727
namespace mbed {
28-
/** \addtogroup drivers */
28+
/** \addtogroup drivers-public-api */
29+
30+
/**
31+
* \defgroup drivers_AnalogOut AnalogOut class
32+
* \ingroup drivers-public-api-gpio
33+
* @{
34+
*/
2935

3036
/** An analog output, used for setting the voltage on a pin
3137
*
@@ -48,7 +54,6 @@ namespace mbed {
4854
* }
4955
* }
5056
* @endcode
51-
* @ingroup drivers
5257
*/
5358
class AnalogOut {
5459

@@ -70,24 +75,14 @@ class AnalogOut {
7075
* 0.0f (representing 0v / 0%) and 1.0f (representing 3.3v / 100%).
7176
* Values outside this range will be saturated to 0.0f or 1.0f.
7277
*/
73-
void write(float value)
74-
{
75-
lock();
76-
analogout_write(&_dac, value);
77-
unlock();
78-
}
78+
void write(float value);
7979

8080
/** Set the output voltage, represented as an unsigned short in the range [0x0, 0xFFFF]
8181
*
8282
* @param value 16-bit unsigned short representing the output voltage,
8383
* normalized to a 16-bit value (0x0000 = 0v, 0xFFFF = 3.3v)
8484
*/
85-
void write_u16(unsigned short value)
86-
{
87-
lock();
88-
analogout_write_u16(&_dac, value);
89-
unlock();
90-
}
85+
void write_u16(unsigned short value);
9186

9287
/** Return the current output voltage setting, measured as a percentage (float)
9388
*
@@ -99,13 +94,7 @@ class AnalogOut {
9994
* @note
10095
* This value may not match exactly the value set by a previous write().
10196
*/
102-
float read()
103-
{
104-
lock();
105-
float ret = analogout_read(&_dac);
106-
unlock();
107-
return ret;
108-
}
97+
float read();
10998

11099
/** An operator shorthand for write()
111100
* \sa AnalogOut::write()
@@ -158,6 +147,8 @@ class AnalogOut {
158147
#endif //!defined(DOXYGEN_ONLY)
159148
};
160149

150+
/** @}*/
151+
161152
} // namespace mbed
162153

163154
#endif

drivers/BusIn.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,15 @@
2323
#include "platform/NonCopyable.h"
2424

2525
namespace mbed {
26-
/** \addtogroup drivers */
26+
/**
27+
* \defgroup drivers_BusIn BusIn class
28+
* \ingroup drivers-public-api-gpio
29+
* @{
30+
*/
2731

2832
/** A digital input bus, used for reading the state of a collection of pins
2933
*
3034
* @note Synchronization level: Thread safe
31-
* @ingroup drivers
3235
*/
3336
class BusIn : private NonCopyable<BusIn> {
3437

@@ -125,6 +128,8 @@ class BusIn : private NonCopyable<BusIn> {
125128
#endif
126129
};
127130

131+
/** @}*/
132+
128133
} // namespace mbed
129134

130135
#endif

drivers/BusInOut.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,18 @@
2222
#include "platform/NonCopyable.h"
2323

2424
namespace mbed {
25-
/** \addtogroup drivers */
25+
/**
26+
* \defgroup drivers_BusInOut BusInOut class
27+
* \ingroup drivers-public-api-gpio
28+
* @{
29+
*/
2630

2731
/** A digital input output bus, used for setting the state of a collection of pins.
2832
* Implemented as an array of DigitalInOut pins, the bus can be constructed by any
2933
* pins without restriction other than being capable of digital input or output
3034
* capabilities
3135
*
3236
* @note Synchronization level: Thread safe
33-
* @ingroup drivers
3437
*/
3538
class BusInOut : private NonCopyable<BusInOut> {
3639

@@ -147,6 +150,8 @@ class BusInOut : private NonCopyable<BusInOut> {
147150
#endif //!defined(DOXYGEN_ONLY)
148151
};
149152

153+
/** @}*/
154+
150155
} // namespace mbed
151156

152157
#endif

0 commit comments

Comments
 (0)