Skip to content

Commit 9906655

Browse files
committed
[M2351] Add SD pinmap
1 parent 1b9fa07 commit 9906655

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

targets/TARGET_NUVOTON/TARGET_M2351/TARGET_NUMAKER_PFM_M2351/PeripheralNames.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,16 @@ typedef enum {
298298

299299
} DMAName;
300300

301+
typedef enum {
302+
303+
#if defined(SCU_INIT_PNSSET0_VAL) && (SCU_INIT_PNSSET0_VAL & (1 << 13))
304+
SD_0 = (int) NU_MODNAME(SDH0_BASE + NS_OFFSET, 0, 0)
305+
#else
306+
SD_0 = (int) NU_MODNAME(SDH0_BASE, 0, 0)
307+
#endif
308+
309+
} SDName;
310+
301311
typedef enum {
302312

303313
#if defined(SCU_INIT_PNSSET5_VAL) && (SCU_INIT_PNSSET5_VAL & (1 << 0))

targets/TARGET_NUVOTON/TARGET_M2351/TARGET_NUMAKER_PFM_M2351/PeripheralPins.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,57 @@ const PinMap PinMap_SPI_SSEL[] = {
577577
{NC, NC, 0}
578578
};
579579

580+
//*** SD ***
581+
582+
const PinMap PinMap_SD_DAT0[] = {
583+
{PB_2, SD_0, SYS_GPB_MFPL_PB2MFP_SD0_DAT0},
584+
{PE_2, SD_0, SYS_GPE_MFPL_PE2MFP_SD0_DAT0},
585+
586+
{NC, NC, 0}
587+
};
588+
589+
const PinMap PinMap_SD_DAT1[] = {
590+
{PB_3, SD_0, SYS_GPB_MFPL_PB3MFP_SD0_DAT1},
591+
{PE_3, SD_0, SYS_GPE_MFPL_PE3MFP_SD0_DAT1},
592+
593+
{NC, NC, 0}
594+
};
595+
596+
const PinMap PinMap_SD_DAT2[] = {
597+
{PB_4, SD_0, SYS_GPB_MFPL_PB4MFP_SD0_DAT2},
598+
{PE_4, SD_0, SYS_GPE_MFPL_PE4MFP_SD0_DAT2},
599+
600+
{NC, NC, 0}
601+
};
602+
603+
const PinMap PinMap_SD_DAT3[] = {
604+
{PB_5, SD_0, SYS_GPB_MFPL_PB5MFP_SD0_DAT3},
605+
{PE_5, SD_0, SYS_GPE_MFPL_PE5MFP_SD0_DAT3},
606+
607+
{NC, NC, 0}
608+
};
609+
610+
const PinMap PinMap_SD_CMD[] = {
611+
{PB_0, SD_0, SYS_GPB_MFPL_PB0MFP_SD0_CMD},
612+
{PE_7, SD_0, SYS_GPE_MFPL_PE7MFP_SD0_CMD},
613+
614+
{NC, NC, 0}
615+
};
616+
617+
const PinMap PinMap_SD_CLK[] = {
618+
{PB_1, SD_0, SYS_GPB_MFPL_PB1MFP_SD0_CLK},
619+
{PE_6, SD_0, SYS_GPE_MFPL_PE6MFP_SD0_CLK},
620+
621+
{NC, NC, 0}
622+
};
623+
624+
const PinMap PinMap_SD_CD[] = {
625+
{PB_12, SD_0, SYS_GPB_MFPH_PB12MFP_SD0_nCD},
626+
{PD_13, SD_0, SYS_GPD_MFPH_PD13MFP_SD0_nCD},
627+
628+
{NC, NC, 0}
629+
};
630+
580631
const PinMap PinMap_CAN_TD[] = {
581632
{PA_5, CAN_0, SYS_GPA_MFPL_PA5MFP_CAN0_TXD},
582633
{PA_12, CAN_0, SYS_GPA_MFPH_PA12MFP_CAN0_TXD},

0 commit comments

Comments
 (0)