From b2dad0838778d16a6a73067b9ce01c85c1774f3c Mon Sep 17 00:00:00 2001 From: Przemyslaw Stekiel Date: Wed, 6 Nov 2019 11:18:03 +0100 Subject: [PATCH] Change explicit pinmap to static pinmap --- .../analogin/main.cpp | 2 +- .../mbed_hal_fpga_ci_test_shield/i2c/main.cpp | 6 ++--- .../mbed_hal_fpga_ci_test_shield/pwm/main.cpp | 2 +- .../mbed_hal_fpga_ci_test_shield/spi/main.cpp | 2 +- .../uart/main.cpp | 6 ++--- drivers/I2C.h | 4 ++-- drivers/I2CSlave.h | 4 ++-- drivers/QSPI.h | 2 +- drivers/SPI.h | 10 ++++---- drivers/SPISlave.h | 2 +- drivers/Serial.h | 8 +++---- drivers/SerialBase.h | 4 ++-- drivers/UARTSerial.h | 4 ++-- drivers/source/I2C.cpp | 10 ++++---- drivers/source/I2CSlave.cpp | 4 ++-- drivers/source/QSPI.cpp | 6 ++--- drivers/source/SPI.cpp | 10 ++++---- drivers/source/Serial.cpp | 4 ++-- drivers/source/SerialBase.cpp | 12 +++++----- drivers/source/UARTSerial.cpp | 4 ++-- ...{explicit_pinmap.cpp => static_pinmap.cpp} | 2 +- hal/{explicit_pinmap.h => static_pinmap.h} | 12 +++++----- platform/source/mbed_retarget.cpp | 8 +++---- .../TARGET_MCU_K64F/TARGET_FRDM/PinNames.h | 2 +- .../TARGET_MCU_K64F/pwmout_api.c | 4 ++-- .../TARGET_MCUXpresso_MCUS/api/analogin_api.c | 6 ++--- .../api/analogout_api.c | 6 ++--- .../TARGET_MCUXpresso_MCUS/api/i2c_api.c | 2 +- .../TARGET_MCU_NRF52840/PortNames.h | 2 +- .../TARGET_NRF5x/TARGET_NRF52/analogin_api.c | 6 ++--- .../TARGET_LPC/analogin_api.c | 6 ++--- .../TARGET_LPC/i2c_api.c | 2 +- .../TARGET_LPC/lp_analogin_api.c | 6 ++--- .../TARGET_LPC/serial_api.c | 4 ++-- .../TARGET_LPC/spi_api.c | 2 +- .../TARGET_LPCXpresso/PinNames.h | 2 +- .../TARGET_NUCLEO_F303RE/PinNames.h | 2 +- .../TARGET_STM32F3/analogin_device.c | 6 ++--- .../TARGET_STM32F3/analogout_device.c | 6 ++--- .../TARGET_STM/TARGET_STM32F3/serial_device.c | 2 +- .../TARGET_NUCLEO_F411RE/PinNames.h | 2 +- .../TARGET_NUCLEO_F429ZI/PinNames.h | 2 +- .../TARGET_STM32F4/analogin_device.c | 6 ++--- .../TARGET_STM32F4/analogout_device.c | 6 ++--- .../TARGET_STM/TARGET_STM32F4/serial_device.c | 2 +- .../TARGET_NUCLEO_L073RZ/PinNames.h | 2 +- .../TARGET_STM32L0/analogin_device.c | 6 ++--- .../TARGET_STM32L0/analogout_device.c | 6 ++--- .../TARGET_STM/TARGET_STM32L0/serial_device.c | 2 +- .../TARGET_DISCO_L475VG_IOT01A/PinNames.h | 2 +- .../TARGET_STM32L4/analogin_device.c | 6 ++--- .../TARGET_STM32L4/analogout_device.c | 6 ++--- .../TARGET_STM/TARGET_STM32L4/serial_device.c | 2 +- targets/TARGET_STM/can_api.c | 24 +++++++++---------- targets/TARGET_STM/i2c_api.c | 6 ++--- targets/TARGET_STM/pwmout_api.c | 6 ++--- targets/TARGET_STM/qspi_api.c | 12 +++++----- targets/TARGET_STM/serial_api.c | 2 +- targets/TARGET_STM/stm_spi_api.c | 2 +- 59 files changed, 148 insertions(+), 148 deletions(-) rename hal/{explicit_pinmap.cpp => static_pinmap.cpp} (98%) rename hal/{explicit_pinmap.h => static_pinmap.h} (98%) diff --git a/TESTS/mbed_hal_fpga_ci_test_shield/analogin/main.cpp b/TESTS/mbed_hal_fpga_ci_test_shield/analogin/main.cpp index 2a3727c5c9..57b4459ae3 100644 --- a/TESTS/mbed_hal_fpga_ci_test_shield/analogin/main.cpp +++ b/TESTS/mbed_hal_fpga_ci_test_shield/analogin/main.cpp @@ -28,7 +28,7 @@ #include "greentea-client/test_env.h" #include "mbed.h" #include "pinmap.h" -#include "hal/explicit_pinmap.h" +#include "hal/static_pinmap.h" #include "test_utils.h" #include "MbedTester.h" #include "analogin_fpga_test.h" diff --git a/TESTS/mbed_hal_fpga_ci_test_shield/i2c/main.cpp b/TESTS/mbed_hal_fpga_ci_test_shield/i2c/main.cpp index 9eb9834462..5a0ee68f05 100644 --- a/TESTS/mbed_hal_fpga_ci_test_shield/i2c/main.cpp +++ b/TESTS/mbed_hal_fpga_ci_test_shield/i2c/main.cpp @@ -29,7 +29,7 @@ #include "mbed.h" #include "i2c_api.h" #include "pinmap.h" -#include "hal/explicit_pinmap.h" +#include "hal/static_pinmap.h" #include "test_utils.h" #include "I2CTester.h" #include "i2c_fpga_test.h" @@ -69,11 +69,11 @@ void fpga_i2c_test_write(PinName sda, PinName scl) i2c_t i2c; memset(&i2c, 0, sizeof(i2c)); if (init_direct) { -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY const i2c_pinmap_t pinmap = get_i2c_pinmap(sda, scl); i2c_init_direct(&i2c, &pinmap); #else - //skip this test case if explicit pinmap is not supported + //skip this test case if static pinmap is not supported return; #endif } else { diff --git a/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp b/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp index 807c7949b9..988631b39f 100644 --- a/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp +++ b/TESTS/mbed_hal_fpga_ci_test_shield/pwm/main.cpp @@ -29,7 +29,7 @@ #include "mbed.h" #include "MbedTester.h" #include "pinmap.h" -#include "hal/explicit_pinmap.h" +#include "hal/static_pinmap.h" #include "test_utils.h" #include "pwm_fpga_test.h" diff --git a/TESTS/mbed_hal_fpga_ci_test_shield/spi/main.cpp b/TESTS/mbed_hal_fpga_ci_test_shield/spi/main.cpp index 8d93a17cc7..7fde81864f 100644 --- a/TESTS/mbed_hal_fpga_ci_test_shield/spi/main.cpp +++ b/TESTS/mbed_hal_fpga_ci_test_shield/spi/main.cpp @@ -29,7 +29,7 @@ #include "mbed.h" #include "SPIMasterTester.h" #include "pinmap.h" -#include "hal/explicit_pinmap.h" +#include "hal/static_pinmap.h" #include "test_utils.h" #include "spi_fpga_test.h" diff --git a/TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp b/TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp index 90f838ee73..56c94347af 100644 --- a/TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp +++ b/TESTS/mbed_hal_fpga_ci_test_shield/uart/main.cpp @@ -34,7 +34,7 @@ #include "serial_api.h" #include "us_ticker_api.h" #include "uart_fpga_test.h" -#include "hal/explicit_pinmap.h" +#include "hal/static_pinmap.h" using namespace utest::v1; @@ -128,11 +128,11 @@ static void uart_test_common(int baudrate, int data_bits, SerialParity parity, i #if DEVICE_SERIAL_FC if (use_flow_control) { if (init_direct) { -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY const serial_fc_pinmap_t pinmap = get_uart_fc_pinmap(rts, cts); serial_set_flow_control_direct(&serial, FlowControlRTSCTS, &pinmap); #else - //skip this test case if explicit pinmap is not supported + //skip this test case if static pinmap is not supported return; #endif } else { diff --git a/drivers/I2C.h b/drivers/I2C.h index 4bd6090a26..0d48ba7e2a 100644 --- a/drivers/I2C.h +++ b/drivers/I2C.h @@ -103,9 +103,9 @@ public: /** Create an I2C Master interface, connected to the specified pins * - * @param explicit_pinmap reference to structure which holds static pinmap. + * @param static_pinmap reference to structure which holds static pinmap. */ - I2C(const i2c_pinmap_t &explicit_pinmap); + I2C(const i2c_pinmap_t &static_pinmap); I2C(const i2c_pinmap_t &&) = delete; // prevent passing of temporary objects /** Set the frequency of the I2C interface diff --git a/drivers/I2CSlave.h b/drivers/I2CSlave.h index 2b601ce8f7..066fe042b5 100644 --- a/drivers/I2CSlave.h +++ b/drivers/I2CSlave.h @@ -88,9 +88,9 @@ public: /** Create an I2C Slave interface, connected to the specified pins. * - * @param explicit_pinmap reference to structure which holds static pinmap. + * @param static_pinmap reference to structure which holds static pinmap. */ - I2CSlave(const i2c_pinmap_t &explicit_pinmap); + I2CSlave(const i2c_pinmap_t &static_pinmap); I2CSlave(const i2c_pinmap_t &&) = delete; // prevent passing of temporary objects /** Set the frequency of the I2C interface. diff --git a/drivers/QSPI.h b/drivers/QSPI.h index 8e89b3b3fa..1ef8df2396 100644 --- a/drivers/QSPI.h +++ b/drivers/QSPI.h @@ -235,7 +235,7 @@ protected: int _mode; //SPI mode bool _initialized; PinName _qspi_io0, _qspi_io1, _qspi_io2, _qspi_io3, _qspi_clk, _qspi_cs; //IO lines, clock and chip select - const qspi_pinmap_t *_explicit_pinmap; + const qspi_pinmap_t *_static_pinmap; bool (QSPI::* _init_func)(void); private: diff --git a/drivers/SPI.h b/drivers/SPI.h index 1e18d21c92..f4820f795c 100644 --- a/drivers/SPI.h +++ b/drivers/SPI.h @@ -140,9 +140,9 @@ public: * * @note You can specify mosi or miso as NC if not used. * - * @param explicit_pinmap reference to structure which holds static pinmap. + * @param static_pinmap reference to structure which holds static pinmap. */ - SPI(const spi_pinmap_t &explicit_pinmap); + SPI(const spi_pinmap_t &static_pinmap); SPI(const spi_pinmap_t &&) = delete; // prevent passing of temporary objects /** Create a SPI master connected to the specified pins. @@ -154,10 +154,10 @@ public: * * @note You can specify mosi or miso as NC if not used. * - * @param explicit_pinmap reference to structure which holds static pinmap. + * @param static_pinmap reference to structure which holds static pinmap. * @param ssel SPI Chip Select pin. */ - SPI(const spi_pinmap_t &explicit_pinmap, PinName ssel); + SPI(const spi_pinmap_t &static_pinmap, PinName ssel); SPI(const spi_pinmap_t &&, PinName) = delete; // prevent passing of temporary objects virtual ~SPI(); @@ -438,7 +438,7 @@ protected: /* Select count to handle re-entrant selection */ int8_t _select_count; /* Static pinmap data */ - const spi_pinmap_t *_explicit_pinmap; + const spi_pinmap_t *_static_pinmap; /* SPI peripheral name */ SPIName _peripheral_name; /* Pointer to spi init function */ diff --git a/drivers/SPISlave.h b/drivers/SPISlave.h index 798cb3c9d1..16a3a77021 100644 --- a/drivers/SPISlave.h +++ b/drivers/SPISlave.h @@ -75,7 +75,7 @@ public: * * @note Either mosi or miso can be specified as NC if not used. * - * @param explicit_pinmap reference to structure which holds static pinmap. + * @param static_pinmap reference to structure which holds static pinmap. */ SPISlave(const spi_pinmap_t &pinmap); SPISlave(const spi_pinmap_t &&) = delete; // prevent passing of temporary objects diff --git a/drivers/Serial.h b/drivers/Serial.h index 94b6b9fe6c..5d81420b25 100644 --- a/drivers/Serial.h +++ b/drivers/Serial.h @@ -75,14 +75,14 @@ public: /** Create a Serial port, connected to the specified transmit and receive pins * - * @param explicit_pinmap reference to structure which holds static pinmap. + * @param static_pinmap reference to structure which holds static pinmap. * @param name The name of the stream associated with this serial port (optional) * @param baud The baud rate of the serial port (optional, defaults to MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE or 9600) * * @note * Either tx or rx may be specified as NC (Not Connected) if unused */ - Serial(const serial_pinmap_t &explicit_pinmap, const char *name = NULL, int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE); + Serial(const serial_pinmap_t &static_pinmap, const char *name = NULL, int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE); Serial(const serial_pinmap_t &&, const char * = NULL, int = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE) = delete; // prevent passing of temporary objects /** Create a Serial port, connected to the specified transmit and receive pins, with the specified baud @@ -98,13 +98,13 @@ public: /** Create a Serial port, connected to the specified transmit and receive pins, with the specified baud * - * @param explicit_pinmap reference to structure which holds static pinmap. + * @param static_pinmap reference to structure which holds static pinmap. * @param baud The baud rate of the serial port * * @note * Either tx or rx may be specified as NC (Not Connected) if unused */ - Serial(const serial_pinmap_t &explicit_pinmap, int baud); + Serial(const serial_pinmap_t &static_pinmap, int baud); Serial(const serial_pinmap_t &&, int) = delete; // prevent passing of temporary objects /* Stream gives us a FileHandle with non-functional poll()/readable()/writable. Pass through diff --git a/drivers/SerialBase.h b/drivers/SerialBase.h index ace3333511..831807785f 100644 --- a/drivers/SerialBase.h +++ b/drivers/SerialBase.h @@ -206,7 +206,7 @@ public: * @param type the flow control type (Disabled, RTS, CTS, RTSCTS) * @param pinmap reference to structure which holds static pinmap */ - void set_flow_control(Flow type, const serial_fc_pinmap_t &explicit_pinmap); + void set_flow_control(Flow type, const serial_fc_pinmap_t &static_pinmap); #endif static void _irq_handler(uint32_t id, SerialIrq irq_type); @@ -320,7 +320,7 @@ protected: #if !defined(DOXYGEN_ONLY) protected: SerialBase(PinName tx, PinName rx, int baud); - SerialBase(const serial_pinmap_t &explicit_pinmap, int baud); + SerialBase(const serial_pinmap_t &static_pinmap, int baud); virtual ~SerialBase(); int _base_getc(); diff --git a/drivers/UARTSerial.h b/drivers/UARTSerial.h index f94ad4303c..85cffa8849 100644 --- a/drivers/UARTSerial.h +++ b/drivers/UARTSerial.h @@ -60,10 +60,10 @@ public: UARTSerial(PinName tx, PinName rx, int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE); /** Create a UARTSerial port, connected to the specified transmit and receive pins, with a particular baud rate. - * @param explicit_pinmap reference to structure which holds static pinmap + * @param static_pinmap reference to structure which holds static pinmap * @param baud The baud rate of the serial port (optional, defaults to MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE) */ - UARTSerial(const serial_pinmap_t &explicit_pinmap, int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE); + UARTSerial(const serial_pinmap_t &static_pinmap, int baud = MBED_CONF_PLATFORM_DEFAULT_SERIAL_BAUD_RATE); virtual ~UARTSerial(); diff --git a/drivers/source/I2C.cpp b/drivers/source/I2C.cpp index 8691f66a1f..8ee0520d0e 100644 --- a/drivers/source/I2C.cpp +++ b/drivers/source/I2C.cpp @@ -47,7 +47,7 @@ I2C::I2C(PinName sda, PinName scl) : unlock(); } -I2C::I2C(const i2c_pinmap_t &explicit_pinmap) : +I2C::I2C(const i2c_pinmap_t &static_pinmap) : #if DEVICE_I2C_ASYNCH _irq(this), _usage(DMA_USAGE_NEVER), _deep_sleep_locked(false), #endif @@ -55,10 +55,10 @@ I2C::I2C(const i2c_pinmap_t &explicit_pinmap) : { lock(); // The init function also set the frequency to 100000 - _sda = explicit_pinmap.sda_pin; - _scl = explicit_pinmap.scl_pin; - recover(explicit_pinmap.sda_pin, explicit_pinmap.scl_pin); - i2c_init_direct(&_i2c, &explicit_pinmap); + _sda = static_pinmap.sda_pin; + _scl = static_pinmap.scl_pin; + recover(static_pinmap.sda_pin, static_pinmap.scl_pin); + i2c_init_direct(&_i2c, &static_pinmap); // Used to avoid unnecessary frequency updates _owner = this; unlock(); diff --git a/drivers/source/I2CSlave.cpp b/drivers/source/I2CSlave.cpp index d4619df91a..4317df9656 100644 --- a/drivers/source/I2CSlave.cpp +++ b/drivers/source/I2CSlave.cpp @@ -27,9 +27,9 @@ I2CSlave::I2CSlave(PinName sda, PinName scl) : _i2c() i2c_slave_mode(&_i2c, 1); } -I2CSlave::I2CSlave(const i2c_pinmap_t &explicit_pinmap) : _i2c() +I2CSlave::I2CSlave(const i2c_pinmap_t &static_pinmap) : _i2c() { - i2c_init_direct(&_i2c, &explicit_pinmap); + i2c_init_direct(&_i2c, &static_pinmap); i2c_frequency(&_i2c, 100000); i2c_slave_mode(&_i2c, 1); } diff --git a/drivers/source/QSPI.cpp b/drivers/source/QSPI.cpp index d145c31f80..09e299c820 100644 --- a/drivers/source/QSPI.cpp +++ b/drivers/source/QSPI.cpp @@ -49,7 +49,7 @@ QSPI::QSPI(PinName io0, PinName io1, PinName io2, PinName io3, PinName sclk, Pin _qspi_io3 = io3; _qspi_clk = sclk; _qspi_cs = ssel; - _explicit_pinmap = NULL; + _static_pinmap = NULL; _inst_width = QSPI_CFG_BUS_SINGLE; _address_width = QSPI_CFG_BUS_SINGLE; _address_size = QSPI_CFG_ADDR_SIZE_24; @@ -75,7 +75,7 @@ QSPI::QSPI(const qspi_pinmap_t &pinmap, int mode) : _qspi() _qspi_io3 = pinmap.data3_pin; _qspi_clk = pinmap.sclk_pin; _qspi_cs = pinmap.ssel_pin; - _explicit_pinmap = &pinmap; + _static_pinmap = &pinmap; _inst_width = QSPI_CFG_BUS_SINGLE; _address_width = QSPI_CFG_BUS_SINGLE; _address_size = QSPI_CFG_ADDR_SIZE_24; @@ -291,7 +291,7 @@ bool QSPI::_initialize_direct() return _initialized; } - qspi_status_t ret = qspi_init_direct(&_qspi, _explicit_pinmap, _hz, _mode); + qspi_status_t ret = qspi_init_direct(&_qspi, _static_pinmap, _hz, _mode); if (QSPI_STATUS_OK == ret) { _initialized = true; } else { diff --git a/drivers/source/SPI.cpp b/drivers/source/SPI.cpp index 1837fc17ab..71f4f76221 100644 --- a/drivers/source/SPI.cpp +++ b/drivers/source/SPI.cpp @@ -37,7 +37,7 @@ SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel) : _sclk(sclk), _hw_ssel(ssel), _sw_ssel(NC), - _explicit_pinmap(NULL), + _static_pinmap(NULL), _init_func(_do_init) { // Need backwards compatibility with HALs not providing API @@ -59,7 +59,7 @@ SPI::SPI(PinName mosi, PinName miso, PinName sclk, PinName ssel, use_gpio_ssel_t _sclk(sclk), _hw_ssel(NC), _sw_ssel(ssel, 1), - _explicit_pinmap(NULL), + _static_pinmap(NULL), _init_func(_do_init) { // Need backwards compatibility with HALs not providing API @@ -80,7 +80,7 @@ SPI::SPI(const spi_pinmap_t &pinmap) : _sclk(pinmap.sclk_pin), _hw_ssel(pinmap.ssel_pin), _sw_ssel(NC), - _explicit_pinmap(&pinmap), + _static_pinmap(&pinmap), _peripheral_name((SPIName)pinmap.peripheral), _init_func(_do_init_direct) @@ -97,7 +97,7 @@ SPI::SPI(const spi_pinmap_t &pinmap, PinName ssel) : _sclk(pinmap.sclk_pin), _hw_ssel(NC), _sw_ssel(ssel, 1), - _explicit_pinmap(&pinmap), + _static_pinmap(&pinmap), _peripheral_name((SPIName)pinmap.peripheral), _init_func(_do_init_direct) { @@ -111,7 +111,7 @@ void SPI::_do_init(SPI *obj) void SPI::_do_init_direct(SPI *obj) { - spi_init_direct(&obj->_peripheral->spi, obj->_explicit_pinmap); + spi_init_direct(&obj->_peripheral->spi, obj->_static_pinmap); } void SPI::_do_construct() diff --git a/drivers/source/Serial.cpp b/drivers/source/Serial.cpp index fa95a68810..e972818af1 100644 --- a/drivers/source/Serial.cpp +++ b/drivers/source/Serial.cpp @@ -24,7 +24,7 @@ Serial::Serial(PinName tx, PinName rx, const char *name, int baud) : SerialBase( { } -Serial::Serial(const serial_pinmap_t &explicit_pinmap, const char *name, int baud) : SerialBase(explicit_pinmap, baud), Stream(name) +Serial::Serial(const serial_pinmap_t &static_pinmap, const char *name, int baud) : SerialBase(static_pinmap, baud), Stream(name) { } @@ -32,7 +32,7 @@ Serial::Serial(PinName tx, PinName rx, int baud): SerialBase(tx, rx, baud), Stre { } -Serial::Serial(const serial_pinmap_t &explicit_pinmap, int baud): SerialBase(explicit_pinmap, baud), Stream(NULL) +Serial::Serial(const serial_pinmap_t &static_pinmap, int baud): SerialBase(static_pinmap, baud), Stream(NULL) { } diff --git a/drivers/source/SerialBase.cpp b/drivers/source/SerialBase.cpp index 60c6055209..be4e62ea4e 100644 --- a/drivers/source/SerialBase.cpp +++ b/drivers/source/SerialBase.cpp @@ -40,7 +40,7 @@ SerialBase::SerialBase(PinName tx, PinName rx, int baud) : _init(); } -SerialBase::SerialBase(const serial_pinmap_t &explicit_pinmap, int baud) : +SerialBase::SerialBase(const serial_pinmap_t &static_pinmap, int baud) : #if DEVICE_SERIAL_ASYNCH _thunk_irq(this), _tx_usage(DMA_USAGE_NEVER), _rx_usage(DMA_USAGE_NEVER), _tx_callback(NULL), @@ -49,8 +49,8 @@ SerialBase::SerialBase(const serial_pinmap_t &explicit_pinmap, int baud) : #endif _serial(), _baud(baud), - _tx_pin(explicit_pinmap.tx_pin), - _rx_pin(explicit_pinmap.rx_pin) + _tx_pin(static_pinmap.tx_pin), + _rx_pin(static_pinmap.rx_pin) { // No lock needed in the constructor @@ -58,7 +58,7 @@ SerialBase::SerialBase(const serial_pinmap_t &explicit_pinmap, int baud) : _irq[i] = NULL; } - serial_init_direct(&_serial, &explicit_pinmap); + serial_init_direct(&_serial, &static_pinmap); serial_baud(&_serial, _baud); serial_irq_handler(&_serial, SerialBase::_irq_handler, (uint32_t)this); } @@ -316,11 +316,11 @@ void SerialBase::set_flow_control(Flow type, PinName flow1, PinName flow2) unlock(); } -void SerialBase::set_flow_control(Flow type, const serial_fc_pinmap_t &explicit_pinmap) +void SerialBase::set_flow_control(Flow type, const serial_fc_pinmap_t &static_pinmap) { lock(); FlowControl flow_type = (FlowControl)type; - serial_set_flow_control_direct(&_serial, flow_type, &explicit_pinmap); + serial_set_flow_control_direct(&_serial, flow_type, &static_pinmap); unlock(); } #endif diff --git a/drivers/source/UARTSerial.cpp b/drivers/source/UARTSerial.cpp index 88bb816ca4..91be64e083 100644 --- a/drivers/source/UARTSerial.cpp +++ b/drivers/source/UARTSerial.cpp @@ -36,8 +36,8 @@ UARTSerial::UARTSerial(PinName tx, PinName rx, int baud) : enable_rx_irq(); } -UARTSerial::UARTSerial(const serial_pinmap_t &explicit_pinmap, int baud) : - SerialBase(explicit_pinmap, baud), +UARTSerial::UARTSerial(const serial_pinmap_t &static_pinmap, int baud) : + SerialBase(static_pinmap, baud), _blocking(true), _tx_irq_enabled(false), _rx_irq_enabled(false), diff --git a/hal/explicit_pinmap.cpp b/hal/static_pinmap.cpp similarity index 98% rename from hal/explicit_pinmap.cpp rename to hal/static_pinmap.cpp index 779ebdecf2..ba1f958ed9 100644 --- a/hal/explicit_pinmap.cpp +++ b/hal/static_pinmap.cpp @@ -16,7 +16,7 @@ */ #include "mbed_error.h" -#include "explicit_pinmap.h" +#include "static_pinmap.h" /* diff --git a/hal/explicit_pinmap.h b/hal/static_pinmap.h similarity index 98% rename from hal/explicit_pinmap.h rename to hal/static_pinmap.h index cddea23183..fafed9cc92 100644 --- a/hal/explicit_pinmap.h +++ b/hal/static_pinmap.h @@ -14,8 +14,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -#ifndef EXPLICIT_PINMAP_H -#define EXPLICIT_PINMAP_H +#ifndef STATIC_PINMAP_H +#define STATIC_PINMAP_H #include "PinNames.h" #include "spi_api.h" @@ -28,7 +28,7 @@ #include "can_api.h" #include -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #include "PeripheralPinMaps.h" @@ -293,7 +293,7 @@ MSTD_CONSTEXPR_FN_14 qspi_pinmap_t get_qspi_pinmap(const PinName data0, const Pi } #endif //DEVICE_QSPI -#else // EXPLICIT_PINMAP_READY +#else // STATIC_PINMAP_READY #if DEVICE_PWMOUT MSTD_CONSTEXPR_FN_14 PinMap get_pwm_pinmap(const PinName pin) @@ -358,6 +358,6 @@ MSTD_CONSTEXPR_FN_14 qspi_pinmap_t get_qspi_pinmap(const PinName data0, const Pi } #endif //DEVICE_QSPI -#endif // EXPLICIT_PINMAP_READY +#endif // STATIC_PINMAP_READY -#endif // EXPLICIT_PINMAP_H +#endif // STATIC_PINMAP_H diff --git a/platform/source/mbed_retarget.cpp b/platform/source/mbed_retarget.cpp index 01500c355a..59f69b0f4b 100644 --- a/platform/source/mbed_retarget.cpp +++ b/platform/source/mbed_retarget.cpp @@ -33,7 +33,7 @@ #include "drivers/UARTSerial.h" #include "hal/us_ticker_api.h" #include "hal/lp_ticker_api.h" -#include "hal/explicit_pinmap.h" +#include "hal/static_pinmap.h" #include #include #include @@ -155,7 +155,7 @@ extern serial_t stdio_uart; class DirectSerial : public FileHandle { public: DirectSerial(PinName tx, PinName rx, int baud); - DirectSerial(const serial_pinmap_t &explicit_pinmap, int baud); + DirectSerial(const serial_pinmap_t &static_pinmap, int baud); virtual ssize_t write(const void *buffer, size_t size); virtual ssize_t read(void *buffer, size_t size); virtual off_t seek(off_t offset, int whence = SEEK_SET) @@ -198,12 +198,12 @@ DirectSerial::DirectSerial(PinName tx, PinName rx, int baud) #endif } -DirectSerial::DirectSerial(const serial_pinmap_t &explicit_pinmap, int baud) +DirectSerial::DirectSerial(const serial_pinmap_t &static_pinmap, int baud) { if (stdio_uart_inited) { return; } - serial_init_direct(&stdio_uart, &explicit_pinmap); + serial_init_direct(&stdio_uart, &static_pinmap); serial_baud(&stdio_uart, baud); #if CONSOLE_FLOWCONTROL == CONSOLE_FLOWCONTROL_RTS diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/TARGET_FRDM/PinNames.h b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/TARGET_FRDM/PinNames.h index 8a89418942..b74c977529 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/TARGET_FRDM/PinNames.h +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/TARGET_FRDM/PinNames.h @@ -23,7 +23,7 @@ extern "C" { #endif /* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */ -#define EXPLICIT_PINMAP_READY 1 +#define STATIC_PINMAP_READY 1 typedef enum { PIN_INPUT, diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/pwmout_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/pwmout_api.c index e89fb9a229..c8b6778196 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/pwmout_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_MCU_K64F/pwmout_api.c @@ -79,9 +79,9 @@ void pwmout_init(pwmout_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_PWM); int function = (int)pinmap_find_function(pin, PinMap_PWM); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - pwmout_init_direct(obj, &explicit_pinmap); + pwmout_init_direct(obj, &static_pinmap); } void pwmout_free(pwmout_t *obj) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/analogin_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/analogin_api.c index ce2e8073ab..d74a4e3c3a 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/analogin_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/analogin_api.c @@ -29,7 +29,7 @@ static ADC_Type *const adc_addrs[] = ADC_BASE_PTRS; #define MAX_FADC 6000000 -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGIN_INIT_DIRECT analogin_init_direct void analogin_init_direct(analogin_t *obj, const PinMap *pinmap) #else @@ -71,9 +71,9 @@ void analogin_init(analogin_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_ADC); int function = (int)pinmap_find_function(pin, PinMap_ADC); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGIN_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGIN_INIT_DIRECT(obj, &static_pinmap); } uint16_t analogin_read_u16(analogin_t *obj) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/analogout_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/analogout_api.c index 62fb8ae290..869fda6239 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/analogout_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/analogout_api.c @@ -28,7 +28,7 @@ static DAC_Type *const dac_bases[] = DAC_BASE_PTRS; #define RANGE_12BIT 0xFFF -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGOUT_INIT_DIRECT analogout_init_direct void analogout_init_direct(dac_t *obj, const PinMap *pinmap) #else @@ -54,9 +54,9 @@ void analogout_init(dac_t *obj, PinName pin) { int peripheral = (int)pinmap_peripheral(pin, PinMap_ADC); - const PinMap explicit_pinmap = {pin, peripheral, 0}; + const PinMap static_pinmap = {pin, peripheral, 0}; - ANALOGOUT_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGOUT_INIT_DIRECT(obj, &static_pinmap); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/i2c_api.c b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/i2c_api.c index 0affddbc20..ddb164aef5 100644 --- a/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/i2c_api.c +++ b/targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/api/i2c_api.c @@ -32,7 +32,7 @@ static I2C_Type *const i2c_addrs[] = I2C_BASE_PTRS; /* Array of I2C bus clock frequencies */ static clock_name_t const i2c_clocks[] = I2C_CLOCK_FREQS; -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define I2C_INIT_DIRECT i2c_init_direct void i2c_init_direct(i2c_t *obj, const i2c_pinmap_t *pinmap) #else diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/PortNames.h b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/PortNames.h index 81ad361a19..4aa24481dd 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/PortNames.h +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/TARGET_MCU_NRF52840/PortNames.h @@ -44,7 +44,7 @@ extern "C" { #endif /* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */ -#define EXPLICIT_PINMAP_READY 1 +#define STATIC_PINMAP_READY 1 typedef enum { diff --git a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c index 11450be689..e66be66f50 100644 --- a/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c +++ b/targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/analogin_api.c @@ -45,7 +45,7 @@ void SAADC_IRQHandler(void); * @param obj The analogin object to initialize * @param pin The analogin pin name */ -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGIN_INIT_DIRECT analogin_init_direct void analogin_init_direct(analogin_t *obj, const PinMap *pinmap) #else @@ -117,9 +117,9 @@ void analogin_init(analogin_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_ADC); int function = (int)pinmap_find_function(pin, PinMap_ADC); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGIN_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGIN_INIT_DIRECT(obj, &static_pinmap); } /** Read the input voltage, represented as a float in the range [0.0, 1.0] diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/analogin_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/analogin_api.c index 1d6370f0c0..048b631642 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/analogin_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/analogin_api.c @@ -32,7 +32,7 @@ extern void ADC_ClockPower_Configuration(void); #define MAX_FADC 6000000 #define MAX_ADC_CLOCK 80000000 -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGIN_INIT_DIRECT analogin_init_direct void analogin_init_direct(analogin_t *obj, const PinMap *pinmap) #else @@ -83,9 +83,9 @@ void analogin_init(analogin_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_ADC); int function = (int)pinmap_find_function(pin, PinMap_ADC); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGIN_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGIN_INIT_DIRECT(obj, &static_pinmap); } uint16_t analogin_read_u16(analogin_t *obj) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/i2c_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/i2c_api.c index e9731fe2a7..9fbdd0efbc 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/i2c_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/i2c_api.c @@ -26,7 +26,7 @@ /* Array of I2C peripheral base address. */ static I2C_Type *const i2c_addrs[] = I2C_BASE_PTRS; -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define I2C_INIT_DIRECT i2c_init_direct void i2c_init_direct(i2c_t *obj, const i2c_pinmap_t *pinmap) #else diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/lp_analogin_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/lp_analogin_api.c index 94851f5669..8547ac0a28 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/lp_analogin_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/lp_analogin_api.c @@ -32,7 +32,7 @@ extern void ADC_ClockPower_Configuration(void); #define LPADC_USER_CMDID 1U /* CMD1 */ -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGIN_INIT_DIRECT analogin_init_direct void analogin_init_direct(analogin_t *obj, const PinMap *pinmap) #else @@ -113,9 +113,9 @@ void analogin_init(analogin_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_ADC); int function = (int)pinmap_find_function(pin, PinMap_ADC); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGIN_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGIN_INIT_DIRECT(obj, &static_pinmap); } uint16_t analogin_read_u16(analogin_t *obj) diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c index ea3a2d8c84..c0a811ad79 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/serial_api.c @@ -38,7 +38,7 @@ static USART_Type *const uart_addrs[] = USART_BASE_PTRS; int stdio_uart_inited = 0; serial_t stdio_uart; -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SERIAL_INIT_DIRECT serial_init_direct void serial_init_direct(serial_t *obj, const serial_pinmap_t *pinmap) #else @@ -405,7 +405,7 @@ void serial_break_clear(serial_t *obj) /* * Only hardware flow control is implemented in this API. */ -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SERIAL_SET_FC_DIRECT serial_set_flow_control_direct void serial_set_flow_control_direct(serial_t *obj, FlowControl type, const serial_fc_pinmap_t *pinmap) #else diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/spi_api.c b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/spi_api.c index ff41721c26..0ab1a091eb 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/spi_api.c +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/spi_api.c @@ -30,7 +30,7 @@ static SPI_Type *const spi_address[] = SPI_BASE_PTRS; static int baud_rate = 0; -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SPI_INIT_DIRECT spi_init_direct void spi_init_direct(spi_t *obj, const spi_pinmap_t *pinmap) #else diff --git a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_LPCXpresso/PinNames.h b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_LPCXpresso/PinNames.h index cbd63bfba5..7ce39c341d 100644 --- a/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_LPCXpresso/PinNames.h +++ b/targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC55S69/TARGET_LPCXpresso/PinNames.h @@ -23,7 +23,7 @@ extern "C" { #endif /* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */ -#define EXPLICIT_PINMAP_READY 1 +#define STATIC_PINMAP_READY 1 typedef enum { PIN_INPUT, diff --git a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303RE/PinNames.h b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303RE/PinNames.h index cd07550f16..60c0109ca8 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303RE/PinNames.h +++ b/targets/TARGET_STM/TARGET_STM32F3/TARGET_STM32F303xE/TARGET_NUCLEO_F303RE/PinNames.h @@ -39,7 +39,7 @@ extern "C" { #endif /* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */ -#define EXPLICIT_PINMAP_READY 1 +#define STATIC_PINMAP_READY 1 typedef enum { ALT0 = 0x100, diff --git a/targets/TARGET_STM/TARGET_STM32F3/analogin_device.c b/targets/TARGET_STM/TARGET_STM32F3/analogin_device.c index 2751b2fe14..e5b6fa329d 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/analogin_device.c +++ b/targets/TARGET_STM/TARGET_STM32F3/analogin_device.c @@ -37,7 +37,7 @@ #include "mbed_debug.h" #include "PeripheralPins.h" -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGIN_INIT_DIRECT analogin_init_direct void analogin_init_direct(analogin_t *obj, const PinMap *pinmap) #else @@ -130,9 +130,9 @@ void analogin_init(analogin_t *obj, PinName pin) function = (int)pinmap_find_function(pin, PinMap_ADC_Internal); } - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGIN_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGIN_INIT_DIRECT(obj, &static_pinmap); } uint16_t adc_read(analogin_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c index a761d9f59c..7ee22c2caa 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c @@ -39,7 +39,7 @@ static int pa4_used = 0; static int pa5_used = 0; -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGOUT_INIT_DIRECT analogout_init_direct void analogout_init_direct(dac_t *obj, const PinMap *pinmap) #else @@ -128,9 +128,9 @@ void analogout_init(dac_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_DAC); int function = (int)pinmap_find_function(pin, PinMap_DAC); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGOUT_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGOUT_INIT_DIRECT(obj, &static_pinmap); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F3/serial_device.c b/targets/TARGET_STM/TARGET_STM32F3/serial_device.c index 91c815e427..ab7c011016 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/serial_device.c +++ b/targets/TARGET_STM/TARGET_STM32F3/serial_device.c @@ -645,7 +645,7 @@ void serial_rx_abort_asynch(serial_t *obj) * @param type The Control Flow type (FlowControlNone, FlowControlRTS, FlowControlCTS, FlowControlRTSCTS) * @param pinmap Pointer to structure which holds static pinmap */ -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SERIAL_SET_FC_DIRECT serial_set_flow_control_direct void serial_set_flow_control_direct(serial_t *obj, FlowControl type, const serial_fc_pinmap_t *pinmap) #else diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_NUCLEO_F411RE/PinNames.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_NUCLEO_F411RE/PinNames.h index 34ccee1bbf..d5090d7f97 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_NUCLEO_F411RE/PinNames.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F411xE/TARGET_NUCLEO_F411RE/PinNames.h @@ -39,7 +39,7 @@ extern "C" { #endif /* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */ -#define EXPLICIT_PINMAP_READY 1 +#define STATIC_PINMAP_READY 1 typedef enum { ALT0 = 0x100, diff --git a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/TARGET_NUCLEO_F429ZI/PinNames.h b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/TARGET_NUCLEO_F429ZI/PinNames.h index 94c3c40125..8bb297a602 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/TARGET_NUCLEO_F429ZI/PinNames.h +++ b/targets/TARGET_STM/TARGET_STM32F4/TARGET_STM32F429xI/TARGET_NUCLEO_F429ZI/PinNames.h @@ -39,7 +39,7 @@ extern "C" { #endif /* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */ -#define EXPLICIT_PINMAP_READY 1 +#define STATIC_PINMAP_READY 1 typedef enum { ALT0 = 0x100, diff --git a/targets/TARGET_STM/TARGET_STM32F4/analogin_device.c b/targets/TARGET_STM/TARGET_STM32F4/analogin_device.c index 4e7359c8ec..a33d130da6 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/analogin_device.c +++ b/targets/TARGET_STM/TARGET_STM32F4/analogin_device.c @@ -36,7 +36,7 @@ #include "mbed_error.h" #include "PeripheralPins.h" -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGIN_INIT_DIRECT analogin_init_direct void analogin_init_direct(analogin_t *obj, const PinMap *pinmap) #else @@ -118,9 +118,9 @@ void analogin_init(analogin_t *obj, PinName pin) function = (int)pinmap_find_function(pin, PinMap_ADC_Internal); } - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGIN_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGIN_INIT_DIRECT(obj, &static_pinmap); } uint16_t adc_read(analogin_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c index 764fd0b6ff..0cbb0a496f 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c @@ -35,7 +35,7 @@ #include "stm32f4xx_hal.h" #include "PeripheralPins.h" -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGOUT_INIT_DIRECT analogout_init_direct void analogout_init_direct(dac_t *obj, const PinMap *pinmap) #else @@ -100,9 +100,9 @@ void analogout_init(dac_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_DAC); int function = (int)pinmap_find_function(pin, PinMap_DAC); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGOUT_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGOUT_INIT_DIRECT(obj, &static_pinmap); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F4/serial_device.c b/targets/TARGET_STM/TARGET_STM32F4/serial_device.c index 6006d8f439..c5d52b8042 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/serial_device.c +++ b/targets/TARGET_STM/TARGET_STM32F4/serial_device.c @@ -727,7 +727,7 @@ void serial_rx_abort_asynch(serial_t *obj) * @param type The Control Flow type (FlowControlNone, FlowControlRTS, FlowControlCTS, FlowControlRTSCTS) * @param pinmap Pointer to structure which holds static pinmap */ -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SERIAL_SET_FC_DIRECT serial_set_flow_control_direct void serial_set_flow_control_direct(serial_t *obj, FlowControl type, const serial_fc_pinmap_t *pinmap) #else diff --git a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PinNames.h b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PinNames.h index 0b0aa96aed..b5ff7634e3 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PinNames.h +++ b/targets/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/PinNames.h @@ -39,7 +39,7 @@ extern "C" { #endif /* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */ -#define EXPLICIT_PINMAP_READY 1 +#define STATIC_PINMAP_READY 1 typedef enum { ALT0 = 0x100, diff --git a/targets/TARGET_STM/TARGET_STM32L0/analogin_device.c b/targets/TARGET_STM/TARGET_STM32L0/analogin_device.c index acf13f5e1c..a09786ec0b 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/analogin_device.c +++ b/targets/TARGET_STM/TARGET_STM32L0/analogin_device.c @@ -36,7 +36,7 @@ #include "mbed_error.h" #include "PeripheralPins.h" -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGIN_INIT_DIRECT analogin_init_direct void analogin_init_direct(analogin_t *obj, const PinMap *pinmap) #else @@ -115,9 +115,9 @@ void analogin_init(analogin_t *obj, PinName pin) function = (int)pinmap_find_function(pin, PinMap_ADC_Internal); } - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGIN_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGIN_INIT_DIRECT(obj, &static_pinmap); } uint16_t adc_read(analogin_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c index 4d4acc8013..74a95ad721 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c @@ -39,7 +39,7 @@ static int channel1_used = 0; static int channel2_used = 0; -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGOUT_INIT_DIRECT analogout_init_direct void analogout_init_direct(dac_t *obj, const PinMap *pinmap) #else @@ -109,9 +109,9 @@ void analogout_init(dac_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_DAC); int function = (int)pinmap_find_function(pin, PinMap_DAC); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGOUT_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGOUT_INIT_DIRECT(obj, &static_pinmap); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32L0/serial_device.c b/targets/TARGET_STM/TARGET_STM32L0/serial_device.c index f38c883332..73cbc3e250 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/serial_device.c +++ b/targets/TARGET_STM/TARGET_STM32L0/serial_device.c @@ -632,7 +632,7 @@ void serial_rx_abort_asynch(serial_t *obj) * @param type The Control Flow type (FlowControlNone, FlowControlRTS, FlowControlCTS, FlowControlRTSCTS) * @param pinmap Pointer to structure which holds static pinmap */ -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SERIAL_SET_FC_DIRECT serial_set_flow_control_direct void serial_set_flow_control_direct(serial_t *obj, FlowControl type, const serial_fc_pinmap_t *pinmap) #else diff --git a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TARGET_DISCO_L475VG_IOT01A/PinNames.h b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TARGET_DISCO_L475VG_IOT01A/PinNames.h index 70941108c1..f87465f9b2 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TARGET_DISCO_L475VG_IOT01A/PinNames.h +++ b/targets/TARGET_STM/TARGET_STM32L4/TARGET_STM32L475xG/TARGET_DISCO_L475VG_IOT01A/PinNames.h @@ -39,7 +39,7 @@ extern "C" { #endif /* If this macro is defined, then constexpr utility functions for pin-map seach can be used. */ -#define EXPLICIT_PINMAP_READY 1 +#define STATIC_PINMAP_READY 1 typedef enum { ALT0 = 0x100, diff --git a/targets/TARGET_STM/TARGET_STM32L4/analogin_device.c b/targets/TARGET_STM/TARGET_STM32L4/analogin_device.c index d501335b57..18d04157e3 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/analogin_device.c +++ b/targets/TARGET_STM/TARGET_STM32L4/analogin_device.c @@ -36,7 +36,7 @@ #include "mbed_error.h" #include "PeripheralPins.h" -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGIN_INIT_DIRECT analogin_init_direct void analogin_init_direct(analogin_t *obj, const PinMap *pinmap) #else @@ -127,9 +127,9 @@ void analogin_init(analogin_t *obj, PinName pin) function = (int)pinmap_find_function(pin, PinMap_ADC_Internal); } - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGIN_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGIN_INIT_DIRECT(obj, &static_pinmap); } diff --git a/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c index 827ef7e9fe..f4901bbf3c 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c @@ -39,7 +39,7 @@ static int channel1_used = 0; static int channel2_used = 0; -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define ANALOGOUT_INIT_DIRECT analogout_init_direct void analogout_init_direct(dac_t *obj, const PinMap *pinmap) #else @@ -113,9 +113,9 @@ void analogout_init(dac_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_DAC); int function = (int)pinmap_find_function(pin, PinMap_DAC); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - ANALOGOUT_INIT_DIRECT(obj, &explicit_pinmap); + ANALOGOUT_INIT_DIRECT(obj, &static_pinmap); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32L4/serial_device.c b/targets/TARGET_STM/TARGET_STM32L4/serial_device.c index 9290218cd6..102bdd98ed 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/serial_device.c +++ b/targets/TARGET_STM/TARGET_STM32L4/serial_device.c @@ -659,7 +659,7 @@ void serial_rx_abort_asynch(serial_t *obj) * @param type The Control Flow type (FlowControlNone, FlowControlRTS, FlowControlCTS, FlowControlRTSCTS) * @param pinmap Pointer to structure which holds static pinmap */ -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SERIAL_SET_FC_DIRECT serial_set_flow_control_direct void serial_set_flow_control_direct(serial_t *obj, FlowControl type, const serial_fc_pinmap_t *pinmap) #else diff --git a/targets/TARGET_STM/can_api.c b/targets/TARGET_STM/can_api.c index bc94624644..74300af791 100644 --- a/targets/TARGET_STM/can_api.c +++ b/targets/TARGET_STM/can_api.c @@ -57,7 +57,7 @@ int can_internal_init(can_t *obj) return 1; } -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define CAN_INIT_FREQ_DIRECT can_init_freq_direct void can_init_freq_direct(can_t *obj, const can_pinmap_t *pinmap, int hz) #else @@ -156,7 +156,7 @@ static void _can_init_freq_direct(can_t *obj, const can_pinmap_t *pinmap, int hz can_internal_init(obj); } -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define CAN_INIT_DIRECT can_init_direct void can_init_direct(can_t *obj, const can_pinmap_t *pinmap) #else @@ -177,10 +177,10 @@ void can_init(can_t *obj, PinName rd, PinName td) int function_rd = (int)pinmap_find_function(rd, PinMap_CAN_RD); int function_td = (int)pinmap_find_function(td, PinMap_CAN_TD); - const can_pinmap_t explicit_pinmap = {peripheral, rd, function_rd, td, function_td}; + const can_pinmap_t static_pinmap = {peripheral, rd, function_rd, td, function_td}; /* default frequency is 100 kHz */ - CAN_INIT_DIRECT(obj, &explicit_pinmap); + CAN_INIT_DIRECT(obj, &static_pinmap); } @@ -194,9 +194,9 @@ void can_init_freq(can_t *obj, PinName rd, PinName td, int hz) int function_rd = (int)pinmap_find_function(rd, PinMap_CAN_RD); int function_td = (int)pinmap_find_function(td, PinMap_CAN_TD); - const can_pinmap_t explicit_pinmap = {peripheral, rd, function_rd, td, function_td}; + const can_pinmap_t static_pinmap = {peripheral, rd, function_rd, td, function_td}; - CAN_INIT_FREQ_DIRECT(obj, &explicit_pinmap, 100000); + CAN_INIT_FREQ_DIRECT(obj, &static_pinmap, 100000); } @@ -584,7 +584,7 @@ static void can_registers_init(can_t *obj) } } -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define CAN_INIT_FREQ_DIRECT can_init_freq_direct void can_init_freq_direct(can_t *obj, const can_pinmap_t *pinmap, int hz) #else @@ -656,7 +656,7 @@ static void _can_init_freq_direct(can_t *obj, const can_pinmap_t *pinmap, int hz can_filter(obj, 0, 0, CANStandard, filter_number); } -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define CAN_INIT_DIRECT can_init_direct void can_init_direct(can_t *obj, const can_pinmap_t *pinmap) #else @@ -677,10 +677,10 @@ void can_init(can_t *obj, PinName rd, PinName td) int function_rd = (int)pinmap_find_function(rd, PinMap_CAN_RD); int function_td = (int)pinmap_find_function(td, PinMap_CAN_TD); - const can_pinmap_t explicit_pinmap = {peripheral, rd, function_rd, td, function_td}; + const can_pinmap_t static_pinmap = {peripheral, rd, function_rd, td, function_td}; /* default frequency is 100 kHz */ - CAN_INIT_DIRECT(obj, &explicit_pinmap); + CAN_INIT_DIRECT(obj, &static_pinmap); } void can_init_freq(can_t *obj, PinName rd, PinName td, int hz) @@ -692,9 +692,9 @@ void can_init_freq(can_t *obj, PinName rd, PinName td, int hz) int function_rd = (int)pinmap_find_function(rd, PinMap_CAN_RD); int function_td = (int)pinmap_find_function(td, PinMap_CAN_TD); - const can_pinmap_t explicit_pinmap = {peripheral, rd, function_rd, td, function_td}; + const can_pinmap_t static_pinmap = {peripheral, rd, function_rd, td, function_td}; - CAN_INIT_FREQ_DIRECT(obj, &explicit_pinmap, 100000); + CAN_INIT_FREQ_DIRECT(obj, &static_pinmap, 100000); } void can_irq_init(can_t *obj, can_irq_handler handler, uint32_t id) diff --git a/targets/TARGET_STM/i2c_api.c b/targets/TARGET_STM/i2c_api.c index 9a17142d66..df3dc4c587 100644 --- a/targets/TARGET_STM/i2c_api.c +++ b/targets/TARGET_STM/i2c_api.c @@ -279,7 +279,7 @@ void i2c_init_internal(i2c_t *obj, const i2c_pinmap_t *pinmap) if (pinmap != NULL) { obj_s->sda = pinmap->sda_pin; obj_s->scl = pinmap->scl_pin; -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY obj_s->sda_func = pinmap->sda_function; obj_s->scl_func = pinmap->scl_function; #endif @@ -335,7 +335,7 @@ void i2c_init_internal(i2c_t *obj, const i2c_pinmap_t *pinmap) #endif // Configure I2C pins -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY pin_function(obj_s->sda, obj_s->sda_func); pin_function(obj_s->scl, obj_s->scl_func); #else @@ -370,7 +370,7 @@ void i2c_init_internal(i2c_t *obj, const i2c_pinmap_t *pinmap) #endif } -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define I2C_INIT_DIRECT i2c_init_direct void i2c_init_direct(i2c_t *obj, const i2c_pinmap_t *pinmap) #else diff --git a/targets/TARGET_STM/pwmout_api.c b/targets/TARGET_STM/pwmout_api.c index 763272b52e..5739b6deb4 100644 --- a/targets/TARGET_STM/pwmout_api.c +++ b/targets/TARGET_STM/pwmout_api.c @@ -76,7 +76,7 @@ uint32_t TIM_ChannelConvert_HAL2LL(uint32_t channel, pwmout_t *obj) } } -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define PWM_INIT_DIRECT pwmout_init_direct void pwmout_init_direct(pwmout_t *obj, const PinMap *pinmap) #else @@ -212,9 +212,9 @@ void pwmout_init(pwmout_t *obj, PinName pin) int peripheral = (int)pinmap_peripheral(pin, PinMap_PWM); int function = (int)pinmap_find_function(pin, PinMap_PWM); - const PinMap explicit_pinmap = {pin, peripheral, function}; + const PinMap static_pinmap = {pin, peripheral, function}; - PWM_INIT_DIRECT(obj, &explicit_pinmap); + PWM_INIT_DIRECT(obj, &static_pinmap); } void pwmout_free(pwmout_t *obj) diff --git a/targets/TARGET_STM/qspi_api.c b/targets/TARGET_STM/qspi_api.c index 45ba1aa99b..c6f63f4c35 100644 --- a/targets/TARGET_STM/qspi_api.c +++ b/targets/TARGET_STM/qspi_api.c @@ -381,7 +381,7 @@ qspi_status_t qspi_prepare_command(const qspi_command_t *command, QSPI_CommandTy #if defined(OCTOSPI1) -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define QSPI_INIT_DIRECT qspi_init_direct qspi_status_t qspi_init_direct(qspi_t *obj, const qspi_pinmap_t *pinmap, uint32_t hz, uint8_t mode) #else @@ -512,13 +512,13 @@ qspi_status_t qspi_init(qspi_t *obj, PinName io0, PinName io1, PinName io2, PinN int function_sclk = (int)pinmap_find_function(sclk, PinMap_QSPI_SCLK); int function_ssel = (int)pinmap_find_function(ssel, PinMap_QSPI_SSEL); - const qspi_pinmap_t explicit_pinmap = {peripheral, io0, function_io0, io1, function_io1, io2, function_io2, io3, function_io3, sclk, function_sclk, ssel, function_ssel}; + const qspi_pinmap_t static_pinmap = {peripheral, io0, function_io0, io1, function_io1, io2, function_io2, io3, function_io3, sclk, function_sclk, ssel, function_ssel}; - QSPI_INIT_DIRECT(obj, &explicit_pinmap, hz, mode); + QSPI_INIT_DIRECT(obj, &static_pinmap, hz, mode); } #else /* OCTOSPI */ -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define QSPI_INIT_DIRECT qspi_init_direct qspi_status_t qspi_init_direct(qspi_t *obj, const qspi_pinmap_t *pinmap, uint32_t hz, uint8_t mode) #else @@ -613,9 +613,9 @@ qspi_status_t qspi_init(qspi_t *obj, PinName io0, PinName io1, PinName io2, PinN int function_sclk = (int)pinmap_find_function(sclk, PinMap_QSPI_SCLK); int function_ssel = (int)pinmap_find_function(ssel, PinMap_QSPI_SSEL); - const qspi_pinmap_t explicit_pinmap = {peripheral, io0, function_io0, io1, function_io1, io2, function_io2, io3, function_io3, sclk, function_sclk, ssel, function_ssel}; + const qspi_pinmap_t static_pinmap = {peripheral, io0, function_io0, io1, function_io1, io2, function_io2, io3, function_io3, sclk, function_sclk, ssel, function_ssel}; - QSPI_INIT_DIRECT(obj, &explicit_pinmap, hz, mode); + QSPI_INIT_DIRECT(obj, &static_pinmap, hz, mode); } #endif /* OCTOSPI */ diff --git a/targets/TARGET_STM/serial_api.c b/targets/TARGET_STM/serial_api.c index 2521c3c20c..c7d0ce3407 100644 --- a/targets/TARGET_STM/serial_api.c +++ b/targets/TARGET_STM/serial_api.c @@ -47,7 +47,7 @@ extern uint32_t serial_irq_ids[]; HAL_StatusTypeDef init_uart(serial_t *obj); int8_t get_uart_index(UARTName uart_name); -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SERIAL_INIT_DIRECT serial_init_direct void serial_init_direct(serial_t *obj, const serial_pinmap_t *pinmap) #else diff --git a/targets/TARGET_STM/stm_spi_api.c b/targets/TARGET_STM/stm_spi_api.c index 5976cad898..7b9ab7da8f 100644 --- a/targets/TARGET_STM/stm_spi_api.c +++ b/targets/TARGET_STM/stm_spi_api.c @@ -111,7 +111,7 @@ SPIName spi_get_peripheral_name(PinName mosi, PinName miso, PinName sclk) return spi_per; } -#if EXPLICIT_PINMAP_READY +#if STATIC_PINMAP_READY #define SPI_INIT_DIRECT spi_init_direct void spi_init_direct(spi_t *obj, const spi_pinmap_t *pinmap) #else