All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SWM: Switch Matrix Module

## Overview

The MCUXpresso SDK provides a peripheral driver for the Switch Matrix Module (SWM) module of MCUXpresso SDK devices.

# SWM: Switch Matrix Module

## SWM Operations

The function SWM_SetMovablePinSelect() will selects a movable pin designated by its GPIO port and bit numbers to a function.

The function SWM_SetFixedMovablePinSelect() will selects a fixed movable pin designated by its GPIO port and bit numbers to a function.

The function SWM_SetFixedPinSelect() will enables a fixed-pin function in PINENABLE0 or PINENABLE1.

## Files

file | fsl_swm.h

## Functions

void | SWM_SetMovablePinSelect (SWM_Type *base, swm_select_movable_t func, swm_port_pin_type_t swm_port_pin)
| Assignment of digital peripheral functions to pins. More...
void | SWM_SetFixedPinSelect (SWM_Type *base, swm_select_fixed_pin_t func, bool enable)
| Enable the fixed-pin function. More...

## swm connections

enum

swm_port_pin_type_t {
kSWM_PortPin_P0_0 = 0U,
kSWM_PortPin_P0_1 = 1U,
kSWM_PortPin_P0_2 = 2U,
kSWM_PortPin_P0_3 = 3U,
kSWM_PortPin_P0_4 = 4U,
kSWM_PortPin_P0_5 = 5U,
kSWM_PortPin_P0_6 = 6U,
kSWM_PortPin_P0_7 = 7U,
kSWM_PortPin_P0_8 = 8U,
kSWM_PortPin_P0_9 = 9U,
kSWM_PortPin_P0_10 = 10U,
kSWM_PortPin_P0_11 = 11U,
kSWM_PortPin_P0_12 = 12U,
kSWM_PortPin_P0_13 = 13U,
kSWM_PortPin_P0_14 = 14U,
kSWM_PortPin_P0_15 = 15U,
kSWM_PortPin_P0_16 = 16U,
kSWM_PortPin_P0_17 = 17U,
kSWM_PortPin_P0_18 = 18U,
kSWM_PortPin_P0_19 = 19U,
kSWM_PortPin_P0_20 = 20U,
kSWM_PortPin_P0_21 = 21U,
kSWM_PortPin_P0_22 = 22U,
kSWM_PortPin_P0_23 = 23U,
kSWM_PortPin_P0_24 = 24U,
kSWM_PortPin_P0_25 = 25U,
kSWM_PortPin_P0_26 = 26U,
kSWM_PortPin_P0_27 = 27U,
kSWM_PortPin_P0_28 = 28U,
kSWM_PortPin_P0_29 = 29U,
kSWM_PortPin_P0_30 = 30U,
kSWM_PortPin_P0_31 = 31U,
kSWM_PortPin_P1_0 = 32U,
kSWM_PortPin_P1_1 = 33U,
kSWM_PortPin_P1_2 = 34U,
kSWM_PortPin_P1_3 = 35U,
kSWM_PortPin_P1_4 = 36U,
kSWM_PortPin_P1_5 = 37U,
kSWM_PortPin_P1_6 = 38U,
kSWM_PortPin_P1_7 = 39U,
kSWM_PortPin_P1_8 = 40U,
kSWM_PortPin_P1_9 = 41U,
kSWM_PortPin_P1_10 = 42U,
kSWM_PortPin_P1_11 = 43U,
kSWM_PortPin_P1_12 = 44U,
kSWM_PortPin_P1_13 = 45U,
kSWM_PortPin_P1_14 = 46U,
kSWM_PortPin_P1_15 = 47U,
kSWM_PortPin_P1_16 = 48U,
kSWM_PortPin_P1_17 = 49U,
kSWM_PortPin_P1_18 = 50U,
kSWM_PortPin_P1_19 = 51U,
kSWM_PortPin_P1_20 = 52U,
kSWM_PortPin_P1_21 = 53U,
kSWM_PortPin_Reset = 0xffU
}

| SWM port_pin number. More...

enum

swm_select_movable_t {
kSWM_USART0_TXD = 0U,
kSWM_USART0_RXD = 1U,
kSWM_USART0_RTS = 2U,
kSWM_USART0_CTS = 3U,
kSWM_USART0_SCLK = 4U,
kSWM_USART1_TXD = 5U,
kSWM_USART1_RXD = 6U,
kSWM_USART1_RTS = 7U,
kSWM_USART1_CTS = 8U,
kSWM_USART1_SCLK = 9U,
kSWM_USART2_TXD = 10U,
kSWM_USART2_RXD = 11U,
kSWM_USART2_RTS = 12U,
kSWM_USART2_CTS = 13U,
kSWM_USART2_SCLK = 14U,
kSWM_SPI0_SCK = 15U,
kSWM_SPI0_MOSI = 16U,
kSWM_SPI0_MISO = 17U,
kSWM_SPI0_SSEL0 = 18U,
kSWM_SPI0_SSEL1 = 19U,
kSWM_SPI0_SSEL2 = 20U,
kSWM_SPI0_SSEL3 = 21U,
kSWM_SPI1_SCK = 22U,
kSWM_SPI1_MOSI = 23U,
kSWM_SPI1_MISO = 24U,
kSWM_SPI1_SSEL0 = 25U,
kSWM_SPI1_SSEL1 = 26U,
kSWM_SCT_PIN0 = 27U,
kSWM_SCT_PIN1 = 28U,
kSWM_SCT_PIN2 = 29U,
kSWM_SCT_PIN3 = 30U,
kSWM_SCT_OUT0 = 31U,
kSWM_SCT_OUT1 = 32U,
kSWM_SCT_OUT2 = 33U,
kSWM_SCT_OUT3 = 34U,
kSWM_SCT_OUT4 = 35U,
kSWM_SCT_OUT5 = 36U,
kSWM_SCT_OUT6 = 37U,
kSWM_I2C1_SDA = 38U,
kSWM_I2C1_SCL = 39U,
kSWM_I2C2_SDA = 40U,
kSWM_I2C2_SCL = 41U,
kSWM_I2C3_SDA = 42U,
kSWM_I2C3_SCL = 43U,
kSWM_ACMP_OUT = 44U,
kSWM_CLKOUT = 45U,
kSWM_GPIO_INT_BMAT = 46U,
kSWM_USART3_TXD = 47U,
kSWM_USART3_RXD = 48U,
kSWM_USART3_SCLK = 49U,
kSWM_USART4_TXD = 50U,
kSWM_USART4_RXD = 51U,
kSWM_USART4_SCLK = 52U,
kSWM_T0_MAT_CHN0 = 53U,
kSWM_T0_MAT_CHN1 = 54U,
kSWM_T0_MAT_CHN2 = 55U,
kSWM_T0_MAT_CHN3 = 56U,
kSWM_T0_CAP_CHN0 = 57U,
kSWM_T0_CAP_CHN1 = 58U,
kSWM_T0_CAP_CHN2 = 59U,
kSWM_MOVABLE_NUM_FUNCS = 60U
}

| SWM movable selection. More...

enum

swm_select_fixed_pin_t {
kSWM_ACMP_INPUT1 = SWM_PINENABLE0_ACMP_I1_MASK,
kSWM_ACMP_INPUT2 = SWM_PINENABLE0_ACMP_I2_MASK,
kSWM_ACMP_INPUT3 = SWM_PINENABLE0_ACMP_I3_MASK,
kSWM_ACMP_INPUT4 = SWM_PINENABLE0_ACMP_I4_MASK,
kSWM_ACMP_INPUT5 = SWM_PINENABLE0_ACMP_I5_MASK,
kSWM_SWCLK = SWM_PINENABLE0_SWCLK_MASK,
kSWM_SWDIO = SWM_PINENABLE0_SWDIO_MASK,
kSWM_XTALIN = SWM_PINENABLE0_XTALIN_MASK,
kSWM_XTALOUT = SWM_PINENABLE0_XTALOUT_MASK,
kSWM_RESETN = SWM_PINENABLE0_RESETN_MASK,
kSWM_CLKIN = SWM_PINENABLE0_CLKIN_MASK,
kSWM_VDDCMP = SWM_PINENABLE0_VDDCMP_MASK,
kSWM_I2C0_SDA = SWM_PINENABLE0_I2C0_SDA_MASK,
kSWM_I2C0_SCL = SWM_PINENABLE0_I2C0_SCL_MASK,
kSWM_ADC_CHN0 = SWM_PINENABLE0_ADC_0_MASK,
kSWM_ADC_CHN1 = SWM_PINENABLE0_ADC_1_MASK,
kSWM_ADC_CHN2 = SWM_PINENABLE0_ADC_2_MASK,
kSWM_ADC_CHN3 = SWM_PINENABLE0_ADC_3_MASK,
kSWM_ADC_CHN4 = SWM_PINENABLE0_ADC_4_MASK,
kSWM_ADC_CHN5 = SWM_PINENABLE0_ADC_5_MASK,
kSWM_ADC_CHN6 = SWM_PINENABLE0_ADC_6_MASK,
kSWM_ADC_CHN7 = SWM_PINENABLE0_ADC_7_MASK,
kSWM_ADC_CHN8 = SWM_PINENABLE0_ADC_8_MASK,
kSWM_ADC_CHN9 = SWM_PINENABLE0_ADC_9_MASK,
kSWM_ADC_CHN10 = SWM_PINENABLE0_ADC_10_MASK,
kSWM_ADC_CHN11 = SWM_PINENABLE0_ADC_11_MASK,
kSWM_DAC_OUT0 = SWM_PINENABLE0_DACOUT0_MASK,
kSWM_DAC_OUT1 = SWM_PINENABLE0_DACOUT1_MASK,
kSWM_CAPT_X0,
kSWM_CAPT_X1 = SWM_PINENABLE0_CAPT_X1_MASK,
kSWM_CAPT_X2 = SWM_PINENABLE0_CAPT_X2_MASK,
kSWM_CAPT_X3 = (int)SWM_PINENABLE0_CAPT_X3_MASK,
kSWM_CAPT_X4 = (int)(SWM_PINENABLE1_CAPT_X4_MASK | 0x80000000U),
kSWM_CAPT_X5 = (int)(SWM_PINENABLE1_CAPT_X5_MASK | 0x80000000U),
kSWM_CAPT_X6 = (int)(SWM_PINENABLE1_CAPT_X6_MASK | 0x80000000U),
kSWM_CAPT_X7 = (int)(SWM_PINENABLE1_CAPT_X7_MASK | 0x80000000U),
kSWM_CAPT_X8 = (int)(SWM_PINENABLE1_CAPT_X8_MASK | 0x80000000U),
kSWM_CAPT_YL,
kSWM_CAPT_YH = (int)(SWM_PINENABLE1_CAPT_YH_MASK | 0x80000000U),
kSWM_FIXEDPIN_NUM_FUNCS = (int)0x80000041U
}

| SWM fixed pin selection. More...

## Driver version

#define | FSL_SWM_DRIVER_VERSION (MAKE_VERSION(2, 0, 2))
| Version 2.0.2.

## Enumeration Type Documentation

enum swm_port_pin_type_t

Enumerator
kSWM_PortPin_P0_0 | port_pin number P0_0.
kSWM_PortPin_P0_1 | port_pin number P0_1.
kSWM_PortPin_P0_2 | port_pin number P0_2.
kSWM_PortPin_P0_3 | port_pin number P0_3.
kSWM_PortPin_P0_4 | port_pin number P0_4.
kSWM_PortPin_P0_5 | port_pin number P0_5.
kSWM_PortPin_P0_6 | port_pin number P0_6.
kSWM_PortPin_P0_7 | port_pin number P0_7.
kSWM_PortPin_P0_8 | port_pin number P0_8.
kSWM_PortPin_P0_9 | port_pin number P0_9.
kSWM_PortPin_P0_10 | port_pin number P0_10.
kSWM_PortPin_P0_11 | port_pin number P0_11.
kSWM_PortPin_P0_12 | port_pin number P0_12.
kSWM_PortPin_P0_13 | port_pin number P0_13.
kSWM_PortPin_P0_14 | port_pin number P0_14.
kSWM_PortPin_P0_15 | port_pin number P0_15.
kSWM_PortPin_P0_16 | port_pin number P0_16.
kSWM_PortPin_P0_17 | port_pin number P0_17.
kSWM_PortPin_P0_18 | port_pin number P0_18.
kSWM_PortPin_P0_19 | port_pin number P0_19.
kSWM_PortPin_P0_20 | port_pin number P0_20.
kSWM_PortPin_P0_21 | port_pin number P0_21.
kSWM_PortPin_P0_22 | port_pin number P0_22.
kSWM_PortPin_P0_23 | port_pin number P0_23.
kSWM_PortPin_P0_24 | port_pin number P0_24.
kSWM_PortPin_P0_25 | port_pin number P0_25.
kSWM_PortPin_P0_26 | port_pin number P0_26.
kSWM_PortPin_P0_27 | port_pin number P0_27.
kSWM_PortPin_P0_28 | port_pin number P0_28.
kSWM_PortPin_P0_29 | port_pin number P0_29.
kSWM_PortPin_P0_30 | port_pin number P0_30.
kSWM_PortPin_P0_31 | port_pin number P0_31.
kSWM_PortPin_P1_0 | port_pin number P1_0.
kSWM_PortPin_P1_1 | port_pin number P1_1.
kSWM_PortPin_P1_2 | port_pin number P1_2.
kSWM_PortPin_P1_3 | port_pin number P1_3.
kSWM_PortPin_P1_4 | port_pin number P1_4.
kSWM_PortPin_P1_5 | port_pin number P1_5.
kSWM_PortPin_P1_6 | port_pin number P1_6.
kSWM_PortPin_P1_7 | port_pin number P1_7.
kSWM_PortPin_P1_8 | port_pin number P1_8.
kSWM_PortPin_P1_9 | port_pin number P1_9.
kSWM_PortPin_P1_10 | port_pin number P1_10.
kSWM_PortPin_P1_11 | port_pin number P1_11.
kSWM_PortPin_P1_12 | port_pin number P1_12.
kSWM_PortPin_P1_13 | port_pin number P1_13.
kSWM_PortPin_P1_14 | port_pin number P1_14.
kSWM_PortPin_P1_15 | port_pin number P1_15.
kSWM_PortPin_P1_16 | port_pin number P1_16.
kSWM_PortPin_P1_17 | port_pin number P1_17.
kSWM_PortPin_P1_18 | port_pin number P1_18.
kSWM_PortPin_P1_19 | port_pin number P1_19.
kSWM_PortPin_P1_20 | port_pin number P1_20.
kSWM_PortPin_P1_21 | port_pin number P1_21.
kSWM_PortPin_Reset | port_pin reset number.

enum swm_select_movable_t

