Skip to content

Commit cb4b453

Browse files
committed
Updat to mbed 6.0.0
1 parent bbacbed commit cb4b453

File tree

72 files changed

+2788
-1146
lines changed

Some content is hidden

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

72 files changed

+2788
-1146
lines changed

cores/arduino/mbed/components/storage/blockdevice/COMPONENT_DATAFLASH/DataFlashBlockDevice.h

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,21 @@
2323
#include "drivers/SPI.h"
2424
#include "drivers/DigitalOut.h"
2525

26+
#ifndef MBED_CONF_DATAFLASH_SPI_MOSI
27+
#define MBED_CONF_DATAFLASH_SPI_MOSI NC
28+
#endif
29+
#ifndef MBED_CONF_DATAFLASH_SPI_MISO
30+
#define MBED_CONF_DATAFLASH_SPI_MISO NC
31+
#endif
32+
#ifndef MBED_CONF_DATAFLASH_SPI_CLK
33+
#define MBED_CONF_DATAFLASH_SPI_CLK NC
34+
#endif
35+
#ifndef MBED_CONF_DATAFLASH_SPI_CS
36+
#define MBED_CONF_DATAFLASH_SPI_CS NC
37+
#endif
38+
#ifndef MBED_CONF_DATAFLASH_SPI_FREQ
39+
#define MBED_CONF_DATAFLASH_SPI_FREQ 40000000
40+
#endif
2641

2742
/** BlockDevice for DataFlash flash devices
2843
*
@@ -72,13 +87,14 @@ class DataFlashBlockDevice : public mbed::BlockDevice {
7287
* @param csel SPI chip select pin
7388
* @param nowp GPIO not-write-protect
7489
* @param freq Clock speed of the SPI bus (defaults to 40MHz)
90+
* @param nwp Not-write-protected pin
7591
*/
76-
DataFlashBlockDevice(PinName mosi,
77-
PinName miso,
78-
PinName sclk,
79-
PinName csel,
92+
DataFlashBlockDevice(PinName mosi = MBED_CONF_DATAFLASH_SPI_MOSI,
93+
PinName miso = MBED_CONF_DATAFLASH_SPI_MISO,
94+
PinName sclk = MBED_CONF_DATAFLASH_SPI_CLK,
95+
PinName csel = MBED_CONF_DATAFLASH_SPI_CS,
8096
int freq = MBED_CONF_DATAFLASH_SPI_FREQ,
81-
PinName nowp = NC);
97+
PinName nwp = NC);
8298

8399
/** Initialize a block device
84100
*

cores/arduino/mbed/components/storage/blockdevice/COMPONENT_QSPIF/QSPIFBlockDevice.h

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,31 @@
1919
#include "drivers/QSPI.h"
2020
#include "features/storage/blockdevice/BlockDevice.h"
2121

22+
#ifndef MBED_CONF_QSPIF_QSPI_IO0
23+
#define MBED_CONF_QSPIF_QSPI_IO0 NC
24+
#endif
25+
#ifndef MBED_CONF_QSPIF_QSPI_IO1
26+
#define MBED_CONF_QSPIF_QSPI_IO1 NC
27+
#endif
28+
#ifndef MBED_CONF_QSPIF_QSPI_IO2
29+
#define MBED_CONF_QSPIF_QSPI_IO2 NC
30+
#endif
31+
#ifndef MBED_CONF_QSPIF_QSPI_IO3
32+
#define MBED_CONF_QSPIF_QSPI_IO3 NC
33+
#endif
34+
#ifndef MBED_CONF_QSPIF_QSPI_SCK
35+
#define MBED_CONF_QSPIF_QSPI_SCK NC
36+
#endif
37+
#ifndef MBED_CONF_QSPIF_QSPI_CSN
38+
#define MBED_CONF_QSPIF_QSPI_CSN NC
39+
#endif
40+
#ifndef MBED_CONF_QSPIF_QSPI_POLARITY_MODE
41+
#define MBED_CONF_QSPIF_QSPI_POLARITY_MODE 0
42+
#endif
43+
#ifndef MBED_CONF_QSPIF_QSPI_FREQ
44+
#define MBED_CONF_QSPIF_QSPI_FREQ 40000000
45+
#endif
46+
2247
/** Enum qspif standard error codes
2348
*
2449
* @enum qspif_bd_error
@@ -98,10 +123,15 @@ class QSPIFBlockDevice : public mbed::BlockDevice {
98123
* @param clock_mode specifies the QSPI Clock Polarity mode (QSPIF_POLARITY_MODE_0/QSPIF_POLARITY_MODE_1)
99124
* default value = 0
100125
* @param freq Clock frequency of the QSPI bus (defaults to 40MHz)
101-
*
102126
*/
103-
QSPIFBlockDevice(PinName io0, PinName io1, PinName io2, PinName io3, PinName sclk, PinName csel,
104-
int clock_mode, int freq = MBED_CONF_QSPIF_QSPI_FREQ);
127+
QSPIFBlockDevice(PinName io0 = MBED_CONF_QSPIF_QSPI_IO0,
128+
PinName io1 = MBED_CONF_QSPIF_QSPI_IO1,
129+
PinName io2 = MBED_CONF_QSPIF_QSPI_IO2,
130+
PinName io3 = MBED_CONF_QSPIF_QSPI_IO3,
131+
PinName sclk = MBED_CONF_QSPIF_QSPI_SCK,
132+
PinName csel = MBED_CONF_QSPIF_QSPI_CSN,
133+
int clock_mode = MBED_CONF_QSPIF_QSPI_POLARITY_MODE,
134+
int freq = MBED_CONF_QSPIF_QSPI_FREQ);
105135

106136
/** Initialize a block device
107137
*

cores/arduino/mbed/components/storage/blockdevice/COMPONENT_RSPIF/SPIFReducedBlockDevice.h

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,22 @@
2020
#include "drivers/DigitalOut.h"
2121
#include "features/storage/blockdevice/BlockDevice.h"
2222

23+
#ifndef MBED_CONF_RSPIF_DRIVER_SPI_MOSI
24+
#define MBED_CONF_RSPIF_DRIVER_SPI_MOSI NC
25+
#endif
26+
#ifndef MBED_CONF_RSPIF_DRIVER_SPI_MISO
27+
#define MBED_CONF_RSPIF_DRIVER_SPI_MISO NC
28+
#endif
29+
#ifndef MBED_CONF_RSPIF_DRIVER_SPI_CLK
30+
#define MBED_CONF_RSPIF_DRIVER_SPI_CLK NC
31+
#endif
32+
#ifndef MBED_CONF_RSPIF_DRIVER_SPI_CS
33+
#define MBED_CONF_RSPIF_DRIVER_SPI_CS NC
34+
#endif
35+
#ifndef MBED_CONF_RSPIF_DRIVER_SPI_FREQ
36+
#define MBED_CONF_RSPIF_DRIVER_SPI_FREQ 40000000
37+
#endif
38+
2339
/** Reduced BlockDevice for SPI based flash devices
2440
* *Should only be used by Boot Loader*
2541
*
@@ -66,7 +82,11 @@ class SPIFReducedBlockDevice : public mbed::BlockDevice {
6682
* @param csel SPI chip select pin
6783
* @param freq Clock speed of the SPI bus (defaults to 40MHz)
6884
*/
69-
SPIFReducedBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName csel, int freq = 40000000);
85+
SPIFReducedBlockDevice(PinName mosi = MBED_CONF_RSPIF_DRIVER_SPI_MOSI,
86+
PinName miso = MBED_CONF_RSPIF_DRIVER_SPI_MISO,
87+
PinName sclk = MBED_CONF_RSPIF_DRIVER_SPI_CLK,
88+
PinName csel = MBED_CONF_RSPIF_DRIVER_SPI_CS,
89+
int freq = MBED_CONF_RSPIF_DRIVER_SPI_FREQ);
7090

7191
/** Initialize a block device
7292
*

cores/arduino/mbed/components/storage/blockdevice/COMPONENT_SD/SDBlockDevice.h

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,37 @@
2727
#include "drivers/DigitalOut.h"
2828
#include "platform/platform.h"
2929
#include "platform/PlatformMutex.h"
30+
#include "hal/static_pinmap.h"
31+
32+
#ifndef MBED_CONF_SD_SPI_MOSI
33+
#define MBED_CONF_SD_SPI_MOSI NC
34+
#endif
35+
#ifndef MBED_CONF_SD_SPI_MISO
36+
#define MBED_CONF_SD_SPI_MISO NC
37+
#endif
38+
#ifndef MBED_CONF_SD_SPI_CLK
39+
#define MBED_CONF_SD_SPI_CLK NC
40+
#endif
41+
#ifndef MBED_CONF_SD_SPI_CS
42+
#define MBED_CONF_SD_SPI_CS NC
43+
#endif
44+
#ifndef MBED_CONF_SD_INIT_FREQUENCY
45+
#define MBED_CONF_SD_INIT_FREQUENCY 100000
46+
#endif
47+
#ifndef MBED_CONF_SD_TRX_FREQUENCY
48+
#define MBED_CONF_SD_TRX_FREQUENCY 1000000
49+
#endif
50+
#ifndef MBED_CONF_SD_CRC_ENABLED
51+
#define MBED_CONF_SD_CRC_ENABLED 0
52+
#endif
3053

3154
/** SDBlockDevice class
3255
*
3356
* Access an SD Card using SPI bus
3457
*/
3558
class SDBlockDevice : public mbed::BlockDevice {
3659
public:
37-
/** Creates an SDBlockDevice on a SPI bus specified by pins
60+
/** Creates an SDBlockDevice on a SPI bus specified by pins (using dynamic pin-map)
3861
*
3962
* @param mosi SPI master out, slave in pin
4063
* @param miso SPI master in, slave out pin
@@ -43,7 +66,24 @@ class SDBlockDevice : public mbed::BlockDevice {
4366
* @param hz Clock speed of the SPI bus (defaults to 1MHz)
4467
* @param crc_on Enable cyclic redundancy check (defaults to disabled)
4568
*/
46-
SDBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName cs, uint64_t hz = 1000000, bool crc_on = 0);
69+
SDBlockDevice(PinName mosi = MBED_CONF_SD_SPI_MOSI,
70+
PinName miso = MBED_CONF_SD_SPI_MISO,
71+
PinName sclk = MBED_CONF_SD_SPI_CLK,
72+
PinName cs = MBED_CONF_SD_SPI_CS,
73+
uint64_t hz = MBED_CONF_SD_TRX_FREQUENCY,
74+
bool crc_on = MBED_CONF_SD_CRC_ENABLED);
75+
76+
/** Creates an SDBlockDevice on a SPI bus specified by pins (using static pin-map)
77+
*
78+
* @param spi_pinmap Static SPI pin-map
79+
* @param hz Clock speed of the SPI bus (defaults to 1MHz)
80+
* @param crc_on Enable cyclic redundancy check (defaults to disabled)
81+
*/
82+
SDBlockDevice(const spi_pinmap_t &spi_pinmap,
83+
PinName cs = MBED_CONF_SD_SPI_CS,
84+
uint64_t hz = MBED_CONF_SD_TRX_FREQUENCY,
85+
bool crc_on = MBED_CONF_SD_CRC_ENABLED);
86+
4787
virtual ~SDBlockDevice();
4888

4989
/** Initialize a block device
@@ -256,8 +296,6 @@ class SDBlockDevice : public mbed::BlockDevice {
256296

257297
#if MBED_CONF_SD_CRC_ENABLED
258298
bool _crc_on;
259-
mbed::MbedCRC<POLY_7BIT_SD, 7> _crc7;
260-
mbed::MbedCRC<POLY_16BIT_CCITT, 16> _crc16;
261299
#endif
262300
};
263301

cores/arduino/mbed/components/storage/blockdevice/COMPONENT_SPIF/SPIFBlockDevice.h

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,22 @@
2121
#include "drivers/DigitalOut.h"
2222
#include "features/storage/blockdevice/BlockDevice.h"
2323

24+
#ifndef MBED_CONF_SPIF_DRIVER_SPI_MOSI
25+
#define MBED_CONF_SPIF_DRIVER_SPI_MOSI NC
26+
#endif
27+
#ifndef MBED_CONF_SPIF_DRIVER_SPI_MISO
28+
#define MBED_CONF_SPIF_DRIVER_SPI_MISO NC
29+
#endif
30+
#ifndef MBED_CONF_SPIF_DRIVER_SPI_CLK
31+
#define MBED_CONF_SPIF_DRIVER_SPI_CLK NC
32+
#endif
33+
#ifndef MBED_CONF_SPIF_DRIVER_SPI_CS
34+
#define MBED_CONF_SPIF_DRIVER_SPI_CS NC
35+
#endif
36+
#ifndef MBED_CONF_SPIF_DRIVER_SPI_FREQ
37+
#define MBED_CONF_SPIF_DRIVER_SPI_FREQ 40000000
38+
#endif
39+
2440
/** Enum spif standard error codes
2541
*
2642
* @enum spif_bd_error
@@ -82,8 +98,14 @@ class SPIFBlockDevice : public mbed::BlockDevice {
8298
* @param sclk SPI clock pin
8399
* @param csel SPI chip select pin
84100
* @param freq Clock speed of the SPI bus (defaults to 40MHz)
101+
*
102+
*
85103
*/
86-
SPIFBlockDevice(PinName mosi, PinName miso, PinName sclk, PinName csel, int freq = 40000000);
104+
SPIFBlockDevice(PinName mosi = MBED_CONF_SPIF_DRIVER_SPI_MOSI,
105+
PinName miso = MBED_CONF_SPIF_DRIVER_SPI_MISO,
106+
PinName sclk = MBED_CONF_SPIF_DRIVER_SPI_CLK,
107+
PinName csel = MBED_CONF_SPIF_DRIVER_SPI_CS,
108+
int freq = MBED_CONF_SPIF_DRIVER_SPI_FREQ);
87109

