273 lines
16 KiB
C
273 lines
16 KiB
C
/*
|
|
* Copyright 2019 NXP
|
|
* All rights reserved.
|
|
*
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
*/
|
|
|
|
/***********************************************************************************************************************
|
|
* This file was generated by the MCUXpresso Config Tools. Any manual edits made to this file
|
|
* will be overwritten if the respective MCUXpresso Config Tools is used to update this file.
|
|
**********************************************************************************************************************/
|
|
|
|
/*
|
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
|
!!GlobalInfo
|
|
product: Pins v5.0
|
|
processor: MIMXRT1021xxxxx
|
|
package_id: MIMXRT1021DAG5A
|
|
mcu_data: ksdk2_0
|
|
processor_version: 5.0.2
|
|
board: MIMXRT1020-EVK
|
|
pin_labels:
|
|
- {pin_num: '93', pin_signal: GPIO_AD_B0_15, label: 'LCD_DC_GPIO_PIN/U11[25]/J19[2]', identifier: ENET_TXD1;LCD_DC_GPIO_PIN}
|
|
power_domains: {NVCC_GPIO: '3.3'}
|
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
|
*/
|
|
|
|
#include "fsl_common.h"
|
|
#include "fsl_iomuxc.h"
|
|
#include "fsl_gpio.h"
|
|
#include "pin_mux.h"
|
|
|
|
/* FUNCTION ************************************************************************************************************
|
|
*
|
|
* Function Name : BOARD_InitBootPins
|
|
* Description : Calls initialization functions.
|
|
*
|
|
* END ****************************************************************************************************************/
|
|
void BOARD_InitBootPins(void) {
|
|
BOARD_InitPins();
|
|
}
|
|
|
|
/*
|
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
|
BOARD_InitPins:
|
|
- options: {callFromInitBoot: 'true', coreID: core0, enableClock: 'true'}
|
|
- pin_list:
|
|
- {pin_num: '101', peripheral: LPUART1, signal: RX, pin_signal: GPIO_AD_B0_07, software_input_on: Disable}
|
|
- {pin_num: '105', peripheral: LPUART1, signal: TX, pin_signal: GPIO_AD_B0_06, software_input_on: Disable}
|
|
- {pin_num: '93', peripheral: GPIO1, signal: 'gpio_io, 15', pin_signal: GPIO_AD_B0_15, identifier: LCD_DC_GPIO_PIN, direction: OUTPUT, software_input_on: Disable}
|
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
|
*/
|
|
|
|
/* FUNCTION ************************************************************************************************************
|
|
*
|
|
* Function Name : BOARD_InitPins
|
|
* Description : Configures pin routing and optionally pin electrical features.
|
|
*
|
|
* END ****************************************************************************************************************/
|
|
void BOARD_InitPins(void) {
|
|
CLOCK_EnableClock(kCLOCK_Iomuxc); /* iomuxc clock (iomuxc_clk_enable): 0x03U */
|
|
|
|
/* GPIO configuration of LCD_DC_GPIO_PIN on GPIO_AD_B0_15 (pin 93) */
|
|
gpio_pin_config_t LCD_DC_GPIO_PIN_config = {
|
|
.direction = kGPIO_DigitalOutput,
|
|
.outputLogic = 0U,
|
|
.interruptMode = kGPIO_NoIntmode
|
|
};
|
|
/* Initialize GPIO functionality on GPIO_AD_B0_15 (pin 93) */
|
|
GPIO_PinInit(GPIO1, 15U, &LCD_DC_GPIO_PIN_config);
|
|
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_06_LPUART1_TX, /* GPIO_AD_B0_06 is configured as LPUART1_TX */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_07_LPUART1_RX, /* GPIO_AD_B0_07 is configured as LPUART1_RX */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_15_GPIO1_IO15, /* GPIO_AD_B0_15 is configured as GPIO1_IO15 */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
}
|
|
|
|
|
|
/*
|
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
|
LPSPI1_InitPins:
|
|
- options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'}
|
|
- pin_list:
|
|
- {pin_num: '98', peripheral: LPSPI1, signal: SCK, pin_signal: GPIO_AD_B0_10, software_input_on: Enable, open_drain: Disable, pull_keeper_enable: Enable}
|
|
- {pin_num: '97', peripheral: LPSPI1, signal: PCS0, pin_signal: GPIO_AD_B0_11, software_input_on: Enable, open_drain: Disable, pull_keeper_enable: Enable}
|
|
- {pin_num: '96', peripheral: LPSPI1, signal: SDO, pin_signal: GPIO_AD_B0_12, software_input_on: Enable, open_drain: Disable, pull_keeper_enable: Enable}
|
|
- {pin_num: '95', peripheral: LPSPI1, signal: SDI, pin_signal: GPIO_AD_B0_13, software_input_on: Enable, open_drain: Disable, pull_keeper_enable: Enable}
|
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
|
*/
|
|
|
|
/* FUNCTION ************************************************************************************************************
|
|
*
|
|
* Function Name : LPSPI1_InitPins
|
|
* Description : Configures pin routing and optionally pin electrical features.
|
|
*
|
|
* END ****************************************************************************************************************/
|
|
void LPSPI1_InitPins(void) {
|
|
CLOCK_EnableClock(kCLOCK_Iomuxc); /* iomuxc clock (iomuxc_clk_enable): 0x03U */
|
|
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_10_LPSPI1_SCK, /* GPIO_AD_B0_10 is configured as LPSPI1_SCK */
|
|
1U); /* Software Input On Field: Force input path of pad GPIO_AD_B0_10 */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_11_LPSPI1_PCS0, /* GPIO_AD_B0_11 is configured as LPSPI1_PCS0 */
|
|
1U); /* Software Input On Field: Force input path of pad GPIO_AD_B0_11 */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_12_LPSPI1_SDO, /* GPIO_AD_B0_12 is configured as LPSPI1_SDO */
|
|
1U); /* Software Input On Field: Force input path of pad GPIO_AD_B0_12 */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_13_LPSPI1_SDI, /* GPIO_AD_B0_13 is configured as LPSPI1_SDI */
|
|
1U); /* Software Input On Field: Force input path of pad GPIO_AD_B0_13 */
|
|
IOMUXC_SetPinConfig(
|
|
IOMUXC_GPIO_AD_B0_10_LPSPI1_SCK, /* GPIO_AD_B0_10 PAD functional properties : */
|
|
0x10B0U); /* Slew Rate Field: Slow Slew Rate
|
|
Drive Strength Field: R0/6
|
|
Speed Field: medium(100MHz)
|
|
Open Drain Enable Field: Open Drain Disabled
|
|
Pull / Keep Enable Field: Pull/Keeper Enabled
|
|
Pull / Keep Select Field: Keeper
|
|
Pull Up / Down Config. Field: 100K Ohm Pull Down
|
|
Hyst. Enable Field: Hysteresis Disabled */
|
|
IOMUXC_SetPinConfig(
|
|
IOMUXC_GPIO_AD_B0_11_LPSPI1_PCS0, /* GPIO_AD_B0_11 PAD functional properties : */
|
|
0x10B0U); /* Slew Rate Field: Slow Slew Rate
|
|
Drive Strength Field: R0/6
|
|
Speed Field: medium(100MHz)
|
|
Open Drain Enable Field: Open Drain Disabled
|
|
Pull / Keep Enable Field: Pull/Keeper Enabled
|
|
Pull / Keep Select Field: Keeper
|
|
Pull Up / Down Config. Field: 100K Ohm Pull Down
|
|
Hyst. Enable Field: Hysteresis Disabled */
|
|
IOMUXC_SetPinConfig(
|
|
IOMUXC_GPIO_AD_B0_12_LPSPI1_SDO, /* GPIO_AD_B0_12 PAD functional properties : */
|
|
0x10B0U); /* Slew Rate Field: Slow Slew Rate
|
|
Drive Strength Field: R0/6
|
|
Speed Field: medium(100MHz)
|
|
Open Drain Enable Field: Open Drain Disabled
|
|
Pull / Keep Enable Field: Pull/Keeper Enabled
|
|
Pull / Keep Select Field: Keeper
|
|
Pull Up / Down Config. Field: 100K Ohm Pull Down
|
|
Hyst. Enable Field: Hysteresis Disabled */
|
|
IOMUXC_SetPinConfig(
|
|
IOMUXC_GPIO_AD_B0_13_LPSPI1_SDI, /* GPIO_AD_B0_13 PAD functional properties : */
|
|
0x10B0U); /* Slew Rate Field: Slow Slew Rate
|
|
Drive Strength Field: R0/6
|
|
Speed Field: medium(100MHz)
|
|
Open Drain Enable Field: Open Drain Disabled
|
|
Pull / Keep Enable Field: Pull/Keeper Enabled
|
|
Pull / Keep Select Field: Keeper
|
|
Pull Up / Down Config. Field: 100K Ohm Pull Down
|
|
Hyst. Enable Field: Hysteresis Disabled */
|
|
}
|
|
|
|
|
|
/*
|
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
|
LPSPI1_DeinitPins:
|
|
- options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'}
|
|
- pin_list:
|
|
- {pin_num: '98', peripheral: GPIO1, signal: 'gpio_io, 10', pin_signal: GPIO_AD_B0_10}
|
|
- {pin_num: '97', peripheral: GPIO1, signal: 'gpio_io, 11', pin_signal: GPIO_AD_B0_11}
|
|
- {pin_num: '96', peripheral: GPIO1, signal: 'gpio_io, 12', pin_signal: GPIO_AD_B0_12}
|
|
- {pin_num: '95', peripheral: GPIO1, signal: 'gpio_io, 13', pin_signal: GPIO_AD_B0_13}
|
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
|
*/
|
|
|
|
/* FUNCTION ************************************************************************************************************
|
|
*
|
|
* Function Name : LPSPI1_DeinitPins
|
|
* Description : Configures pin routing and optionally pin electrical features.
|
|
*
|
|
* END ****************************************************************************************************************/
|
|
void LPSPI1_DeinitPins(void) {
|
|
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_10_GPIO1_IO10, /* GPIO_AD_B0_10 is configured as GPIO1_IO10 */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_11_GPIO1_IO11, /* GPIO_AD_B0_11 is configured as GPIO1_IO11 */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_12_GPIO1_IO12, /* GPIO_AD_B0_12 is configured as GPIO1_IO12 */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_AD_B0_13_GPIO1_IO13, /* GPIO_AD_B0_13 is configured as GPIO1_IO13 */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
}
|
|
|
|
|
|
/*
|
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
|
LPI2C4_InitPins:
|
|
- options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'}
|
|
- pin_list:
|
|
- {pin_num: '30', peripheral: LPI2C4, signal: SCL, pin_signal: GPIO_SD_B1_02, software_input_on: Enable, open_drain: Enable, pull_keeper_select: Keeper, pull_keeper_enable: Enable,
|
|
pull_up_down_config: Pull_Up_22K_Ohm}
|
|
- {pin_num: '28', peripheral: LPI2C4, signal: SDA, pin_signal: GPIO_SD_B1_03, software_input_on: Enable, open_drain: Enable, pull_up_down_config: Pull_Up_22K_Ohm}
|
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
|
*/
|
|
|
|
/* FUNCTION ************************************************************************************************************
|
|
*
|
|
* Function Name : LPI2C4_InitPins
|
|
* Description : Configures pin routing and optionally pin electrical features.
|
|
*
|
|
* END ****************************************************************************************************************/
|
|
void LPI2C4_InitPins(void) {
|
|
CLOCK_EnableClock(kCLOCK_Iomuxc); /* iomuxc clock (iomuxc_clk_enable): 0x03U */
|
|
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_SD_B1_02_LPI2C4_SCL, /* GPIO_SD_B1_02 is configured as LPI2C4_SCL */
|
|
1U); /* Software Input On Field: Force input path of pad GPIO_SD_B1_02 */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_SD_B1_03_LPI2C4_SDA, /* GPIO_SD_B1_03 is configured as LPI2C4_SDA */
|
|
1U); /* Software Input On Field: Force input path of pad GPIO_SD_B1_03 */
|
|
IOMUXC_SetPinConfig(
|
|
IOMUXC_GPIO_SD_B1_02_LPI2C4_SCL, /* GPIO_SD_B1_02 PAD functional properties : */
|
|
0xD8B0U); /* Slew Rate Field: Slow Slew Rate
|
|
Drive Strength Field: R0/6
|
|
Speed Field: medium(100MHz)
|
|
Open Drain Enable Field: Open Drain Enabled
|
|
Pull / Keep Enable Field: Pull/Keeper Enabled
|
|
Pull / Keep Select Field: Keeper
|
|
Pull Up / Down Config. Field: 22K Ohm Pull Up
|
|
Hyst. Enable Field: Hysteresis Disabled */
|
|
IOMUXC_SetPinConfig(
|
|
IOMUXC_GPIO_SD_B1_03_LPI2C4_SDA, /* GPIO_SD_B1_03 PAD functional properties : */
|
|
0xD8B0U); /* Slew Rate Field: Slow Slew Rate
|
|
Drive Strength Field: R0/6
|
|
Speed Field: medium(100MHz)
|
|
Open Drain Enable Field: Open Drain Enabled
|
|
Pull / Keep Enable Field: Pull/Keeper Enabled
|
|
Pull / Keep Select Field: Keeper
|
|
Pull Up / Down Config. Field: 22K Ohm Pull Up
|
|
Hyst. Enable Field: Hysteresis Disabled */
|
|
}
|
|
|
|
|
|
/*
|
|
* TEXT BELOW IS USED AS SETTING FOR TOOLS *************************************
|
|
LPI2C4_DeinitPins:
|
|
- options: {callFromInitBoot: 'false', coreID: core0, enableClock: 'true'}
|
|
- pin_list:
|
|
- {pin_num: '30', peripheral: GPIO3, signal: 'gpio_io, 22', pin_signal: GPIO_SD_B1_02}
|
|
- {pin_num: '28', peripheral: GPIO3, signal: 'gpio_io, 23', pin_signal: GPIO_SD_B1_03}
|
|
* BE CAREFUL MODIFYING THIS COMMENT - IT IS YAML SETTINGS FOR TOOLS ***********
|
|
*/
|
|
|
|
/* FUNCTION ************************************************************************************************************
|
|
*
|
|
* Function Name : LPI2C4_DeinitPins
|
|
* Description : Configures pin routing and optionally pin electrical features.
|
|
*
|
|
* END ****************************************************************************************************************/
|
|
void LPI2C4_DeinitPins(void) {
|
|
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_SD_B1_02_GPIO3_IO22, /* GPIO_SD_B1_02 is configured as GPIO3_IO22 */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
IOMUXC_SetPinMux(
|
|
IOMUXC_GPIO_SD_B1_03_GPIO3_IO23, /* GPIO_SD_B1_03 is configured as GPIO3_IO23 */
|
|
0U); /* Software Input On Field: Input Path is determined by functionality */
|
|
}
|
|
|
|
/***********************************************************************************************************************
|
|
* EOF
|
|
**********************************************************************************************************************/
|