32
32
#include "PeripheralPinMaps.h"
33
33
34
34
35
- #if DEVICE_PWMOUT
35
+ #if defined( DEVICE_PWMOUT ) && defined( PINMAP_PWM )
36
36
MSTD_CONSTEXPR_FN_14 PinMap get_pwm_pinmap (const PinName pin )
37
37
{
38
38
for (const PinMap & pinmap : PINMAP_PWM ) {
@@ -44,7 +44,7 @@ MSTD_CONSTEXPR_FN_14 PinMap get_pwm_pinmap(const PinName pin)
44
44
}
45
45
#endif // DEVICE_PWMOUT
46
46
47
- #if DEVICE_ANALOGIN
47
+ #if defined( DEVICE_ANALOGIN ) & & defined ( PINMAP_ANALOGIN )
48
48
MSTD_CONSTEXPR_FN_14 PinMap get_analogin_pinmap (const PinName pin )
49
49
{
50
50
for (const PinMap & pinmap : PINMAP_ANALOGIN ) {
@@ -56,7 +56,7 @@ MSTD_CONSTEXPR_FN_14 PinMap get_analogin_pinmap(const PinName pin)
56
56
}
57
57
#endif // DEVICE_ANALOGIN
58
58
59
- #if DEVICE_ANALOGOUT
59
+ #if defined( DEVICE_ANALOGOUT ) & & defined ( PINMAP_ANALOGOUT )
60
60
MSTD_CONSTEXPR_FN_14 PinMap get_analogout_pinmap (const PinName pin )
61
61
{
62
62
for (const PinMap & pinmap : PINMAP_ANALOGOUT ) {
@@ -68,7 +68,7 @@ MSTD_CONSTEXPR_FN_14 PinMap get_analogout_pinmap(const PinName pin)
68
68
}
69
69
#endif // DEVICE_ANALOGOUT
70
70
71
- #if DEVICE_I2C
71
+ #if defined( DEVICE_I2C ) & & defined ( PINMAP_I2C_SDA ) && defined ( PINMAP_I2C_SCL )
72
72
MSTD_CONSTEXPR_FN_14 i2c_pinmap_t get_i2c_pinmap (const PinName sda , const PinName scl )
73
73
{
74
74
const PinMap * sda_map = nullptr ;
@@ -95,7 +95,7 @@ MSTD_CONSTEXPR_FN_14 i2c_pinmap_t get_i2c_pinmap(const PinName sda, const PinNam
95
95
}
96
96
#endif //DEVICE_I2C
97
97
98
- #if DEVICE_SERIAL
98
+ #if defined( DEVICE_SERIAL ) && defined( PINMAP_UART_TX ) && defined( PINMAP_UART_RX )
99
99
MSTD_CONSTEXPR_FN_14 serial_pinmap_t get_uart_pinmap (const PinName tx , const PinName rx )
100
100
{
101
101
const PinMap * tx_map = nullptr ;
@@ -125,7 +125,7 @@ MSTD_CONSTEXPR_FN_14 serial_pinmap_t get_uart_pinmap(const PinName tx, const Pin
125
125
}
126
126
}
127
127
128
- #if DEVICE_SERIAL_FC
128
+ #if defined( DEVICE_SERIAL_FC ) && defined( PINMAP_UART_RTS ) && defined( PINMAP_UART_CTS )
129
129
MSTD_CONSTEXPR_FN_14 serial_fc_pinmap_t get_uart_fc_pinmap (const PinName rxflow , const PinName txflow )
130
130
{
131
131
const PinMap * rts_map = nullptr ;
@@ -153,7 +153,7 @@ MSTD_CONSTEXPR_FN_14 serial_fc_pinmap_t get_uart_fc_pinmap(const PinName rxflow,
153
153
#endif // DEVICE_SERIAL_FC
154
154
#endif // DEVICE_SERIAL
155
155
156
- #if DEVICE_SPI
156
+ #if defined( DEVICE_SPI ) && defined( PINMAP_SPI_MOSI ) && defined( PINMAP_SPI_MISO ) && defined( PINMAP_SPI_SCLK ) && defined( PINMAP_SPI_SSEL )
157
157
MSTD_CONSTEXPR_FN_14 spi_pinmap_t get_spi_pinmap (const PinName mosi , const PinName miso , const PinName sclk , const PinName ssel )
158
158
{
159
159
const PinMap * mosi_map = nullptr ;
@@ -198,7 +198,7 @@ MSTD_CONSTEXPR_FN_14 spi_pinmap_t get_spi_pinmap(const PinName mosi, const PinNa
198
198
}
199
199
#endif // DEVICE_SPI
200
200
201
- #if DEVICE_CAN
201
+ #if defined( DEVICE_CAN ) && defined( PINMAP_CAN_RD ) && defined( PINMAP_CAN_TD )
202
202
MSTD_CONSTEXPR_FN_14 can_pinmap_t get_can_pinmap (const PinName rd , const PinName td )
203
203
{
204
204
const PinMap * rd_map = nullptr ;
@@ -225,7 +225,7 @@ MSTD_CONSTEXPR_FN_14 can_pinmap_t get_can_pinmap(const PinName rd, const PinName
225
225
}
226
226
#endif //DEVICE_CAN
227
227
228
- #if DEVICE_QSPI
228
+ #if defined( DEVICE_QSPI ) && defined( PINMAP_QSPI_DATA0 ) && defined( PINMAP_QSPI_DATA1 ) && defined( PINMAP_QSPI_DATA2 ) && defined( PINMAP_QSPI_DATA3 ) && defined( PINMAP_QSPI_SCLK ) && defined( PINMAP_QSPI_SSEL )
229
229
MSTD_CONSTEXPR_FN_14 qspi_pinmap_t get_qspi_pinmap (const PinName data0 , const PinName data1 , const PinName data2 , const PinName data3 , const PinName sclk , const PinName ssel )
230
230
{
231
231
const PinMap * data0_map = nullptr ;
0 commit comments