88110
/** Initialize a block device
89111
*

cores/arduino/mbed/components/wifi/esp8266-driver/ESP8266/ESP8266.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef ESP8266_H
1818
#define ESP8266_H
1919

20-
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT)
20+
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_API_PRESENT)
2121
#include <stdint.h>
2222

2323
#include "drivers/UARTSerial.h"
@@ -27,8 +27,8 @@
2727
#include "platform/ATCmdParser.h"
2828
#include "platform/Callback.h"
2929
#include "platform/mbed_error.h"
30-
#include "rtos/ConditionVariable.h"
3130
#include "rtos/Mutex.h"
31+
#include "rtos/ThisThread.h"
3232

3333
// Various timeouts for different ESP8266 operations
3434
#ifndef ESP8266_CONNECT_TIMEOUT
@@ -428,7 +428,6 @@ class ESP8266 {
428428
PinName _serial_rts;
429429
PinName _serial_cts;
430430
rtos::Mutex _smutex; // Protect serial port access
431-
rtos::Mutex _rmutex; // Reset protection
432431

433432
// AT Command Parser
434433
mbed::ATCmdParser _parser;
@@ -470,6 +469,7 @@ class ESP8266 {
470469
void _oob_tcp_data_hdlr();
471470
void _oob_ready();
472471
void _oob_scan_results();
472+
void _oob_ok_received();
473473

474474
// OOB state variables
475475
int _connect_error;
@@ -479,8 +479,8 @@ class ESP8266 {
479479
bool _closed;
480480
bool _error;
481481
bool _busy;
482-
rtos::ConditionVariable _reset_check;
483482
bool _reset_done;
483+
bool _ok_received;
484484

485485
// Modem's address info
486486
char _ip_buffer[16];

cores/arduino/mbed/components/wifi/esp8266-driver/ESP8266Interface.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#ifndef ESP8266_INTERFACE_H
1818
#define ESP8266_INTERFACE_H
1919

20-
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_PRESENT)
20+
#if DEVICE_SERIAL && DEVICE_INTERRUPTIN && defined(MBED_CONF_EVENTS_PRESENT) && defined(MBED_CONF_NSAPI_PRESENT) && defined(MBED_CONF_RTOS_API_PRESENT)
2121
#include "drivers/DigitalOut.h"
2222
#include "drivers/Timer.h"
2323
#include "ESP8266/ESP8266.h"
@@ -30,7 +30,9 @@
3030
#include "features/netsocket/WiFiAccessPoint.h"
3131
#include "features/netsocket/WiFiInterface.h"
3232
#include "platform/Callback.h"
33+
#if MBED_CONF_RTOS_PRESENT
3334
#include "rtos/ConditionVariable.h"
35+
#endif
3436
#include "rtos/Mutex.h"
3537

3638
#define ESP8266_SOCKET_COUNT 5
@@ -452,7 +454,9 @@ class ESP8266Interface : public NetworkStack, public WiFiInterface {
452454
struct _channel_info _ch_info;
453455

454456
bool _if_blocking; // NetworkInterface, blocking or not
457+
#if MBED_CONF_RTOS_PRESENT
455458
rtos::ConditionVariable _if_connected;
459+
#endif
456460

457461
// connect status reporting
458462
nsapi_error_t _conn_status_to_error();

0 commit comments

Comments
 (0)