Enumerator
kSWM_USART0_TXD | Movable function as USART0_TXD.
kSWM_USART0_RXD | Movable function as USART0_RXD.
kSWM_USART0_RTS | Movable function as USART0_RTS.
kSWM_USART0_CTS | Movable function as USART0_CTS.
kSWM_USART0_SCLK | Movable function as USART0_SCLK.
kSWM_USART1_TXD | Movable function as USART1_TXD.
kSWM_USART1_RXD | Movable function as USART1_RXD.
kSWM_USART1_RTS | Movable function as USART1_RTS.
kSWM_USART1_CTS | Movable function as USART1_CTS.
kSWM_USART1_SCLK | Movable function as USART1_SCLK.
kSWM_USART2_TXD | Movable function as USART2_TXD.
kSWM_USART2_RXD | Movable function as USART2_RXD.
kSWM_USART2_RTS | Movable function as USART2_RTS.
kSWM_USART2_CTS | Movable function as USART2_CTS.
kSWM_USART2_SCLK | Movable function as USART2_SCLK.
kSWM_SPI0_SCK | Movable function as SPI0_SCK.
kSWM_SPI0_MOSI | Movable function as SPI0_MOSI.
kSWM_SPI0_MISO | Movable function as SPI0_MISO.
kSWM_SPI0_SSEL0 | Movable function as SPI0_SSEL0.
kSWM_SPI0_SSEL1 | Movable function as SPI0_SSEL1.
kSWM_SPI0_SSEL2 | Movable function as SPI0_SSEL2.
kSWM_SPI0_SSEL3 | Movable function as SPI0_SSEL3.
kSWM_SPI1_SCK | Movable function as SPI1_SCK.
kSWM_SPI1_MOSI | Movable function as SPI1_MOSI.
kSWM_SPI1_MISO | Movable function as SPI1_MISO.
kSWM_SPI1_SSEL0 | Movable function as SPI1_SSEL0.
kSWM_SPI1_SSEL1 | Movable function as SPI1_SSEL1.
kSWM_SCT_PIN0 | Movable function as SCT_PIN0.
kSWM_SCT_PIN1 | Movable function as SCT_PIN1.
kSWM_SCT_PIN2 | Movable function as SCT_PIN2.
kSWM_SCT_PIN3 | Movable function as SCT_PIN3.
kSWM_SCT_OUT0 | Movable function as SCT_OUT0.
kSWM_SCT_OUT1 | Movable function as SCT_OUT1.
kSWM_SCT_OUT2 | Movable function as SCT_OUT2.
kSWM_SCT_OUT3 | Movable function as SCT_OUT3.
kSWM_SCT_OUT4 | Movable function as SCT_OUT4.
kSWM_SCT_OUT5 | Movable function as SCT_OUT5.
kSWM_SCT_OUT6 | Movable function as SCT_OUT6.
kSWM_I2C1_SDA | Movable function as I2C1_SDA.
kSWM_I2C1_SCL | Movable function as I2C1_SCL.
kSWM_I2C2_SDA | Movable function as I2C2_SDA.
kSWM_I2C2_SCL | Movable function as I2C2_SCL.
kSWM_I2C3_SDA | Movable function as I2C3_SDA.
kSWM_I2C3_SCL | Movable function as I2C3_SCL.
kSWM_ACMP_OUT | Movable function as ACMP_OUT.
kSWM_CLKOUT | Movable function as CLKOUT.
kSWM_GPIO_INT_BMAT | Movable function as GPIO_INT_BMAT.
kSWM_USART3_TXD | Movable function as USART3_TXD.
kSWM_USART3_RXD | Movable function as USART3_RXD.
kSWM_USART3_SCLK | Movable function as USART3_SCLK.
kSWM_USART4_TXD | Movable function as USART4_TXD.
kSWM_USART4_RXD | Movable function as USART4_RXD.
kSWM_USART4_SCLK | Movable function as USART4_SCLK.
kSWM_T0_MAT_CHN0 | Movable function as Timer Match Channel 0.
kSWM_T0_MAT_CHN1 | Movable function as Timer Match Channel 1.
kSWM_T0_MAT_CHN2 | Movable function as Timer Match Channel 2.
kSWM_T0_MAT_CHN3 | Movable function as Timer Match Channel 3.
kSWM_T0_CAP_CHN0 | Movable function as Timer Capture Channel 0.
kSWM_T0_CAP_CHN1 | Movable function as Timer Capture Channel 1.
kSWM_T0_CAP_CHN2 | Movable function as Timer Capture Channel 2.
kSWM_MOVABLE_NUM_FUNCS | Movable function number.

enum swm_select_fixed_pin_t

