Skip to content

Commit 32b5f2d

Browse files
committed
Revert "Initial commit"
This reverts commit dec6e36.
1 parent 77d6787 commit 32b5f2d

File tree

12 files changed

+802
-466
lines changed

12 files changed

+802
-466
lines changed

components/storage/blockdevice/COMPONENT_SPIF/mbed_lib.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@
3131
"SPI_CLK": "p19",
3232
"SPI_CS": "p17"
3333
},
34-
"NRF52840_FEATHER": {
35-
"SPI_MOSI": "p20",
36-
"SPI_MISO": "p21",
37-
"SPI_CLK": "p19",
38-
"SPI_CS": "p17"
39-
},
4034
"HEXIWEAR": {
4135
"SPI_MOSI": "PTD6",
4236
"SPI_MISO": "PTD7",

drivers/SPI.h

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,8 @@ class SPI : private NonCopyable<SPI> {
112112
* @param miso SPI Master In, Slave Out pin.
113113
* @param sclk SPI Clock pin.
114114
* @param ssel SPI Chip Select pin.
115-
* @param dcx SPI Data/Command pin.
116115
*/
117-
SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel = NC, PinName dcx = NC);
116+
SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel = NC);
118117

119118
/** Create a SPI master connected to the specified pins.
120119
*
@@ -132,23 +131,6 @@ class SPI : private NonCopyable<SPI> {
132131
*/
133132
SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel, use_gpio_ssel_t);
134133

135-
/** Create a SPI master connected to the specified pins.
136-
*
137-
* @note This constructor manipulates the SSEL/DCX pin as a GPIO output
138-
* using a DigitalOut object. This should work on any target, and permits
139-
* the use of select() and deselect() methods to keep the pin asserted
140-
* between transfers.
141-
*
142-
* @note You can specify mosi or miso as NC if not used.
143-
*
144-
* @param mosi SPI Master Out, Slave In pin.
145-
* @param miso SPI Master In, Slave Out pin.
146-
* @param sclk SPI Clock pin.
147-
* @param ssel SPI Chip Select pin.
148-
* @param dcx SPI Data Command pin.
149-
*/
150-
SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel, PinName dcx, use_gpio_ssel_t);
151-
152134
/** Create a SPI master connected to the specified pins.
153135
*
154136
* @note This constructor passes the SSEL pin selection to the target HAL.
@@ -176,7 +158,6 @@ class SPI : private NonCopyable<SPI> {
176158
* @param ssel SPI Chip Select pin.
177159
*/
178160
SPI(const spi_pinmap_t &static_pinmap, PinName ssel);
179-
SPI(const spi_pinmap_t &pinmap, PinName ssel, PinName dcx);
180161
SPI(const spi_pinmap_t &&, PinName) = delete; // prevent passing of temporary objects
181162

