Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: SDFileSystemDMA mbed
spi_device.h
00001 00002 /* SD card Interface connection 00003 * : aitendo : General 00004 * MCU sig. : IFB-254-SD : PIN name 00005 --- : 1 : 9 dat2 00006 CS : 2 : 1 cs/dat3 00007 MOSI : 3 : 2 di/cmd 00008 GND : 4 : 3 vss1 00009 VCC : 5 : 4 vdd 00010 CLK : 6 : 5 clk 00011 GND : 7 : 6 vss2 00012 MISO : 8 : 7 do/dat0 00013 --- : 9 : 8 dat1 00014 --- : 10 : 11 wp 00015 --- : 11 : 10 cd1 00016 --- : 12 : - case GND 00017 */ 00018 00019 #define SPI_DEV 1 00020 00021 #if defined(TARGET_STM32F4) || defined(TARGET_STM32L4) 00022 #define CS D10 /* PB_6 or etc. */ 00023 #if SPI_DEV==1 00024 /* SPI1 */ 00025 #define MOSI D11 /* PA_7 */ 00026 #define MISO D12 /* PA_6 */ 00027 #define SCLK D13 /* PA_5 */ 00028 #elif SPI_DEV==3 00029 /* SPI3 */ 00030 #define MOSI D4 /* PB_5 */ 00031 #define MISO D5 /* PB_4 */ 00032 #define SCLK D3 /* PB_3 */ 00033 #else 00034 #error 00035 #endif 00036 #endif 00037 00038 #if defined(TARGET_DISCO_F303VC) \ 00039 || defined(TARGET_NUCLEO_F303RE) \ 00040 || defined(TARGET_NUCLEO_F302R8) 00041 #define CS PC_9 00042 /* SPI3 */ 00043 #if SPI_DEV==3 00044 #define MOSI PC_12 00045 #define MISO PC_11 00046 #define SCLK PC_10 00047 #elif SPI_DEV==2 00048 /* SPI2 */ 00049 #define MOSI PB_15 00050 #define MISO PB_14 00051 #define SCLK PB_13 00052 #else 00053 #error 00054 #endif 00055 #endif 00056 00057 #if defined(TARGET_NUCLEO_F303K8) \ 00058 || defined(TARGET_NUCLEO_F334R8) \ 00059 || defined(TARGET_DISCO_F334C8) 00060 #define CS PA_1 00061 /* SPI1 */ 00062 #if SPI_DEV==1 00063 #define MOSI PA_7 00064 #define MISO PA_6 00065 #define SCLK PA_5 00066 #else 00067 #error 00068 #endif 00069 #endif 00070 00071 #if defined(TARGET_DISCO_F100RB) 00072 #define CS PB_12 00073 /* SPI1 */ 00074 #if SPI_DEV==1 00075 #define MOSI PA_7 00076 #define MISO PA_6 00077 #define SCLK PA_5 00078 #elif SPI_DEV==2 00079 /* SPI2 */ 00080 #define MOSI PB_15 00081 #define MISO PB_14 00082 #define SCLK PB_13 00083 #else 00084 #error 00085 #endif 00086 #endif 00087 00088 #if defined(TARGET_NUCLEO_F103RB) 00089 /* SPI1 */ 00090 #if SPI_DEV==1 00091 #define CS PB_8 00092 #define MOSI PA_7 00093 #define MISO PA_6 00094 #define SCLK PA_5 00095 #elif SPI_DEV==2 00096 /* SPI2 */ 00097 #define CS PD_2 00098 #define MOSI PB_15 00099 #define MISO PB_14 00100 #define SCLK PB_13 00101 #else 00102 #error 00103 #endif 00104 #endif 00105 00106 00107 #if defined(TARGET_STM32F0) \ 00108 || defined(TARGET_STM32L1) \ 00109 || defined(TARGET_STM32L0) 00110 #define CS D10 /* PB_6 */ 00111 #if 1 00112 #define MOSI D4 /* PB_5 */ 00113 #define MISO D5 /* PB_4 */ 00114 #define SCLK D3 /* PB_3 */ 00115 #else 00116 #define MOSI D11 /* PA_7 */ 00117 #define MISO D12 /* PA_6 */ 00118 #define SCLK D13 /* PA_5 */ 00119 #endif 00120 #endif 00121 00122
Generated on Mon Jul 18 2022 21:46:33 by
1.7.2