Enumerator
kSWM_ACMP_INPUT1 | Fixed-pin function as ACMP_INPUT1.
kSWM_ACMP_INPUT2 | Fixed-pin function as ACMP_INPUT2.
kSWM_ACMP_INPUT3 | Fixed-pin function as ACMP_INPUT3.
kSWM_ACMP_INPUT4 | Fixed-pin function as ACMP_INPUT4.
kSWM_ACMP_INPUT5 | Fixed-pin function as ACMP_INPUT5.
kSWM_SWCLK | Fixed-pin function as SWCLK.
kSWM_SWDIO | Fixed-pin function as SWDIO.
kSWM_XTALIN | Fixed-pin function as XTALIN.
kSWM_XTALOUT | Fixed-pin function as XTALOUT.
kSWM_RESETN | Fixed-pin function as RESETN.
kSWM_CLKIN | Fixed-pin function as CLKIN.
kSWM_VDDCMP | Fixed-pin function as VDDCMP.
kSWM_I2C0_SDA | Fixed-pin function as I2C0_SDA.
kSWM_I2C0_SCL | Fixed-pin function as I2C0_SCL.
kSWM_ADC_CHN0 | Fixed-pin function as ADC_CHN0.
kSWM_ADC_CHN1 | Fixed-pin function as ADC_CHN1.
kSWM_ADC_CHN2 | Fixed-pin function as ADC_CHN2.
kSWM_ADC_CHN3 | Fixed-pin function as ADC_CHN3.
kSWM_ADC_CHN4 | Fixed-pin function as ADC_CHN4.
kSWM_ADC_CHN5 | Fixed-pin function as ADC_CHN5.
kSWM_ADC_CHN6 | Fixed-pin function as ADC_CHN6.
kSWM_ADC_CHN7 | Fixed-pin function as ADC_CHN7.
kSWM_ADC_CHN8 | Fixed-pin function as ADC_CHN8.
kSWM_ADC_CHN9 | Fixed-pin function as ADC_CHN9.
kSWM_ADC_CHN10 | Fixed-pin function as ADC_CHN10.
kSWM_ADC_CHN11 | Fixed-pin function as ADC_CHN11.
kSWM_DAC_OUT0 | Fixed-pin function as DACOUT0.
kSWM_DAC_OUT1 | Fixed-pin function as DACOUT1.
kSWM_CAPT_X0 | Fixed-pin function as CAPT_X0, an X capacitor(a mutual capacitance touch sensor) .
kSWM_CAPT_X1 | Fixed-pin function as CAPT_X1.
kSWM_CAPT_X2 | Fixed-pin function as CAPT_X2.
kSWM_CAPT_X3 | Fixed-pin function as CAPT_X3.
kSWM_CAPT_X4 | Fixed-pin function as CAPT_X4.
kSWM_CAPT_X5 | Fixed-pin function as CAPT_X5.
kSWM_CAPT_X6 | Fixed-pin function as CAPT_X6.
kSWM_CAPT_X7 | Fixed-pin function as CAPT_X7.
kSWM_CAPT_X8 | Fixed-pin function as CAPT_X8.
kSWM_CAPT_YL | Fixed-pin function as CAPT_YL, an Y capacitor(the measurement capacitor) .
kSWM_CAPT_YH | Fixed-pin function as CAPT_YH.
kSWM_FIXEDPIN_NUM_FUNCS | Fixed-pin function number.

## Function Documentation

void SWM_SetMovablePinSelect | ( | SWM_Type * | base,
|  | swm_select_movable_t | func,
|  | swm_port_pin_type_t | swm_port_pin
| ) |  |

This function will selects a pin (designated by its GPIO port and bit numbers) to a function.

Parameters

  base | SWM peripheral base address.
  func | any function name that is movable.
  swm_port_pin | any pin which has a GPIO port number and bit number.

void SWM_SetFixedPinSelect | ( | SWM_Type * | base,
|  | swm_select_fixed_pin_t | func,
|  | bool | enable
| ) |  |

This function will enables a fixed-pin function in PINENABLE0 or PINENABLE1.

Parameters

  base | SWM peripheral base address.
  func | any function name that is fixed pin.
  enable | enable or disable.