mirror of https://github.com/ARMmbed/mbed-os.git
Change explicit pinmap to static pinmap
parent
e3a34a57e1
commit
b2dad08387
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
*/
|
||||
|
||||
#include "mbed_error.h"
|
||||
#include "explicit_pinmap.h"
|
||||
#include "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 <mstd_cstddef>
|
||||
|
||||
#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
|
||||
|
|
@ -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 <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue