Skip to content

Commit 0404701

Browse files
author
Cruz Monrreal
authored
Merge pull request #8694 from cmonr/rollup
Rollup PR: Bring small fixes into 5.10.4
2 parents 00fcdb8 + 6ab56d9 commit 0404701

File tree

18 files changed

+100
-229
lines changed

18 files changed

+100
-229
lines changed

drivers/BusIn.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ class BusIn : private NonCopyable<BusIn> {
106106
*/
107107
DigitalIn &operator[](int index);
108108

109+
#if !defined(DOXYGEN_ONLY)
109110
protected:
110111
DigitalIn *_pin[16];
111112

@@ -120,6 +121,7 @@ class BusIn : private NonCopyable<BusIn> {
120121
private:
121122
virtual void lock();
122123
virtual void unlock();
124+
#endif
123125
};
124126

125127
} // namespace mbed

drivers/BusInOut.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,15 +83,15 @@ class BusInOut : private NonCopyable<BusInOut> {
8383
*/
8484
int read();
8585

86-
/** Set as an output
86+
/** Set all the pins in bus as output
8787
*/
8888
void output();
8989

90-
/** Set as an input
90+
/** Set all the pins in bus as an input
9191
*/
9292
void input();
9393

94-
/** Set the input pin mode
94+
/** Set the input pin mode for all the pins in bus
9595
*
9696
* @param pull PullUp, PullDown, PullNone
9797
*/
@@ -124,7 +124,7 @@ class BusInOut : private NonCopyable<BusInOut> {
124124
* \sa BusInOut::read()
125125
*/
126126
operator int();
127-
127+
#if !defined(DOXYGEN_ONLY)
128128
protected:
129129
virtual void lock();
130130
virtual void unlock();
@@ -137,6 +137,7 @@ class BusInOut : private NonCopyable<BusInOut> {
137137
int _nc_mask;
138138

139139
PlatformMutex _mutex;
140+
#endif
140141
};
141142

142143
} // namespace mbed

drivers/BusOut.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class BusOut : private NonCopyable<BusOut> {
108108
* \sa BusOut::read()
109109
*/
110110
operator int();
111-
111+
#if !defined(DOXYGEN_ONLY)
112112
protected:
113113
virtual void lock();
114114
virtual void unlock();
@@ -121,6 +121,7 @@ class BusOut : private NonCopyable<BusOut> {
121121
int _nc_mask;
122122

123123
PlatformMutex _mutex;
124+
#endif
124125
};
125126

126127
} // namespace mbed

drivers/FlashIAP.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ class FlashIAP : private NonCopyable<FlashIAP> {
138138
*/
139139
uint8_t get_erase_value() const;
140140

141+
#if !defined(DOXYGEN_ONLY)
141142
private:
142143

143144
/* Check if address and size are aligned to a sector
@@ -151,6 +152,7 @@ class FlashIAP : private NonCopyable<FlashIAP> {
151152
flash_t _flash;
152153
uint8_t *_page_buf;
153154
static SingletonPtr<PlatformMutex> _mutex;
155+
#endif
154156
};
155157

156158
} /* namespace mbed */

drivers/I2C.h

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class I2C : private NonCopyable<I2C> {
108108
* @param data Pointer to the byte-array to read data in to
109109
* @param length Number of bytes to read
110110
* @param repeated Repeated start, true - don't send stop at end
111-
* default value is false.
111+
* default value is false.
112112
*
113113
* @returns
114114
* 0 on success (ack),
@@ -134,7 +134,7 @@ class I2C : private NonCopyable<I2C> {
134134
* @param data Pointer to the byte-array data to send
135135
* @param length Number of bytes to send
136136
* @param repeated Repeated start, true - do not send stop at end
137-
* default value is false.
137+
* default value is false.
138138
*
139139
* @returns
140140
* 0 on success (ack),
@@ -188,8 +188,8 @@ class I2C : private NonCopyable<I2C> {
188188
* @param event The logical OR of events to modify
189189
* @param callback The event callback function
190190
* @param repeated Repeated start, true - do not send stop at end
191-
* default value is false.
192-
*
191+
* default value is false.
192+
*
193193
* @returns Zero if the transfer has started, or -1 if I2C peripheral is busy
194194
*/
195195
int transfer(int address, const char *tx_buffer, int tx_length, char *rx_buffer, int rx_length, const event_callback_t &callback, int event = I2C_EVENT_TRANSFER_COMPLETE, bool repeated = false);
@@ -198,6 +198,7 @@ class I2C : private NonCopyable<I2C> {
198198
*/
199199
void abort_transfer();
200200

201+
#if !defined(DOXYGEN_ONLY)
201202
protected:
202203
/** Lock deep sleep only if it is not yet locked */
203204
void lock_deep_sleep();
@@ -211,6 +212,7 @@ class I2C : private NonCopyable<I2C> {
211212
DMAUsage _usage;
212213
bool _deep_sleep_locked;
213214
#endif
215+
#endif
214216

215217
#if !defined(DOXYGEN_ONLY)
216218
protected:
@@ -222,7 +224,6 @@ class I2C : private NonCopyable<I2C> {
222224
static SingletonPtr<PlatformMutex> _mutex;
223225
PinName _sda;
224226
PinName _scl;
225-
#endif
226227

227228
private:
228229
/** Recover I2C bus, when stuck with SDA low
@@ -237,6 +238,7 @@ class I2C : private NonCopyable<I2C> {
237238
*
238239
*/
239240
int recover(PinName sda, PinName scl);
241+
#endif
240242
};
241243

242244
} // namespace mbed

drivers/InterruptManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ class InterruptManager : private NonCopyable<InterruptManager> {
166166
"public API of mbed-os and is being removed in the future.")
167167
bool remove_handler(pFunctionPointer_t handler, IRQn_Type irq);
168168

169+
#if !defined(DOXYGEN_ONLY)
169170
private:
170171
InterruptManager();
171172
~InterruptManager();
@@ -198,6 +199,7 @@ class InterruptManager : private NonCopyable<InterruptManager> {
198199
CallChain *_chains[NVIC_NUM_VECTORS];
199200
static InterruptManager *_instance;
200201
PlatformMutex _mutex;
202+
#endif
201203
};
202204

203205
} // namespace mbed

drivers/LowPowerTimeout.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ namespace mbed {
3333
* @ingroup drivers
3434
*/
3535
class LowPowerTimeout : public LowPowerTicker, private NonCopyable<LowPowerTimeout> {
36-
36+
#if !defined(DOXYGEN_ONLY)
3737
private:
3838
virtual void handler(void)
3939
{
4040
_function.call();
4141
}
42+
#endif
4243
};
4344

4445
}

drivers/MbedCRC.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ class MbedCRC {
302302
return width;
303303
}
304304

305+
#if !defined(DOXYGEN_ONLY)
305306
private:
306307
uint32_t _initial_value;
307308
uint32_t _final_xor;
@@ -546,6 +547,7 @@ class MbedCRC {
546547
}
547548
_mode = (_crc_table != NULL) ? TABLE : BITWISE;
548549
}
550+
#endif
549551
};
550552

551553
#if defined ( __CC_ARM )

drivers/SPI.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ class SPI : private NonCopyable<SPI> {
208208
*/
209209
int set_dma_usage(DMAUsage usage);
210210

211+
#if !defined(DOXYGEN_ONLY)
211212
protected:
212213
/** SPI interrupt handler.
213214
*/
@@ -263,8 +264,6 @@ class SPI : private NonCopyable<SPI> {
263264
*/
264265
void start_transfer(const void *tx_buffer, int tx_length, void *rx_buffer, int rx_length, unsigned char bit_width, const event_callback_t &callback, int event);
265266

266-
#if !defined(DOXYGEN_ONLY)
267-
268267
private:
269268
/** Lock deep sleep only if it is not yet locked */
270269
void lock_deep_sleep();
@@ -294,7 +293,6 @@ class SPI : private NonCopyable<SPI> {
294293
#endif //DEVICE_SPI_ASYNCH
295294

296295
#if !defined(DOXYGEN_ONLY)
297-
298296
protected:
299297
/* Internal SPI object identifying the resources */
300298
spi_t _spi;

drivers/SerialBase.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ class SerialBase : private NonCopyable<SerialBase> {
141141
*/
142142
void send_break();
143143

144+
#if !defined(DOXYGEN_ONLY)
144145
protected:
145146

146147
/** Acquire exclusive access to this serial port
@@ -150,7 +151,7 @@ class SerialBase : private NonCopyable<SerialBase> {
150151
/** Release exclusive access to this serial port
151152
*/
152153
virtual void unlock(void);
153-
154+
#endif
154155
public:
155156

156157
#if DEVICE_SERIAL_FC
@@ -235,12 +236,15 @@ class SerialBase : private NonCopyable<SerialBase> {
235236
*/
236237
int set_dma_usage_rx(DMAUsage usage);
237238

239+
#if !defined(DOXYGEN_ONLY)
238240
protected:
239241
void start_read(void *buffer, int buffer_size, char buffer_width, const event_callback_t &callback, int event, unsigned char char_match);
240242
void start_write(const void *buffer, int buffer_size, char buffer_width, const event_callback_t &callback, int event);
241243
void interrupt_handler_asynch(void);
242244
#endif
245+
#endif
243246

247+
#if !defined(DOXYGEN_ONLY)
244248
protected:
245249
SerialBase(PinName tx, PinName rx, int baud);
246250
virtual ~SerialBase();
@@ -259,7 +263,7 @@ class SerialBase : private NonCopyable<SerialBase> {
259263
serial_t _serial;
260264
Callback<void()> _irq[IrqCnt];
261265
int _baud;
262-
266+
#endif
263267
};
264268

265269
} // namespace mbed

drivers/Timeout.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@ namespace mbed {
5656
*/
5757
class Timeout : public Ticker, private NonCopyable<Timeout> {
5858

59+
#if !defined(DOXYGEN_ONLY)
5960
protected:
6061
virtual void handler();
62+
#endif
6163
};
6264

6365
} // namespace mbed

drivers/TimerEvent.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class TimerEvent : private NonCopyable<TimerEvent> {
4343
*/
4444
virtual ~TimerEvent();
4545

46+
#if !defined(DOXYGEN_ONLY)
4647
protected:
4748
// The handler called to service the timer event of the derived class
4849
virtual void handler() = 0;
@@ -77,6 +78,7 @@ class TimerEvent : private NonCopyable<TimerEvent> {
7778
ticker_event_t event;
7879

7980
const ticker_data_t *_ticker_data;
81+
#endif
8082
};
8183

8284
} // namespace mbed

targets/TARGET_STM/TARGET_STM32F2/pin_device.h

Lines changed: 1 addition & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -32,76 +32,7 @@
3232

3333
#include "cmsis.h"
3434

35-
// when LL is available, below include can be used
36-
// #include "stm32f2xx_ll_gpio.h"
37-
// until then let's define locally the required functions
38-
#define LL_GPIO_PIN_0 GPIO_BSRR_BS0 /*!< Select pin 0 */
39-
#define LL_GPIO_PIN_1 GPIO_BSRR_BS1 /*!< Select pin 1 */
40-
#define LL_GPIO_PIN_2 GPIO_BSRR_BS2 /*!< Select pin 2 */
41-
#define LL_GPIO_PIN_3 GPIO_BSRR_BS3 /*!< Select pin 3 */
42-
#define LL_GPIO_PIN_4 GPIO_BSRR_BS4 /*!< Select pin 4 */
43-
#define LL_GPIO_PIN_5 GPIO_BSRR_BS5 /*!< Select pin 5 */
44-
#define LL_GPIO_PIN_6 GPIO_BSRR_BS6 /*!< Select pin 6 */
45-
#define LL_GPIO_PIN_7 GPIO_BSRR_BS7 /*!< Select pin 7 */
46-
#define LL_GPIO_PIN_8 GPIO_BSRR_BS8 /*!< Select pin 8 */
47-
#define LL_GPIO_PIN_9 GPIO_BSRR_BS9 /*!< Select pin 9 */
48-
#define LL_GPIO_PIN_10 GPIO_BSRR_BS10 /*!< Select pin 10 */
49-
#define LL_GPIO_PIN_11 GPIO_BSRR_BS11 /*!< Select pin 11 */
50-
#define LL_GPIO_PIN_12 GPIO_BSRR_BS12 /*!< Select pin 12 */
51-
#define LL_GPIO_PIN_13 GPIO_BSRR_BS13 /*!< Select pin 13 */
52-
#define LL_GPIO_PIN_14 GPIO_BSRR_BS14 /*!< Select pin 14 */
53-
#define LL_GPIO_PIN_15 GPIO_BSRR_BS15 /*!< Select pin 15 */
54-
55-
#define LL_GPIO_MODE_INPUT ((uint32_t)0x00000000U) /*!< Select input mode */
56-
#define LL_GPIO_MODE_OUTPUT GPIO_MODER_MODE0_0 /*!< Select output mode */
57-
#define LL_GPIO_MODE_ALTERNATE GPIO_MODER_MODE0_1 /*!< Select alternate function mode */
58-
#define LL_GPIO_MODE_ANALOG GPIO_MODER_MODE0 /*!< Select analog mode */
59-
60-
#define LL_GPIO_OUTPUT_PUSHPULL ((uint32_t)0x00000000U) /*!< Select push-pull as output type */
61-
#define LL_GPIO_OUTPUT_OPENDRAIN GPIO_OTYPER_OT0 /*!< Select open-drain as output type */
62-
63-
#define LL_GPIO_PULL_NO ((uint32_t)0x00000000U) /*!< Select I/O no pull */
64-
#define LL_GPIO_PULL_UP GPIO_PUPDR_PUPD0_0 /*!< Select I/O pull up */
65-
#define LL_GPIO_PULL_DOWN GPIO_PUPDR_PUPD0_1 /*!< Select I/O pull down */
66-
67-
#define LL_GPIO_SPEED_FREQ_LOW ((uint32_t)0x00000000U) /*!< Select I/O low output speed */
68-
#define LL_GPIO_SPEED_FREQ_MEDIUM GPIO_OSPEEDER_OSPEEDR0_0 /*!< Select I/O medium output speed */
69-
#define LL_GPIO_SPEED_FREQ_HIGH GPIO_OSPEEDER_OSPEEDR0_1 /*!< Select I/O fast output speed */
70-
#define LL_GPIO_SPEED_FREQ_VERY_HIGH GPIO_OSPEEDER_OSPEEDR0 /*!< Select I/O high output speed */
71-
72-
__STATIC_INLINE void LL_GPIO_SetAFPin_0_7(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
73-
{
74-
MODIFY_REG(GPIOx->AFR[0], (GPIO_AFRL_AFSEL0 << (POSITION_VAL(Pin) * 4U)),
75-
(Alternate << (POSITION_VAL(Pin) * 4U)));
76-
}
77-
78-
__STATIC_INLINE void LL_GPIO_SetAFPin_8_15(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Alternate)
79-
{
80-
MODIFY_REG(GPIOx->AFR[1], (GPIO_AFRH_AFSEL8 << (POSITION_VAL(Pin >> 8U) * 4U)),
81-
(Alternate << (POSITION_VAL(Pin >> 8U) * 4U)));
82-
}
83-
__STATIC_INLINE void LL_GPIO_SetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Mode)
84-
{
85-
MODIFY_REG(GPIOx->MODER, (GPIO_MODER_MODE0 << (POSITION_VAL(Pin) * 2U)), (Mode << (POSITION_VAL(Pin) * 2U)));
86-
}
87-
__STATIC_INLINE uint32_t LL_GPIO_GetPinMode(GPIO_TypeDef *GPIOx, uint32_t Pin)
88-
{
89-
return (uint32_t)(READ_BIT(GPIOx->MODER, ((Pin * Pin) * GPIO_MODER_MODER0)) / (Pin * Pin));
90-
}
91-
__STATIC_INLINE void LL_GPIO_SetPinPull(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Pull)
92-
{
93-
MODIFY_REG(GPIOx->PUPDR, (GPIO_PUPDR_PUPD0 << (POSITION_VAL(Pin) * 2U)), (Pull << (POSITION_VAL(Pin) * 2U)));
94-
}
95-
__STATIC_INLINE void LL_GPIO_SetPinOutputType(GPIO_TypeDef *GPIOx, uint32_t PinMask, uint32_t OutputType)
96-
{
97-
MODIFY_REG(GPIOx->OTYPER, PinMask, (PinMask * OutputType));
98-
}
99-
__STATIC_INLINE void LL_GPIO_SetPinSpeed(GPIO_TypeDef *GPIOx, uint32_t Pin, uint32_t Speed)
100-
{
101-
MODIFY_REG(GPIOx->OSPEEDR, (GPIO_OSPEEDER_OSPEEDR0 << (POSITION_VAL(Pin) * 2U)),
102-
(Speed << (POSITION_VAL(Pin) * 2U)));
103-
}
104-
// Above lines shall be defined in LL when available
35+
#include "stm32f2xx_ll_gpio.h"
10536

10637
extern const uint32_t ll_pin_defines[16];
10738

0 commit comments

Comments
 (0)