Remove pinmap_restricted_peripherals() function from Nuvoton (STDIO uart is restricted by default)

pull/12379/head
Przemyslaw Stekiel 2020-02-06 11:28:25 +01:00
parent 54f4777e64
commit a4e1354769
7 changed files with 17 additions and 122 deletions

View File

@ -43,7 +43,7 @@ void pin_mode(PinName pin, PinMode mode)
uint32_t pin_index = NU_PINNAME_TO_PIN(pin);
uint32_t port_index = NU_PINNAME_TO_PORT(pin);
GPIO_T *gpio_base = NU_PORT_BASE(port_index);
uint32_t mode_intern = GPIO_MODE_INPUT;
switch (mode) {
@ -81,21 +81,6 @@ void pin_mode(PinName pin, PinMode mode)
*/
}
/* List of peripherals excluded from testing */
const PeripheralList *pinmap_restricted_peripherals()
{
static const int perifs[] = {
STDIO_UART // Dedicated to USB VCOM
};
static const PeripheralList peripheral_list = {
sizeof(perifs) / sizeof(perifs[0]),
perifs
};
return &peripheral_list;
}
#if defined(__ARM_FEATURE_CMSE) && (__ARM_FEATURE_CMSE == 3U)
static void pin_function_impl(int32_t pin, int32_t data, bool nonsecure_caller)
@ -103,16 +88,16 @@ static void pin_function_impl(int32_t pin, int32_t data, bool nonsecure_caller)
MBED_ASSERT(pin != (PinName)NC);
uint32_t pin_index = NU_PINNAME_TO_PIN(pin);
uint32_t port_index = NU_PINNAME_TO_PORT(pin);
/* Guard access to secure GPIO from non-secure domain */
if (nonsecure_caller &&
if (nonsecure_caller &&
(! (SCU_INIT_IONSSET_VAL & (1 << (port_index + 0))))) {
error("Non-secure domain tries to control secure or undefined GPIO.");
}
__IO uint32_t *GPx_MFPx = ((__IO uint32_t *) &SYS->GPA_MFPL) + port_index * 2 + (pin_index / 8);
uint32_t MFP_Msk = NU_MFP_MSK(pin_index);
// E.g.: SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SYS_GPA_MFPL_PA0MFP_Msk) ) | SYS_GPA_MFPL_PA0MFP_SC0_CD ;
*GPx_MFPx = (*GPx_MFPx & (~MFP_Msk)) | data;
}

View File

@ -83,18 +83,3 @@ void pin_mode(PinName pin, PinMode mode)
* 2. PushPullOutput/PIN_INPUT
*/
}
/* List of peripherals excluded from testing */
const PeripheralList *pinmap_restricted_peripherals()
{
static const int perifs[] = {
STDIO_UART // Dedicated to USB VCOM
};
static const PeripheralList peripheral_list = {
sizeof(perifs) / sizeof(perifs[0]),
perifs
};
return &peripheral_list;
}

View File

@ -1,4 +1,4 @@
/*
/*
* Copyright (c) 2019-2020 Nuvoton Technology Corporation
* SPDX-License-Identifier: Apache-2.0
*
@ -29,10 +29,10 @@ void pin_function(PinName pin, int data)
MBED_ASSERT(pin != (PinName)NC);
uint32_t pin_index = NU_PINNAME_TO_PIN(pin);
uint32_t port_index = NU_PINNAME_TO_PORT(pin);
__IO uint32_t *GPx_MFPx = ((__IO uint32_t *) &SYS->GPA_MFPL) + port_index * 2 + (pin_index / 8);
uint32_t MFP_Msk = NU_MFP_MSK(pin_index);
// E.g.: SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SYS_GPA_MFPL_PA0MFP_Msk) ) | SYS_GPA_MFPL_PA0MFP_SC0_CD ;
*GPx_MFPx = (*GPx_MFPx & (~MFP_Msk)) | data;
}
@ -46,7 +46,7 @@ void pin_mode(PinName pin, PinMode mode)
uint32_t pin_index = NU_PINNAME_TO_PIN(pin);
uint32_t port_index = NU_PINNAME_TO_PORT(pin);
GPIO_T *gpio_base = NU_PORT_BASE(port_index);
uint32_t mode_intern = GPIO_MODE_INPUT;
switch (mode) {
@ -83,18 +83,3 @@ void pin_mode(PinName pin, PinMode mode)
* 2. PushPullOutput/PIN_INPUT
*/
}
/* List of peripherals excluded from testing */
const PeripheralList *pinmap_restricted_peripherals()
{
static const int perifs[] = {
STDIO_UART // Dedicated to USB VCOM
};
static const PeripheralList peripheral_list = {
sizeof(perifs) / sizeof(perifs[0]),
perifs
};
return &peripheral_list;
}

View File