182163
virtual ~SPI();
@@ -442,12 +423,9 @@ class SPI : private NonCopyable<SPI> {
442423
PinName _miso;
443424
PinName _sclk;
444425
PinName _hw_ssel;
445-
PinName _hw_dcx;
446426

447427
// The Slave Select GPIO if we're doing it ourselves.
448428
DigitalOut _sw_ssel;
449-
// The Data Command GPIO if we're doing it ourselves.
450-
DigitalOut _sw_dcx;
451429

452430
/* Size of the SPI frame */
453431
int _bits;

drivers/source/SPI.cpp

Lines changed: 2 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,15 @@ namespace mbed {
2828
SPI::spi_peripheral_s SPI::_peripherals[SPI_PERIPHERALS_USED];
2929
int SPI::_peripherals_used;
3030

31-
SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel, PinName dcx) :
31+
SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel) :
3232
#if DEVICE_SPI_ASYNCH
3333
_irq(this),
3434
#endif
3535
_mosi(mosi),
3636
_miso(miso),
3737
_sclk(sclk),
3838
_hw_ssel(ssel),
39-
_hw_dcx(dcx),
4039
_sw_ssel(NC),
41-
_sw_dcx(NC),
4240
_static_pinmap(NULL),
4341
_init_func(_do_init)
4442
{
@@ -60,32 +58,7 @@ SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel, use_gpio_ssel_t
6058
_miso(miso),
6159
_sclk(sclk),
6260
_hw_ssel(NC),
63-
_hw_dcx(NC),
6461
_sw_ssel(ssel, 1),
65-
_sw_dcx(NC),
66-
_static_pinmap(NULL),
67-
_init_func(_do_init)
68-
{
69-
// Need backwards compatibility with HALs not providing API
70-
#ifdef DEVICE_SPI_COUNT
71-
_peripheral_name = spi_get_peripheral_name(_mosi, _miso, _sclk);
72-
#else
73-
_peripheral_name = GlobalSPI;
74-
#endif
75-
_do_construct();
76-
}
77-
78-
SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel, PinName dcx, use_gpio_ssel_t) :
79-
#if DEVICE_SPI_ASYNCH
80-
_irq(this),
81-
#endif
82-
_mosi(mosi),
83-
_miso(miso),
84-
_sclk(sclk),
85-
_hw_ssel(NC),
86-
_hw_dcx(NC),
87-
_sw_ssel(ssel, 1),
88-
_sw_dcx(dcx, 1),
8962
_static_pinmap(NULL),
9063
_init_func(_do_init)
9164
{
@@ -106,9 +79,7 @@ SPI::SPI(const spi_pinmap_t &pinmap) :
10679
_miso(pinmap.miso_pin),
10780
_sclk(pinmap.sclk_pin),
10881
_hw_ssel(pinmap.ssel_pin),
109-
_hw_dcx(pinmap.dcx_pin),
11082
_sw_ssel(NC),
111-
_sw_dcx(NC),
11283
_static_pinmap(&pinmap),
11384
_peripheral_name((SPIName)pinmap.peripheral),
11485
_init_func(_do_init_direct)
@@ -125,27 +96,7 @@ SPI::SPI(const spi_pinmap_t &pinmap, PinName ssel) :
12596
_miso(pinmap.miso_pin),
12697
_sclk(pinmap.sclk_pin),
12798
_hw_ssel(NC),
128-
_hw_dcx(NC),
129-
_sw_ssel(ssel, 1),
130-
_sw_dcx(NC),
131-
_static_pinmap(&pinmap),
132-
_peripheral_name((SPIName)pinmap.peripheral),
133-
_init_func(_do_init_direct)
134-
{
135-
_do_construct();
136-
}
137-
138-
SPI::SPI(const spi_pinmap_t &pinmap, PinName ssel, PinName dcx) :
139-
#if DEVICE_SPI_ASYNCH
140-
_irq(this),
141-
#endif
142-
_mosi(pinmap.mosi_pin),
143-
_miso(pinmap.miso_pin),
144-
_sclk(pinmap.sclk_pin),
145-
_hw_ssel(NC),
146-
_hw_dcx(NC),
14799
_sw_ssel(ssel, 1),
148-
_sw_dcx(dcx, 1),
149100
_static_pinmap(&pinmap),
150101
_peripheral_name((SPIName)pinmap.peripheral),
151102
_init_func(_do_init_direct)
@@ -155,7 +106,7 @@ SPI::SPI(const spi_pinmap_t &pinmap, PinName ssel, PinName dcx) :
155106

156107
void SPI::_do_init(SPI *obj)
157108
{
158-
spi_init(&obj->_peripheral->spi, obj->_mosi, obj->_miso, obj->_sclk, obj->_hw_ssel, obj->_hw_dcx);
109+
spi_init(&obj->_peripheral->spi, obj->_mosi, obj->_miso, obj->_sclk, obj->_hw_ssel);
159110
}
160111

161112
void SPI::_do_init_direct(SPI *obj)

hal/spi_api.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ typedef struct {
6363
int sclk_function;
6464
PinName ssel_pin;
6565
int ssel_function;
66-
PinName dcx_pin;
67-
int dcx_function;
6866
} spi_pinmap_t;
6967

7068
/**
@@ -187,9 +185,8 @@ void spi_init_direct(spi_t *obj, const spi_pinmap_t *pinmap);
187185
* @param[in] miso The pin to use for MISO
188186
* @param[in] sclk The pin to use for SCLK
189187
* @param[in] ssel The pin to use for SSEL
190-
* @param[in] dcx The pin to use for DC (Data/Command) NC if not connected
191188
*/
192-
void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel, PinName dcx);
189+
void spi_init(spi_t *obj, PinName mosi, PinName miso, PinName sclk, PinName ssel);
193190

194191
/** Release a SPI object
195192
*
@@ -328,15 +325,6 @@ const PinMap *spi_master_clk_pinmap(void);
328325
*/
329326
const PinMap *spi_master_cs_pinmap(void);
330327

331-
/** Get the pins that support SPI DC
332-
*
333-
* Return a PinMap array of pins that support SPI DC in
334-
* master mode. The array is terminated with {NC, NC, 0}.
335-
*
336-
* @return PinMap array
337-
*/
338-
const PinMap *spi_master_dc_pinmap(void);
339-
340328
/** Get the pins that support SPI MOSI
341329
*
342330
* Return a PinMap array of pins that support SPI MOSI in
@@ -373,15 +361,6 @@ const PinMap *spi_slave_clk_pinmap(void);
373361
*/
374362
const PinMap *spi_slave_cs_pinmap(void);
375363

376-
/** Get the pins that support SPI DC
377-
*
378-
* Return a PinMap array of pins that support SPI DC in
379-
* slave mode. The array is terminated with {NC, NC, 0}.
380-
*
381-
* @return PinMap array
382-
*/
383-
const PinMap *spi_slave_dc_pinmap(void);
384-
385364
/**@}*/
386365

387366
#if DEVICE_SPI_ASYNCH

hal/static_pinmap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
#if DEVICE_SPI
2929
MBED_WEAK void spi_init_direct(spi_t *obj, const spi_pinmap_t *pinmap)
3030
{
31-
spi_init(obj, pinmap->mosi_pin, pinmap->miso_pin, pinmap->sclk_pin, pinmap->ssel_pin, pinmap->dcx_pin);
31+
spi_init(obj, pinmap->mosi_pin, pinmap->miso_pin, pinmap->sclk_pin, pinmap->ssel_pin);
3232
}
3333
#endif
3434

platform/mbed_lib.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,6 @@
212212
"crash-capture-enabled": true,
213213
"fatal-error-auto-reboot-enabled": true
214214
},
215-
"NRF52840_FEATHER": {
216-
"crash-capture-enabled": true,
217-
"fatal-error-auto-reboot-enabled": true
218-
},
219215
"NUCLEO_L476RG": {
220216
"crash-capture-enabled": true,
221217
"fatal-error-auto-reboot-enabled": true

0 commit comments

Comments
 (0)