Skip to content

Using SPI_ macros from PinNames in SPIF and SD config files. #7979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "dataflash",
"config": {
"SPI_MOSI": "NC",
"SPI_MISO": "NC",
"SPI_CLK": "NC",
"SPI_CS": "NC",
"SPI_MOSI": "SPI_MOSI",
"SPI_MISO": "SPI_MISO",
"SPI_CLK": "SPI_SCK",
"SPI_CS": "SPI_CS",
"SPI_FREQ": "40000000",
"binary-size": {
"help": "Configure device to use binary address space.",
Expand Down
16 changes: 5 additions & 11 deletions components/storage/blockdevice/COMPONENT_SD/config/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
{
"name": "sd",
"config": {
"SPI_CS": "NC",
"SPI_MOSI": "NC",
"SPI_MISO": "NC",
"SPI_CLK": "NC",
"DEVICE_SPI": 1,
"SPI_CS": "SPI_CS",
"SPI_MOSI": "SPI_MOSI",
"SPI_MISO": "SPI_MISO",
"SPI_CLK": "SPI_SCK",
"FSFAT_SDCARD_INSTALLED": 1,
"CMD_TIMEOUT": 10000,
"CMD0_IDLE_STATE_RETRIES": 5,
Expand Down Expand Up @@ -60,12 +59,6 @@
"SPI_CLK": "PTD5",
"SPI_CS": "PTD4"
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove all NUCLEO and DISCO target_overrides configuration
as SPI_xxx define should be already defined for them.
Thx

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ASFAIK, not all NUCLEO and DISCO has those pins defined. Also, some of them were defined by the data from spif and some from sd. So in case, spif is the original definition we left the sd target override as it was.

"K64F": {
"SPI_MOSI": "PTE3",
"SPI_MISO": "PTE1",
"SPI_CLK": "PTE2",
"SPI_CS": "PTE4"
},
"K66F": {
"SPI_MOSI": "PTE3",
"SPI_MISO": "PTE1",
Expand Down Expand Up @@ -216,5 +209,6 @@
"SPI_CLK": "PC_10",
"SPI_CS": "PA_15"
}

}
}
14 changes: 4 additions & 10 deletions components/storage/blockdevice/COMPONENT_SPIF/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,13 @@
{
"name": "spif-driver",
"config": {
"SPI_MOSI": "NC",
"SPI_MISO": "NC",
"SPI_CLK": "NC",
"SPI_CS": "NC",
"SPI_MOSI": "SPI_MOSI",
"SPI_MISO": "SPI_MISO",
"SPI_CLK": "SPI_SCK",
"SPI_CS": "SPI_CS",
"SPI_FREQ": "40000000"
},
"target_overrides": {
"K82F": {
"SPI_MOSI": "PTE2",
"SPI_MISO": "PTE4",
"SPI_CLK": "PTE1",
"SPI_CS": "PTE5"
},
"LPC54114": {
"SPI_MOSI": "P0_20",
"SPI_MISO": "P0_18",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ typedef enum {
SPI_MOSI = PTE2,
SPI_MISO = PTE4,
SPI_SCK = PTE1,
SPI_PERSISTENT_MEM_CS = PTE5,
SPI_CS = PTE5,

/**** QSPI FLASH pins ****/
QSPI_FLASH1_IO0 = PTE2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ typedef enum {
SPI_MOSI = PTE3,
SPI_MISO = PTE1,
SPI_SCK = PTE2,
SPI_PERSISTENT_MEM_CS = PTE4,
SPI_CS = PTE4,

// Not connected
NC = (int)0xFFFFFFFF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ typedef enum {
SPI_MOSI = PTE3,
SPI_MISO = PTE1,
SPI_SCK = PTE2,
SPI_PERSISTENT_MEM_CS = PTE4,
SPI_CS = PTE4,

// Not connected
NC = (int)0xFFFFFFFF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ typedef enum {
SPI_MOSI = PTC6,
SPI_MISO = PTC7,
SPI_SCK = PTC5,
SPI_PERSISTENT_MEM_CS = PTC4,
SPI_CS = PTC4,

DAC0_OUT = 0xFEFE, /* DAC does not have Pin Name in RM */
// Not connected
Expand Down