@ -31,10 +31,10 @@ void pin_function(PinName pin, int data)
__IO uint32_t *GPx_MFPx = ((__IO uint32_t *) &SYS->GPA_MFPL) + port_index * 2 + (pin_index / 8);
//uint32_t MFP_Pos = NU_MFP_POS(pin_index);
uint32_t MFP_Msk = NU_MFP_MSK(pin_index);
// E.g.: SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SYS_GPA_MFPL_PA0MFP_Msk) ) | SYS_GPA_MFPL_PA0MFP_SC0_CD ;
*GPx_MFPx = (*GPx_MFPx & (~MFP_Msk)) | data;
// [TODO] Disconnect JTAG-DP + SW-DP signals.
// Warning: Need to reconnect under reset
//if ((pin == PA_13) || (pin == PA_14)) {
@ -54,7 +54,7 @@ void pin_mode(PinName pin, PinMode mode)
uint32_t pin_index = NU_PINNAME_TO_PIN(pin);
uint32_t port_index = NU_PINNAME_TO_PORT(pin);
GPIO_T *gpio_base = NU_PORT_BASE(port_index);
uint32_t mode_intern = GPIO_MODE_INPUT;
switch (mode) {
@ -91,18 +91,3 @@ void pin_mode(PinName pin, PinMode mode)
* 2. PushPullOutput/PIN_INPUT
*/
}
/* List of peripherals excluded from testing */
const PeripheralList *pinmap_restricted_peripherals()
{
static const int perifs[] = {
STDIO_UART // Dedicated to USB VCOM
};
static const PeripheralList peripheral_list = {
sizeof(perifs) / sizeof(perifs[0]),
perifs
};
return &peripheral_list;
}

View File

@ -97,18 +97,3 @@ const PinList *pinmap_restricted_pins()
};
return &pin_list;
}
/* List of peripherals excluded from testing */
const PeripheralList *pinmap_restricted_peripherals()
{
static const int perifs[] = {
STDIO_UART // Dedicated to USB VCOM
};
static const PeripheralList peripheral_list = {
sizeof(perifs) / sizeof(perifs[0]),
perifs
};
return &peripheral_list;
}

View File

@ -30,7 +30,7 @@ void pin_function(PinName pin, int data)
uint32_t port_index = NU_PINNAME_TO_PORT(pin);
__IO uint32_t *Px_x_MFP = ((__IO uint32_t *) &SYS->PA_L_MFP) + port_index * 2 + (pin_index / 8);
uint32_t MFP_Msk = NU_MFP_MSK(pin_index);
// E.g.: SYS->PA_L_MFP = (SYS->PA_L_MFP & (~SYS_PA_L_MFP_PA0_MFP_Msk) ) | SYS_PA_L_MFP_PA0_MFP_SC0_CD ;
*Px_x_MFP = (*Px_x_MFP & (~MFP_Msk)) | data;
}
@ -44,7 +44,7 @@ void pin_mode(PinName pin, PinMode mode)
uint32_t pin_index = NU_PINNAME_TO_PIN(pin);
uint32_t port_index = NU_PINNAME_TO_PORT(pin);
GPIO_T *gpio_base = NU_PORT_BASE(port_index);
uint32_t mode_intern;
switch (mode) {
@ -59,7 +59,7 @@ void pin_mode(PinName pin, PinMode mode)
case OpenDrain:
mode_intern = GPIO_PMD_OPEN_DRAIN;
break;
default:
/* H/W doesn't support separate configuration for input pull mode/direction.
* We expect upper layer would have translated input pull mode/direction
@ -77,18 +77,3 @@ void pin_mode(PinName pin, PinMode mode)
* 2. PushPullOutput/PIN_INPUT
*/
}
/* List of peripherals excluded from testing */
const PeripheralList *pinmap_restricted_peripherals()
{
static const int perifs[] = {
STDIO_UART // Dedicated to USB VCOM
};
static const PeripheralList peripheral_list = {
sizeof(perifs) / sizeof(perifs[0]),
perifs
};
return &peripheral_list;
}

View File

@ -31,10 +31,10 @@ void pin_function(PinName pin, int data)
__IO uint32_t *GPx_MFPx = ((__IO uint32_t *) &SYS->GPA_MFPL) + port_index * 2 + (pin_index / 8);
//uint32_t MFP_Pos = NU_MFP_POS(pin_index);
uint32_t MFP_Msk = NU_MFP_MSK(pin_index);
// E.g.: SYS->GPA_MFPL = (SYS->GPA_MFPL & (~SYS_GPA_MFPL_PA0MFP_Msk) ) | SYS_GPA_MFPL_PA0MFP_SC0_CD ;
*GPx_MFPx = (*GPx_MFPx & (~MFP_Msk)) | data;
// [TODO] Disconnect JTAG-DP + SW-DP signals.
// Warning: Need to reconnect under reset
//if ((pin == PA_13) || (pin == PA_14)) {
@ -54,7 +54,7 @@ void pin_mode(PinName pin, PinMode mode)
uint32_t pin_index = NU_PINNAME_TO_PIN(pin);
uint32_t port_index = NU_PINNAME_TO_PORT(pin);
GPIO_T *gpio_base = NU_PORT_BASE(port_index);
uint32_t mode_intern;
switch (mode) {
@ -91,18 +91,3 @@ void pin_mode(PinName pin, PinMode mode)
* 2. PushPullOutput/PIN_INPUT
*/
}
/* List of peripherals excluded from testing */
const PeripheralList *pinmap_restricted_peripherals()
{
static const int perifs[] = {
STDIO_UART // Dedicated to USB VCOM
};
static const PeripheralList peripheral_list = {
sizeof(perifs) / sizeof(perifs[0]),
perifs
};
return &peripheral_list;
}