NFC Reader Library Migration to FRDM-MCXN947 on VS code

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

NFC Reader Library Migration to FRDM-MCXN947 on VS code

NFC Reader Library Migration to FRDM-MCXN947 on VS code

Introduction.

This document provides a guide for using the PN5190 NFC frontend with the FRDM-MCXN947 development board and the NFC Reader Library in the MCUxpresso for VS code extension.

The hardware required to follow this guide is:

Software Setup.

  • MCXN947 SDK version: 26.06.00
  • NFCReaderLibrary version: 07.16.00
  • PN5190 FW version: 0x20D

Hardware connections.

The PNEV5190 comes with a Kinetis K82F as a host MCU to drive the PN5190

To enable SPI communication between the MCXN947 and the PN5190, the PNEV5190 board must be prepared as follows:

  • Power up board correctly
  • Enable external SPI pins
  • Disable K82F interface with PN5190

Power up and jumper configuration

  • To correctly power up the board.:

– Powering it up over USB does not provide enough current. It will be powered with an external power supply of 7.5V over connector J17.

  • Put jumper on following pins:

– J9 2-3: External power supply

– J8: VBATPWR supplied with VBAT=3.3 V

– J12: VBAT supplied with 3.3 V

  • Remove jumpers on following pins:

– J22, J23: open SDA signals for K82F

– J19: RTS push-button bypass for K82F

– J3, J4, J5, J6: pull down jumpers for NFC module signals

  • Set GPIO and SPI voltage to 3.3 V: supplying 3.3 V to VDDIO and the μC supply:

– Remove short circuit on R19

– Place short circuit on R20

Location of the changes mentioned above can be seen in the following image:

 

Habib_MS_0-1782499687907.png

Routing NFC module communication pins to JP1

To enable the pins on JP1 for communication, we must enable bus switch U10 and disable bus switch U12 in the NFC Host Interface. These switches enable or disable the connections from K82 to PN5190 SPI pins, and expose the SPI interface to an external host.

  • Remove short on R5 to disable communication routing to K82F.
  • Place short on R7 to enable communication routing to JP1 pins.
Habib_MS_1-1782499777420.png

 

For FRDM-MCXN947 side, no modifications are necessary.  The pins used are available in Header J1 and J2. Which are shown in the following table.    

Name

MCXN947

PN5190

SCK

J2.12

JP1.1

MOSI

J2.8

JP1.2

MISO

J2.10

JP1.3

SSEL

J2.6

JP1.4

IRQ

J1.16

JP1.5

RESET

J2.2

JP6.1

GND

J2.14

JP1.10

SUCCESS

J2.17*

 

FAIL

J2.15*

 

DWL

J2.13*

 

* Pins that need to be configured for library compatibility but are not used and do not need to be connected.

 

 

Software Changes

 

This section describes the software changes required to run the NfcrdlibEx1_DiscoveryLoop example from the NFC Reader Library. This example implements a detection loop that displays information about any tag detected by the PN5190 in a terminal, such as the UID, SAK, and Product Type for MIFARE-based cards. Please download the NFC Reader Library for the PN5190 from NFC Reader Library | NXP Semiconductors.

To begin the integration, we first need to import a hello_world project from the FRDM-MCXN947 SDK (v26.06.00) into MCUXpresso IDE for VS Code. For this purpose, download and install the FRDM-MCXN947 repository (version 26.06) using the extension available in the Quickstart panel by selecting Import Repository. For more information about this process, please refer to the corresponding user guide.

Importing NFC Reader library.

 

Download the “NFC Reader Library” zip from the product page and extract in a known folder. This will be useful for later use.  If available, please use the latest version of the NFC Reader Library.

Importing base project

 

1. In the Quick Start panel click on “Import Example from Repository” in VS code.

Habib_MS_0-1782500337538.png

 

2. Select “FRDM-MCXN947” in board setting.

Habib_MS_0-1785876833645.png

3. In the template will search for the “freertos_hello_cm33_core0” example, select Freestanding Application, chose the location and click on “import”.

Habib_MS_1-1785876872899.png

Importing SDK drivers

 

Once the project is added to the workspace we will need to add the required drivers, which are SPI, CTIMER and CMSIS drivers. For this we need to add the following code in the prj.cfg file.

 

Habib_MS_3-1782500385724.png
Spoiler
CONFIG_MCUX_COMPONENT_driver.lpflexcomm_lpspi=y
CONFIG_MCUX_COMPONENT_driver.ctimer=y
CONFIG_MCUX_COMPONENT_driver.CMSIS=y

Add the source code Discovery Loop Example

 

Firstly, delete the file freertos_hello.c created by the project.

From the “NxpNfcRdLib_PN5190_v07.16.00_PUB” extracted, find and drag and drop the following files on in the project files folder: NfcrdlibEx1_EmvcoProfile.c, phApp_Helper.c, phApp_Init.c, phApp_PN5190_Init.c. You can find these files in the following path:

{NxpNfcRdLibRoot} \Examples\NfcrdlibEx1_DiscoveryLoop\src

Habib_MS_2-1782504550792.png

 

When you drag and drop a file into VS code a window will appear asking whether you want to link the file or copy it. Please select “Copy files.”

Habib_MS_3-1782504569947.png

 

After dragging and dropping any file, the CMakeLists.txt file is automatically updated to include all the copied .c files. If you selected all these files, the generated code will appear as follows:

Habib_MS_4-1782504588274.png

 

Additionally, we need to add the file “NfcrdlibEx1_DiscoveryLoop.c” which is the main source file of the project, to achieve this also please drag and drop in the project files folder.

Habib_MS_5-1782504604217.png

At this point, the project should look like this:       

Habib_MS_0-1785877154551.png

Add the example source code to the newly created MCXN947 project

 

From the “NxpNfcRdLib_PN5190_v07.14.00_PUB” extracted just drag and drop in the project files folder the following folders.

Habib_MS_0-1782504704260.png

 

Habib_MS_1-1782504734285.png

 

Habib_MS_2-1782504750818.png

Habib_MS_3-1782504795659.png

Once these folders are added the project should look like this:

 

Habib_MS_1-1785877203826.png

Define FRDM-MCXN947 SDK preprocessor symbol

 

We need to make some changes to the compiler preprocessor configuration related to the NFC reader library, to do this we need to modify the Cmakelist.txt

  • PH_OSAL_FREERTOS
  • PHDRIVER_FRDMMCXN947_PN5190_BOARD
  • NXPBUILD_CUSTOMER_HEADER_INCLUDED
  • PHDRIVER_MCXN947_SPI_POLLING
Habib_MS_0-1782505699286.png

 

Spoiler
mcux_add_macro(
    CC"NXPBUILD_CUSTOMER_HEADER_INCLUDED\
    PHDRIVER_FRDMMCXN947_PN5190_BOARD\
    PH_OSAL_FREERTOS\
    PHDRIVER_MCXN947_SPI_POLLING"
)

These symbols are added so the preprocessor knows which header files to include at build time.

  • PHDRIVER_FRDMMCXN947_PN5190_BOARD will help include the BoardSelection.h header, the file that is going to define addresses for registers and peripherals of MCXN947.
  • PH_OSAL_FREERTOS will include headers related to OS operation, meaning that the project will work with operative system (at the end of this guide you will find the steps to add NULLOS support).
  • NXPBUILD_CUSTOMER_HEADER_INCLUDED will add headers to add and select the NFC reader and host that will be used in the project.
  • PHDRIVER_MCXN947_SPI_POLLING: if is defined the example will perform SPI communication by polling method, and if not, will be perform through non-blocking transfers.

Modifying the Driver Abstraction Layer (DAL)

 

The added folder DAL will contain the important changes to be able to use the MCXN947 as host device since it will contain all the changes regarding SPI, timer and GPIO configurations required by the library to work properly.

Board_FRDM_MCXN947_PN5190.h

We need to create a header file that will contain important macros used by the library that are related to the host specific SPI, timer and GPIO peripherals, as well as interrupt vectors and priorities, clock sources and addresses. This file is required to be inside the “boards” folder which is inside DAL.

1. Go to explorer window and select “add file” on the boards folder:

Habib_MS_1-1782505314578.png

 

2. Write the file’s name as follows (Board_FRDM_MCXN947_PN5190.h) and click enter:

Habib_MS_2-1782505345384.png

 

A window like the one shown in the following figure will appear. However, it can be discarded. This window is intended to add the newly created file to the CMakeLists.txt file, but we will instead include the entire folder later.

Habib_MS_3-1782505364793.png

 

Inside this file, some important macros related to the SPI peripheral and the important pins to be handled (IRQ, Chip Select, Reset) are defined.

Habib_MS_4-1782505388079.png

 

Spoiler
#ifndef DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_
#define DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_
#define GPIO_PORT 0
#define GPIO_PORT1 1
/******************************************************************
* LPSPI clock configuration
******************************************************************/
/*Clock Frequency for SPI Flexcomm 1*/
#define SPI_CLOCK_FREQ (CLOCK_GetLPFlexCommClkFreq(1u))
#define SPI_MASTER_CLOCK_FREQ SPI_CLOCK_FREQ
/******************************************************************
* Board Pin/Gpio configurations
******************************************************************/
#define PHDRIVER_PIN_RESET ((GPIO_PORT << 8) | 28) /**< Reset pin, Pin28, PIO0_28 */
#define PHDRIVER_PIN_IRQ ((GPIO_PORT << 8) | 31)  /**< IRQ pin, Pin10, PIO0_10 */
/* For 5190 busy is same as IRQ */
#define PHDRIVER_PIN_BUSY ((GPIO_PORT << 8) | 31)  /**< IRQ pin, Pin31, PIO0_31 */
#define PHDRIVER_PIN_DWL    ((GPIO_PORT << 8) | 19)  /**< Download pin, Pin19, PIO0_19*/
/* These pins are used for EMVCo Interoperability test status indication,
 * not for the generic Reader Library implementation.
 */
#define PHDRIVER_PIN_SUCCESS   ((GPIO_PORT1 << 8) | 0)   /**< GPIO, Port 1, Pin0 */
#define PHDRIVER_PIN_FAIL      ((GPIO_PORT1 << 8) | 1)   /**< GPIO, Port 1, Pin1 */
/******************************************************************
* PIN Pull-Up/Pull-Down configurations.
******************************************************************/
#define PHDRIVER_PIN_RESET_PULL_CFG    PH_DRIVER_PULL_UP
#define PHDRIVER_PIN_IRQ_PULL_CFG      PH_DRIVER_PULL_DOWN
#define PHDRIVER_PIN_WKUP_PULL_CFG     PH_DRIVER_PULL_UP
#define PHDRIVER_PIN_CLK_PULL_CFG      PH_DRIVER_PULL_UP
#define PHDRIVER_PIN_DWL_PULL_CFG      PH_DRIVER_PULL_UP
#define PHDRIVER_PIN_NSS_PULL_CFG      PH_DRIVER_PULL_UP
#define PHDRIVER_PIN_BUSY_PULL_CFG     PH_DRIVER_PULL_UP

We define the macros as well for the interrupt vector of MCXN947, its priority, handler and trigger type.

Habib_MS_5-1782505436112.png

 

Spoiler
/******************************************************************
* IRQ PIN NVIC settings
******************************************************************/
#define EINT_IRQn GPIO00_IRQn /*Adding interrupt vector A of GPIO*/
#define EINT_PRIORITY 7 /*Default interrupt priority for GPIO*/
#define CLIF_IRQHandler GPIO00_IRQHandler /*Interrupt handler for vector A*/
#define PIN_IRQ_TRIGGER_TYPE PH_DRIVER_INTERRUPT_RISINGEDGE /*Rising edge Trigger*/

As well as some macros for pin logic levels.

Habib_MS_6-1782505468893.png
Spoiler
/*****************************************************************
* Front End Reset logic level settings
****************************************************************/
#define PH_DRIVER_SET_HIGH 1 /**< Logic High. */
#define PH_DRIVER_SET_LOW 0 /**< Logic Low. */
#define RESET_POWERDOWN_LEVEL PH_DRIVER_SET_LOW
#define RESET_POWERUP_LEVEL PH_DRIVER_SET_HIGH

Finally, we define macros for the base address of CTIMER and SPI peripherals, clock frequencies, interrupt vectors and related pins.

Habib_MS_7-1782505509612.png

 

Spoiler
/*****************************************************************
* SPI Configuration
****************************************************************/
#define PHDRIVER_MCXN947_SPI_MASTER LPSPI1
#define PHDRIVER_MCXN947_SPI_DATA_RATE 5000000U
#define PHDRIVER_MCXN947_SPI_CLK_SRC SPI_MASTER_CLOCK_FREQ
#define PHDRIVER_MCXN947_SPI_IRQ LP_FLEXCOMM1_IRQn
#define SPI_IRQ_PRIORITY 6 /*SPI interrupt priority*/
#define PHDRIVER_PIN_SSEL  27U/* Chip Select, Pin6, SPI */
#define PHDRIVER_PIN_SCK   25U/* SPI clock, Pin7, SPI */
#define PHDRIVER_PIN_MISO  26U/* MISO, Pin8, SPI */
#define PHDRIVER_PIN_MOSI  24U/* MOSI, Pin9, SPI */
#define PHDRIVER_FC1_SPI_DIV kCLOCK_DivFlexcom1Clk
#define PHDRIVER_FC1_SPI_CLK kFRO12M_to_FLEXCOMM1 /*Clock to attach to Flexcomm1*/
/*****************************************************************
* Timer Configuration
****************************************************************/
#define PH_DRIVER_SDK_CTIMER CTIMER0 /*CTIMER0 base*/
#define PH_DRIVER_SDK_CTIMER_CLK  kCLOCK_DivCtimer0Clk/*CTIMER0 clock*/
#define PH_DRIVER_SDK_CTIMER_NVIC CTIMER0_IRQn /*Interrupt vector*/
#define PH_DRIVER_SDK_CTIMER_PRIORITY 4
#define PH_DRIVER_SDK_CTIMER_CLK_FREQ CLOCK_GetCTimerClkFreq(0U) /*CTIMER0 Clock frequency*/

#endif /* DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_ */

MCXN947 SPI and SDK files

 Now, inside DAL > src folder we will create a folder named “MCXN947” that will contain 2 source files:

  • phbalReg_Mcxn947Spi.c
  • phDriver_Mcxn947SDK.c

1. Firstly, we will need to delete the “KinetisSDK” folder located in the src folder to avoid multiple definition issues. Please right-click on src/KinetisSDK and click on “Delete”:

Habib_MS_1-1782505869521.png
 
2. A window as the following figure will appear, please click on “Move to Recycle Bin”:
Habib_MS_2-1782505893781.png

 

3. In the same folder please right-click and click on “New folder…”:

Habib_MS_3-1782505917835.png

 

4. Write the folder’s name as follows (MCXN947) and click enter:

Habib_MS_4-1782505943176.png

 

5. Add both files following the same steps mentioned in the section Board_FRDM_MCXN947_PN5190.h but with those files (phbalReg_Mcxn947Spi.c and phDriver_Mcxn947SDK.c). We will add these source files in the CMake_List.txt on the next step.

Once these files are added the src folder should look like this:

Habib_MS_5-1782505974388.png

6. Finally, we will add both files to the CMakeLists.txt file so they are included in the compilation process. Please add the following code in the CMake_list.txt file:

Habib_MS_6-1782505996170.png

 

Spoiler
mcux_add_source(BASE_PATH ${CMAKE_CURRENT_LIST_DIR}
    SOURCES "DAL/src/MCXN947/phbalReg_Mcxn947Spi.c"
    "DAL/src/MCXN947/phDriver_Mcxn947SDK.c")

Although the Kinetis SDK folder has been deleted, it is still referenced in the CMakeLists.txt file. Please remove those includes from this file.

Now, we will return to the MCUXpresso extension. Within these source files, we will modify the functions inherited from other board host implementations, replacing them with configurations specific to the MCXN947 peripheral drivers, including SPI, timers, GPIOs, and interrupt handlers.
These modifications are based on SDK examples such as ctimer_match_interrupt_example_cm33_core0 and lpspi_polling_b2b_transfer_master_cm33_core0.

phbalReg_Mcxn947Spi.c:

In this file we first need to include the necessary files and include the headers and callbacks to ensure the correct functionality:

Habib_MS_1-1782506156720.png
Spoiler
#include "phDriver.h"
#include <board.h>
#include "BoardSelection.h"
#include <fsl_lpspi.h>
#include <fsl_clock.h>
#include <fsl_port.h>

#define PHBAL_REG_MCXN947_SPI_ID 0x0FU /**< ID for MCXN947 SPI BAL component */
#define RX_BUFFER_SIZE_MAX                     272U /* Receive Buffer size while exchange */

#ifndef PHDRIVER_MCXN947_SPI_POLLING
lpspi_master_handle_t g_masterHandle;
/* LPSPI user callback */
void LPSPI_MasterUserCallback(LPSPI_Type *base, lpspi_master_handle_t *handle, status_t status, void *userData);
#endif
static void phbalReg_Mcxn947SpiConfig(void);
#ifndef PHDRIVER_MCXN947_SPI_POLLING
volatile bool isTransferCompleted  = false;
void LPSPI_MasterUserCallback(LPSPI_Type *base, lpspi_master_handle_t *handle, status_t status, void *userData)
{
    if (status == kStatus_Success)
    {
        __NOP();
    }
    isTransferCompleted = true;
}
#endif

After, we will define the phbalReg_Init function, which will be used by the library to initialize the SPI peripheral in this case, and it is defined as follows:

Habib_MS_2-1782506214363.png

 

Spoiler
/**
* \brief Initialize the Rw612 SPI BAL layer.
*
* \return Status code
* \retval #PH_DRIVER_SUCCESS Operation successful.
* \retval #PH_ERR_INVALID_DATA_PARAMS Parameter structure size is invalid.
*/

phStatus_t phbalReg_Init( void * pDataParams, uint16_t wSizeOfDataParams)
{
	lpspi_master_config_t userConfig;
	uint32_t srcFreq = 0;
	if((pDataParams == NULL) || (sizeof(phbalReg_Type_t) != wSizeOfDataParams))
	{
	return (PH_DRIVER_ERROR | PH_COMP_DRIVER);
	}
	((phbalReg_Type_t *)pDataParams)->wId = PH_COMP_DRIVER | PHBAL_REG_MCXN947_SPI_ID;
	((phbalReg_Type_t *)pDataParams)->bBalType = PHBAL_REG_TYPE_SPI;
	/*Initialize Flexcomm1 clock*/
	/* attach FRO 12M to FLEXCOMM1 */
	CLOCK_SetClkDiv(PHDRIVER_FC1_SPI_DIV, 1u);
	CLOCK_AttachClk(PHDRIVER_FC1_SPI_CLK);
	/*Configure SPI pins*/
	phbalReg_Mcxn947SpiConfig();
	/*SPI configuration*/
	LPSPI_MasterGetDefaultConfig(&userConfig);
	userConfig.baudRate = PHDRIVER_MCXN947_SPI_DATA_RATE;
	srcFreq = SPI_MASTER_CLOCK_FREQ;
	userConfig.whichPcs = (lpspi_which_pcs_t)kLPSPI_Pcs0;
	userConfig.pcsActiveHighOrLow = (lpspi_pcs_polarity_config_t)kLPSPI_PcsActiveLow;
	userConfig.pcsToSckDelayInNanoSec        = 1000000000U / (userConfig.baudRate * 1U);
	userConfig.lastSckToPcsDelayInNanoSec    = 1000000000U / (userConfig.baudRate * 1U);
	userConfig.betweenTransferDelayInNanoSec = 1000000000U / (userConfig.baudRate * 1U);

	/*Initialize SPI*/
#ifdef PHDRIVER_MCXN947_SPI_POLLING
	LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER, &userConfig, srcFreq);
#else
	LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER, &userConfig, srcFreq);
    LPSPI_MasterTransferCreateHandle(PHDRIVER_MCXN947_SPI_MASTER, &g_masterHandle, LPSPI_MasterUserCallback, NULL);
#endif
	return PH_DRIVER_SUCCESS;
}

We have to define the phbalReg_Exchange function as well, which is used for communicating via SPI with the PN5190.

Habib_MS_3-1782506250553.png

 Habib_MS_4-1782506278106.png

Spoiler
phStatus_t phbalReg_Exchange(
				void * pDataParams,
				uint16_t wOption,
				uint8_t * pTxBuffer,
				uint16_t wTxLength,
				uint16_t wRxBufSize,
				uint8_t * pRxBuffer,
				uint16_t * pRxLength
				)
{
    phStatus_t status = PH_DRIVER_SUCCESS;
    uint8_t * pRxBuf;
    status_t lpspiStatus;
    lpspi_transfer_t g_masterXfer;
    uint8_t g_dummyBuffer[RX_BUFFER_SIZE_MAX];
    if(pRxBuffer == NULL)
    {
        pRxBuf = g_dummyBuffer;
    }
    else
    {
        pRxBuf = pRxBuffer;
    }
    if(pTxBuffer == NULL)
    {
        wTxLength = wRxBufSize;
        g_dummyBuffer[0] = 0xFF;
        pTxBuffer = g_dummyBuffer;
    }
    memset(&g_masterXfer, 0, sizeof(lpspi_transfer_t));
    /* Set up the transfer */
    g_masterXfer.txData = pTxBuffer;
    g_masterXfer.rxData = pRxBuf;
    g_masterXfer.dataSize = wTxLength;
    g_masterXfer.configFlags = kLPSPI_MasterPcs0 | kLPSPI_MasterPcsContinuous | kLPSPI_MasterByteSwap;
    /* Start transfer */
#ifdef PHDRIVER_MCXN947_SPI_POLLING
    lpspiStatus = LPSPI_MasterTransferBlocking(PHDRIVER_MCXN947_SPI_MASTER, &g_masterXfer);
#else
    lpspiStatus = LPSPI_MasterTransferNonBlocking(PHDRIVER_MCXN947_SPI_MASTER, &g_masterHandle, &g_masterXfer);
    /* Wait transfer complete */
    while (!isTransferCompleted)
    {
    }
#endif
    if (lpspiStatus != kStatus_Success)
    {
        return (PH_DRIVER_FAILURE | PH_COMP_DRIVER);
    }
    if (pRxLength != NULL)
    {
        *pRxLength = wTxLength;
    }
#ifndef PHDRIVER_MCXN947_SPI_POLLING
    SDK_DelayAtLeastUs(300U, BOARD_BOOTCLOCKPLL150M_CORE_CLOCK);
#endif
    return status;
}

Finally, we will define the phbalReg_Mcxn947SpiConfig function, which is called by phbalReg_Init to configure the SPI pins on the MCXN947:

Habib_MS_5-1782506335570.png

 

Spoiler
static void phbalReg_Mcxn947SpiConfig(void)
{
    const port_pin_config_t port0_24_pinB6_config = {
kPORT_PullUp,
                                                     kPORT_LowPullResistor,
                                                     kPORT_SlowSlewRate,
                                                     kPORT_PassiveFilterDisable,
                                                     kPORT_OpenDrainDisable,
                                                     kPORT_LowDriveStrength,
                                                     /* Pin is configured as FC1_P0 */
                                                     kPORT_MuxAlt2,
                                                     kPORT_InputBufferEnable,
                                                     kPORT_InputNormal,
                                                     kPORT_UnlockRegister};
    /* PORT0_24 (pin B6) is configured as SPI_MOSI */
    PORT_SetPinConfig(PORT0, 24U, &port0_24_pinB6_config);

    const port_pin_config_t port0_25_pinA6_config = {
kPORT_PullUp,
                                                     kPORT_LowPullResistor,
                                                     kPORT_SlowSlewRate,
                                                     kPORT_PassiveFilterDisable,
                                                     kPORT_OpenDrainDisable,
                                                     kPORT_LowDriveStrength,
                                                     /* Pin is configured as FC1_P1 */
                                                     kPORT_MuxAlt2,
                                                     kPORT_InputBufferEnable,
                                                     kPORT_InputNormal,
                                                     kPORT_UnlockRegister};
    /* PORT0_25 (pin A6) is configured as SPI_SCK */
    PORT_SetPinConfig(PORT0, 25U, &port0_25_pinA6_config);
const port_pin_config_t port0_26_pinF10_config = {
kPORT_PullUp,
                                                      kPORT_LowPullResistor,
                                                      kPORT_SlowSlewRate,
                                                      kPORT_PassiveFilterDisable,
                                                      kPORT_OpenDrainDisable,
                                                      kPORT_LowDriveStrength,
                                                      /* Pin is configured as FC1_P2 */
                                                      kPORT_MuxAlt2,
                                                      kPORT_InputBufferEnable,
                                                      kPORT_InputNormal,
                                                      kPORT_UnlockRegister};
    /* PORT0_26 (pin F10) is configured as SPI_MISO */
    PORT_SetPinConfig(PORT0, 26U, &port0_26_pinF10_config);

    const port_pin_config_t port0_27_pinE10_config = {
kPORT_PullUp,
                                                      kPORT_LowPullResistor,
                                                      kPORT_SlowSlewRate,
                                                      kPORT_PassiveFilterDisable,
                                                      kPORT_OpenDrainDisable,
                                                      kPORT_LowDriveStrength,
                                                      /* Pin is configured as FC1_P3 */
                                                      kPORT_MuxAlt2,
                                                      kPORT_InputBufferEnable,
                                                      kPORT_InputNormal,
                                                      kPORT_UnlockRegister};
    /* PORT0_27 (pin E10) is configured as SPI_CS */
    PORT_SetPinConfig(PORT0, 27U, &port0_27_pinE10_config);
}

phDriver_Mcxn947SDK.c:

In this file we will have the following definitions and includes that describe relevant characteristics of the ctimer (configuration structures, interrupt handlers and maximum count value), and of the GPIO port:

Habib_MS_1-1782506665356.png

 

Spoiler
#include "phDriver.h"
#include "BoardSelection.h"
#include "fsl_device_registers.h"
#include <fsl_gpio.h>
#include <fsl_ctimer.h>
/* ***********************************************************************************************************
* Internal Definitions
* ********************************************************************************************************** */
#define MCXN947_TIMER_MAX_32BIT 0xFFFFFFFFU
#define CTIMER_HANDLER CTIMER0_IRQHandler
/* ***********************************************************************************************************
 * * Type Definitions
*********************************************************************************************************** */
volatile bool ctimerIsrFlag = false;
/* ***********************************************************************************************************
* Global and Static Variables
*
* Match Configuration for CTIMER Channel 0*/
static ctimer_match_config_t matchConfig0;
/* Total Size: NNNbytes
* ********************************************************************************************************** */
/* Array initializer of GPIO peripheral base pointers */
static const GPIO_Type *pGpiosBaseAddr[] = GPIO_BASE_PTRS;

static pphDriver_TimerCallBck_t pCTimerCallBack;
static volatile uint8_t dwTimerExp;

static const gpio_interrupt_config_t aInterruptTypes[] = {kGPIO_InterruptLogicZero, /* Unused. */
        kGPIO_InterruptLogicZero,
        kGPIO_InterruptLogicOne,
        kGPIO_InterruptRisingEdge,
        kGPIO_InterruptFallingEdge,
        kGPIO_InterruptEitherEdge,
};
/* ***********************************************************************************************************
* Private Functions Prototypes
* ********************************************************************************************************** */
static void phDriver_CTimerIsrCallBack(void);

We will define the following functions to initialize and stop the timer, and to enable timer interruptions and its callback:

Habib_MS_2-1782506722983.png

 

Habib_MS_3-1782506736273.png
Spoiler
phStatus_t phDriver_TimerStart(phDriver_Timer_Unit_t eTimerUnit, uint32_t dwTimePeriod,
pphDriver_TimerCallBck_t pTimerCallBack)
{
	uint64_t qwTimerCnt;
	uint32_t dwTimerFreq;

	dwTimerFreq = PH_DRIVER_SDK_CTIMER_CLK_FREQ;

	qwTimerCnt = dwTimerFreq;
	qwTimerCnt = (qwTimerCnt / eTimerUnit);
	qwTimerCnt = (dwTimePeriod * qwTimerCnt);
	/* 32-bit timers. */
	if(qwTimerCnt > (uint64_t)MCXN947_TIMER_MAX_32BIT)
	{
		return PH_DRIVER_ERROR | PH_COMP_DRIVER;
	}
	if(pTimerCallBack == NULL) /* Timer Start is blocking call. */
	{
		dwTimerExp = 0;
		pCTimerCallBack = phDriver_CTimerIsrCallBack;
	}
	else /* Call the Timer callback. */
	{
		pCTimerCallBack = pTimerCallBack;
	}
	/*Configure & start CTIMER*/
	/*Ctimer config structure*/
	ctimer_config_t config;

	/*Timer mode, init*/
	CTIMER_GetDefaultConfig(&config);
	CTIMER_Init(PH_DRIVER_SDK_CTIMER, &config);
	CTIMER_EnableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable);
	/* Configuration match 0 */
	matchConfig0.enableCounterReset = true;
	matchConfig0.enableCounterStop 	= false;
	matchConfig0.matchValue 	 	= (uint32_t)qwTimerCnt;
	matchConfig0.outControl 		= kCTIMER_Output_NoAction;
	matchConfig0.outPinInitState 	= false;
	matchConfig0.enableInterrupt 	= true;

	EnableIRQ(PH_DRIVER_SDK_CTIMER_NVIC);
	NVIC_SetPriority(PH_DRIVER_SDK_CTIMER_NVIC, PH_DRIVER_SDK_CTIMER_PRIORITY);
	/*Setup Match*/
	CTIMER_SetupMatch(PH_DRIVER_SDK_CTIMER, kCTIMER_Match_0, &matchConfig0);
	/*Start*/
	CTIMER_StartTimer(PH_DRIVER_SDK_CTIMER);
while (true)
	{
		/* Check whether an interrupt occurred */
		if (true == ctimerIsrFlag && dwTimerExp)
		{
			/* Clear interrupt flag*/
			ctimerIsrFlag = false;
			break;
		}
	}

	return PH_DRIVER_SUCCESS;
}
Habib_MS_4-1782506821715.png

 

Spoiler
phStatus_t phDriver_TimerStop(void)
{
	/*Stop timer & disable interrupts*/
	CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER);
	CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable);

	/* Disable at the NVIC */
	DisableIRQ(PH_DRIVER_SDK_CTIMER_NVIC);

	return PH_DRIVER_SUCCESS;
}

We will also have definitions for the functions that configure and handle GPIOs of the MCXN947 and enable interruptions.

Habib_MS_4-1784224063232.png
Spoiler
phStatus_t phDriver_PinConfig(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc, phDriver_Pin_Config_t *pPinConfig)
{
	gpio_pin_config_t sGpioConfig;
	uint8_t bPinNum;

	if((ePinFunc == PH_DRIVER_PINFUNC_BIDIR) || (pPinConfig == NULL))
	{
		return PH_DRIVER_ERROR | PH_COMP_DRIVER;
	}
	/* Extract the Pin, Gpio, Port details from dwPinNumber */
	bPinNum = (uint8_t)(dwPinNumber & 0xFF);

	sGpioConfig.pinDirection = (ePinFunc == PH_DRIVER_PINFUNC_OUTPUT) ? kGPIO_DigitalOutput:kGPIO_DigitalInput;
	sGpioConfig.outputLogic = pPinConfig->bOutputLogic;

	if(ePinFunc == PH_DRIVER_PINFUNC_INTERRUPT)
	{
		gpio_interrupt_config_t intConfig = aInterruptTypes[(uint8_t)pPinConfig->eInterruptConfig];

		GPIO_GpioClearInterruptFlags((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum);
		GPIO_SetPinInterruptConfig((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum, intConfig);
		EnableIRQ(EINT_IRQn);

		GPIO_PinInit((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT],bPinNum,&sGpioConfig);
	}
	else
	{
		GPIO_PinInit((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT],bPinNum,&sGpioConfig);
	}

	return PH_DRIVER_SUCCESS;
}
Habib_MS_3-1784224025491.png
Spoiler
uint8_t phDriver_PinRead(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc)
{
	uint8_t bValue;
	uint32_t intStatus;
	uint8_t bPinNum;

	/* Extract the Pin, Gpio details from dwPinNumber */
	bPinNum = (uint8_t)(dwPinNumber & 0xFF);

	if(ePinFunc == PH_DRIVER_PINFUNC_INTERRUPT)
	{
		/*Get value of pin interrupt status*/
		intStatus = GPIO_PinGetInterruptFlag((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum);
		bValue = intStatus ? 1:0;
	}
	else
	{
		/*Read pin value*/
		bValue = (uint8_t)GPIO_PinRead((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum);
	}
	return bValue;
}
Habib_MS_2-1784223977410.png
Spoiler
void phDriver_PinWrite(uint32_t dwPinNumber, uint8_t bValue)
{
	uint8_t bPinNum;

	/* Extract the Pin, Gpio details from dwPinNumber */
	bPinNum = (uint8_t)(dwPinNumber & 0xFF);

	GPIO_PinWrite((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], bPinNum, bValue);
}

void phDriver_PinClearIntStatus(uint32_t dwPinNumber)
{
	uint8_t bPinNum;

	/* Extract the Pin, Gpio details from dwPinNumber */
	bPinNum = (uint8_t)(dwPinNumber & 0xFF);
	/*Clear interrupt flag*/
	GPIO_GpioClearInterruptFlags((GPIO_Type *)pGpiosBaseAddr[GPIO_PORT], (1U << bPinNum));
}

It is also necessary to add functions required for the library to function correctly.

Habib_MS_8-1782506978124.png

 

Spoiler
void phDriver_EnterCriticalSection(void)
{
    NVIC_DisableIRQ(EINT_IRQn);
}

void phDriver_ExitCriticalSection(void)
{
	NVIC_EnableIRQ(EINT_IRQn);
}

phStatus_t phDriver_IRQPinRead(uint32_t dwPinNumber)
{
	phStatus_t bGpioVal = false;

	bGpioVal = phDriver_PinRead(dwPinNumber, PH_DRIVER_PINFUNC_INPUT);

	return bGpioVal;
}
phStatus_t phDriver_IRQPinPoll(uint32_t dwPinNumber, phDriver_Pin_Func_t ePinFunc, phDriver_Interrupt_Config_t eInterruptType)
{
    uint8_t    bGpioState = 0;

    if ((eInterruptType != PH_DRIVER_INTERRUPT_RISINGEDGE) && (eInterruptType != PH_DRIVER_INTERRUPT_FALLINGEDGE))
    {
        return PH_DRIVER_ERROR | PH_COMP_DRIVER;
    }

    if (eInterruptType == PH_DRIVER_INTERRUPT_FALLINGEDGE)
    {
        bGpioState = 1;
    }

	while(phDriver_PinRead(dwPinNumber, ePinFunc) == bGpioState);

    return PH_DRIVER_SUCCESS;
}

Finally, here, we will have the definition of the timer interrupt handler and ISR callback.

Habib_MS_9-1782507031648.png

 

Spoiler
void CTIMER0_IRQHandler(void)
{
	/* Clear interrupt flag.*/
	CTIMER_ClearStatusFlags(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0Flag|kCTIMER_Capture0Flag);
	/* Single shot timer. Stop it. */
	CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER);
	CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER, kCTIMER_Match0InterruptEnable|kCTIMER_Capture0InterruptEnable);
	pCTimerCallBack();

	ctimerIsrFlag = true;
}

static void phDriver_CTimerIsrCallBack(void)
{
	dwTimerExp = 1;
}

With these additions, we have all the functions needed (based on the FRDM-MCXN947 SDK) by the library to communicate with the PN5190.

BoardSelection.h

 

In this header file, which is found at “DAL > cfg” we will add the definition set in the preprocessor settings to use the FRDM-MCXN947 board as host by adding the following lines to the file:

Habib_MS_10-1782507079841.png
 
Spoiler
#ifdef PHDRIVER_FRDMMCXN947_PN5190_BOARD
#    include <Board_FRDM_MCXN947_PN5190.h>
#endif

ph_NxpBuild_App.h

 

In this header found at “intfs” folder, we will add our board support to use it with the PN5190 by adding the following change:

Habib_MS_1-1782507715135.png
Spoiler
#if defined(PHDRIVER_LPC1769PN5190_BOARD) \
    || defined(PHDRIVER_K82F_PNEV5190B_BOARD)\
	|| defined(PHDRIVER_FRDMMCXN947_PN5190_BOARD)
#   define NXPBUILD__PHHAL_HW_PN5190
#endif

phApp_Init.h

 

In this header located at “intfs” folder we will add the required include files for the initialization of our board and enable the correct debug interface.

Habib_MS_2-1782507771262.png
Spoiler
/*Check for MCXN controller based boards*/
#if defined (PHDRIVER_FRDMMCXN947_PN5190_BOARD)
#define PHDRIVER_FRDM_MCXN947
#endif

#ifdef PHDRIVER_FRDM_MCXN947
#include <fsl_debug_console.h>
#include <stdio.h>
#include <fsl_gpio.h>
#include <fsl_ctimer.h>
#include <fsl_clock.h>
#include <fsl_lpspi.h>
#endif
Spoiler
#if defined(PHDRIVER_KINETIS_K82)|| defined(PHDRIVER_FRDM_MCXN947)

phApp_Init.c

 

Finally, in this source file we will add the initialization code for the MCXN947 to complement the initialization macros defined in the previous phApp_Init.h file modification. Here we will call functions to initialize clocks and UART pins.

Habib_MS_3-1782507864930.png
Spoiler
#ifdef PHDRIVER_FRDM_MCXN947
#include "fsl_common.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"
static void phApp_MCXN947_Init(void){
	BOARD_InitBootPins();
	BOARD_InitBootClocks();
	BOARD_InitDebugConsole();
}
#endif
Spoiler
#elif defined(PHDRIVER_FRDM_MCXN947)
    phApp_MCXN947_Init();

These functions are used to initialize the correspondent clocks of each peripheral such as CTIMER, the input pins multiplexor for selecting GPIO functionality and FLEXCOMM for SPI. In here we also set the GPIO functionality for pins P0_31 and P0_28 (IRQ and RESET), as well as UART3 for printing the tag information on the serial port connected to the computer.

Additionally, we need to set the NVIC priority to ensure that interrupts can occur. Add the NVIC_SetPriority() function to phApp_Configure_IRQ().

Habib_MS_5-1782507924509.png

 

Spoiler
#ifdef PH_PLATFORM_HAS_ICFRONTEND
#if !(defined(PH_OSAL_LINUX) && defined(NXPBUILD__PHHAL_HW_PN5190))
    phDriver_Pin_Config_t pinCfg;
    NVIC_SetPriority(EINT_IRQn, EINT_PRIORITY);
    pinCfg.bOutputLogic = PH_DRIVER_SET_LOW;
    pinCfg.bPullSelect = PHDRIVER_PIN_IRQ_PULL_CFG;

    pinCfg.eInterruptConfig = PIN_IRQ_TRIGGER_TYPE;
    phDriver_PinConfig(PHDRIVER_PIN_IRQ, PH_DRIVER_PINFUNC_INTERRUPT, &pinCfg);

#endif

pin_mux.c

 

Inside the function “BOARD_InitBootPins()” which is defined in pin_mux.c file, the following initializations need to be added, you can find this file in the following path:

{PrjRootDirPath}\frdmmcxn947_Discovery_Loop\frdmmcxn947_cm33_core0\cm33_core0

 
Habib_MS_6-1782507961225.png
Spoiler
void BOARD_InitBootPins(void)
{
    /* Use FRO HF clock for some of the Ctimers */
    CLOCK_SetClkDiv(kCLOCK_DivCtimer0Clk, 1u);
    CLOCK_AttachClk(kFRO_HF_to_CTIMER0);

    CLOCK_EnableClock(kCLOCK_Gpio0);
    CLOCK_EnableClock(kCLOCK_Gpio1);
    BOARD_InitPins();
}

Additionally, within the “BOARD_InitPins()” function available in the same file, we will replace the function to add initializations of the GPIO and UART pins.

Habib_MS_7-1782507998410.png

 

Habib_MS_8-1782508012260.png

 

Habib_MS_9-1782508024569.png
Spoiler
void BOARD_InitPins(void)
{
    /* Enables the clock for PORT0 controller: Enables clock */
    CLOCK_EnableClock(kCLOCK_Port0);
    /* Enables the clock for PORT1: Enables clock */
    CLOCK_EnableClock(kCLOCK_Port1);

    const port_pin_config_t port0_19_config = {/* Internal pull-up/down resistor is disabled */
                                                      kPORT_PullDisable,
                                                      /* Low internal pull resistor value is selected. */
                                                      kPORT_LowPullResistor,
                                                      /* Fast slew rate is configured */
                                                      kPORT_FastSlewRate,
                                                      /* Passive input filter is disabled */
                                                      kPORT_PassiveFilterDisable,
                                                      /* Open drain output is disabled */
                                                      kPORT_OpenDrainDisable,
                                                      /* Low drive strength is configured */
                                                      kPORT_LowDriveStrength,
                                                      /* Pin is configured as PIO0_10 */
                                                      kPORT_MuxAlt0,
                                                      /* Digital input enabled */
                                                      kPORT_InputBufferEnable,
                                                      /* Digital input is not inverted */
                                                      kPORT_InputNormal,
                                                      /* Pin Control Register fields [15:0] are not locked */
                                                      kPORT_UnlockRegister};
    /* PORT0_10 (pin B12) is configured as PIO0_10 */
    PORT_SetPinConfig(PORT0, 19U, &port0_19_config);

    const port_pin_config_t port1_0_config = {
                                                      kPORT_PullDisable,
                                                      kPORT_LowPullResistor,
                                                      kPORT_FastSlewRate,
                                                      kPORT_PassiveFilterDisable,
                                                      kPORT_OpenDrainDisable,
                                                      kPORT_LowDriveStrength,
                                                      /* Pin is configured as PIO0_10 */
                                                      kPORT_MuxAlt0,
                                                      kPORT_InputBufferEnable,
                                                      kPORT_InputNormal,
                                                      kPORT_UnlockRegister};
    /* PORT0_10 (pin B12) is configured as PIO0_10 */
    PORT_SetPinConfig(PORT1, 0U, &port1_0_config);
    const port_pin_config_t port1_1_config = {
                                                      kPORT_PullDisable,
                                                      kPORT_LowPullResistor,
                                                      kPORT_FastSlewRate,
                                                      kPORT_PassiveFilterDisable,
                                                      kPORT_OpenDrainDisable,
                                                      kPORT_LowDriveStrength,
                                                      /* Pin is configured as PIO0_10 */
                                                      kPORT_MuxAlt0,
                                                      kPORT_InputBufferEnable,
                                                      kPORT_InputNormal,
                                                      kPORT_UnlockRegister};
    /* PORT0_10 (pin B12) is configured as PIO0_10 */
    PORT_SetPinConfig(PORT1, 1U, &port1_1_config);
    const port_pin_config_t port0_31_pinB12_config = {
                                                      kPORT_PullDown,
                                                      kPORT_LowPullResistor,
                                                      kPORT_FastSlewRate,
                                                      kPORT_PassiveFilterDisable,
                                                      kPORT_OpenDrainDisable,
                                                      kPORT_LowDriveStrength,
                                                      /* Pin is configured as PIO0_10 */
                                                      kPORT_MuxAlt0,
                                                      kPORT_InputBufferEnable,
                                                      kPORT_InputNormal,
                                                      kPORT_UnlockRegister};
    /* PORT0_10 (pin B12) is configured as PIO0_10 */
    PORT_SetPinConfig(PORT0, 31U, &port0_31_pinB12_config);

    const port_pin_config_t port0_28_config = {
                                                     kPORT_PullDisable,
                                                     kPORT_LowPullResistor,
                                                     kPORT_FastSlewRate,
                                                     kPORT_PassiveFilterDisable,
                                                     kPORT_OpenDrainDisable,
                                                     kPORT_LowDriveStrength,
                                                     /* Pin is configured as PIO0_6 */
                                                     kPORT_MuxAlt0,
                                                     kPORT_InputBufferEnable,
                                                     kPORT_InputNormal,
                                                     kPORT_UnlockRegister};
    /* PORT0_6 (pin C14) is configured as PIO0_6 */
    PORT_SetPinConfig(PORT0, 28U, &port0_28_config);

    const port_pin_config_t port0_2_pinB16_config = {
                                                     .pullSelect = kPORT_PullDisable,
                                                     .pullValueSelect = kPORT_LowPullResistor,
                                                     .slewRate = kPORT_FastSlewRate,
                                                     .passiveFilterEnable = kPORT_PassiveFilterDisable,
                                                     .openDrainEnable = kPORT_OpenDrainDisable,
                                                     .driveStrength = kPORT_HighDriveStrength,
                                                     /* Pin is configured as SWO */
                                                     .mux = kPORT_MuxAlt1,
                                                     .inputBuffer = kPORT_InputBufferEnable,
                                                     .invertInput = kPORT_InputNormal,
                                                     .lockRegister = kPORT_UnlockRegister};
    /* PORT0_2 (pin B16) is configured as SWO */
    PORT_SetPinConfig(PORT0, 2U, &port0_2_pinB16_config);

    const port_pin_config_t port1_8_pinA1_config = {
                                                    .pullSelect = kPORT_PullUp,
                                                    .pullValueSelect = kPORT_LowPullResistor,
                                                    .slewRate = kPORT_FastSlewRate,
                                                    .passiveFilterEnable = kPORT_PassiveFilterDisable,
                                                    .openDrainEnable = kPORT_OpenDrainDisable,
                                                    .driveStrength = kPORT_LowDriveStrength,
                                                    /* Pin is configured as FC4_P0 */
                                                    .mux = kPORT_MuxAlt2,
                                                    .inputBuffer = kPORT_InputBufferEnable,
                                                    .invertInput = kPORT_InputNormal,
                                                    .lockRegister = kPORT_UnlockRegister};
    /* PORT1_8 (pin A1) is configured as FC4_P0 */
    PORT_SetPinConfig(PORT1, 8U, &port1_8_pinA1_config);
   const port_pin_config_t port1_9_pinB1_config = {
                                                   .pullSelect = kPORT_PullDisable,
                                                    .pullValueSelect = kPORT_LowPullResistor,
                                                    .slewRate = kPORT_FastSlewRate,
                                                    .passiveFilterEnable = kPORT_PassiveFilterDisable,
                                                    .openDrainEnable = kPORT_OpenDrainDisable,
                                                    .driveStrength = kPORT_LowDriveStrength,
                                                    /* Pin is configured as FC4_P1 */
                                                    .mux = kPORT_MuxAlt2,
                                                    .inputBuffer = kPORT_InputBufferEnable,
                                                    .invertInput = kPORT_InputNormal,
                                                    .lockRegister = kPORT_UnlockRegister};
    /* PORT1_9 (pin B1) is configured as FC4_P1 */
    PORT_SetPinConfig(PORT1, 9U, &port1_9_pinB1_config);
}

At the same time, add the following includes to the file:

Habib_MS_0-1785878023889.png

Spoiler
#include "fsl_common.h"
#include "fsl_port.h"
#include "board.h"
#include "clock_config.h"
#include "pin_mux.h"

Delete phOsal files

 

We must delete from the path “phOsal > src > NullOs > portable” the files: “phOsal_Port_CM3.c”,“phOsal_Port_PN76xx.c” and “phOsal_Port_PN74xxxx.c”. This has the purpose of avoiding any multiple definition errors when compiling the final project.

Although these files have been deleted, they are still referenced in the CMakeLists.txt file. Please remove those includes from this file.

Add all header files in CMakeList.txt

 

As mentioned previously, the CMakeList.txt is automatically updated when you copy a .c file. However, .h files are not automatically linked, so they must be added manually. Please copy and paste the following includes into the CMakeLists.txt file:

Habib_MS_0-1782508446885.png
Spoiler
mcux_add_include(
    BASE_PATH ${CMAKE_CURRENT_LIST_DIR}
    INCLUDES 
            NxpNfcRdLib/intfs
            NxpNfcRdLib/types
			NxpNfcRdLib/comps/phacDiscLoop/src/Sw
			intfs
			DAL/boards
			DAL/cfg
			DAL/inc
			phOsal/inc
			. 
    )

Add _DSB and _ISB support

 

As final modification step, please include in {PrjRootDirPath}\NxpNfcRdLib\comps\phhalHw\src\Pn5190\phhalHw_Pn5190_Int.c the “cmsis_gcc.h” to support of _DSB and _ISB functions.

Habib_MS_2-1782508515584.png

 

Testing Final Project with FreeRTOS

 

After making all the previous changes and modifications, the migration is now complete, and we can proceed to compile and flash the example to MCXN947.

Please “clean” the project before building by right clicking on the project as follows:

Habib_MS_1-1785878094753.png

To run the project, we will need a serial terminal like Tera Term with the following settings:

- 115200 baud rate.

- 8 data bits.

- No parity.

- One stop bit,

- No flow control.

Once the program is flashed and the serial terminal configured, we can reset the board and power the PNEV5190BP. You should see an output similar to the following:

Habib_MS_4-1782508585568.png

Now if any NFC tag is close to the PNEV5190BP’s antenna, you should see the information displayed as shown in the image below:

Habib_MS_5-1782508604979.png

Changing OS preprocessor macro

 

This section presents the steps to follow to add the possibility of easily choosing whether to have OS support or not.  This guide is based as default with FREERTOS, but the NFC reader library offers the possibility to run without OS, firstly, we need to change the preprocessor macro PH_OSAL_FREERTOS to PH_OSAL_NULLOS in the CMakeList.txt, as shown the following image:

Habib_MS_6-1782508642319.png

Finally, to avoid multiple definition issues when we change between NULLOS and FREERTOS, we will discard the SysTickHandler for FREERTOS side located in port.c when the NULLOS macro is defined, to achieve this we need to add a replacement of the file port.c since the included FreeRTOS is shared with all projects of the repository, and if we modify this file, it will be modified in all projects.

1. Go to the explorer window, right-click on the project and click on “New File…”.

Habib_MS_5-1785877420766.png

2. Write the file’s name as follows (port.c) and click enter:

Habib_MS_4-1785877388377.png
3. Add this file into the CMakeList.txt file to include port.c into the compilation process:

Habib_MS_3-1785877308864.png

 

Spoiler
mcux_add_source(BASE_PATH ${CMAKE_CURRENT_LIST_DIR}
    SOURCES "port.c")

4. Please copy and paste all the content form of the port.c located on the following path to the port.c we created:

{SdkRootDirPath}/rtos/freertos/freertos-kernel-upstream/portable/GCC/ARM_CM33_NTZ/non_secure

Habib_MS_1-1785877681949.png

5. Replace the SysTick_Handler() of the port.c we created to the following function:

Habib_MS_11-1782508854714.png
Spoiler
#ifndef PH_OSAL_NULLOS
void SysTick_Handler( void ) /* PRIVILEGED_FUNCTION */
{
    uint32_t ulPreviousMask;

    ulPreviousMask = portSET_INTERRUPT_MASK_FROM_ISR();
    traceISR_ENTER();
    {
        /* Increment the RTOS tick. */
        if( xTaskIncrementTick() != pdFALSE )
        {
            traceISR_EXIT_TO_SCHEDULER();
            /* Pend a context switch. */
            portNVIC_INT_CTRL_REG = portNVIC_PENDSVSET_BIT;
        }
        else
        {
            traceISR_EXIT();
        }
    }
    portCLEAR_INTERRUPT_MASK_FROM_ISR( ulPreviousMask );
}
#endif

6. Finally, we will ignore the port.c of the FreeRTOS folder, please add the following code to the CMakeList.txt:

Habib_MS_2-1785878166328.png

Spoiler
mcux_project_remove_source(
    BASE_PATH ${SdkRootDirPath}/rtos/freertos/freertos-kernel-upstream/portable/GCC/ARM_CM33_NTZ/non_secure
    SOURCES port.c
)
Please rebuild and test as the steps mentioned in the section Testing Final Project with FreeRTOS.
Labels (1)
%3CLINGO-SUB%20id%3D%22lingo-sub-2387149%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3ENFC%20Reader%20Library%20Migration%20to%20FRDM-MCXN947%20on%20VS%20code%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2387149%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%0A%3CH3%20class%3D%22lia-align-justify%22%20id%3D%22toc-hId-2033909335%22%20style%3D%22text-align%20%3A%20justify%3B%22%20id%3D%22toc-hId-2034802188%22%20style%3D%22text-align%20%3A%20justify%3B%22%3EIntroduction.%3C%2FH3%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3EThis%20document%20provides%20a%20guide%20for%20using%20the%20PN5190%20NFC%20frontend%20with%20the%20FRDM-MCXN947%20development%20board%20and%20the%20NFC%20Reader%20Library%20in%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fsoftware%2Fdevelopment-software%2Fmcuxpresso-software-and-tools-%2Fmcuxpresso-for-visual-studio-code%3AMCUXPRESSO-VSC%3F_gl%3D1*by78t4*_ga*OTI2ODU3MDQwLjE3ODg0NzU2NzI.*_ga_WM5LE0KMSH*czE3ODg5NzU2OTQkbzE4JGcxJHQxNzg4OTc2NjIxJGo0MCRsMCRoMjIxOTI0NjEw%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EMCUxpresso%20for%20VS%20code%20extension%3C%2FA%3E.%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3EThe%20hardware%20required%20to%20follow%20this%20guide%20is%3A%3C%2FP%3E%0A%3CUL%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fdevelopment-boards-and-designs%2FFRDM-MCXN947%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EFRDM-MCXN947%3C%2FA%3E%20development%20board%20as%20host%20MCU.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdesign%2Fdesign-center%2Fdevelopment-boards-and-designs%2FPNEV5190BP%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EPNEV5190BP%3C%2FA%3E%20(based%20on%20PN5190)%20as%20the%20NFC%20transceiver%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20class%3D%22lia-align-justify%22%20id%3D%22toc-hId-226454872%22%20style%3D%22text-align%20%3A%20justify%3B%22%20id%3D%22toc-hId-227347725%22%20style%3D%22text-align%20%3A%20justify%3B%22%3ESoftware%20Setup.%3C%2FH3%3E%0A%3CUL%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%0A%3CLI%3E%3CSTRONG%3EMCXN947%20SDK%20version%3A%20%3C%2FSTRONG%3E26.06.00%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ENFCReaderLibrary%20version%3A%20%3C%2FSTRONG%3E07.16.00%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EPN5190%20FW%20version%3A%20%3C%2FSTRONG%3E0x20D%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20class%3D%22lia-align-justify%22%20id%3D%22toc-hId--1580999591%22%20style%3D%22text-align%20%3A%20justify%3B%22%20id%3D%22toc-hId--1580106738%22%20style%3D%22text-align%20%3A%20justify%3B%22%3EHardware%20connections.%3C%2FH3%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3EThe%20PNEV5190%20comes%20with%20a%20Kinetis%20K82F%20as%20a%20host%20MCU%20to%20drive%20the%20PN5190%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3ETo%20enable%20SPI%20communication%20between%20the%20MCXN947%20and%20the%20PN5190%2C%20the%20PNEV5190%20board%20must%20be%20prepared%20as%20follows%3A%3C%2FP%3E%0A%3CUL%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%0A%3CLI%3EPower%20up%20board%20correctly%3C%2FLI%3E%0A%3CLI%3EEnable%20external%20SPI%20pins%3C%2FLI%3E%0A%3CLI%3EDisable%20K82F%20interface%20with%20PN5190%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH4%20class%3D%22lia-align-justify%22%20id%3D%22toc-hId--890438117%22%20style%3D%22text-align%20%3A%20justify%3B%22%20id%3D%22toc-hId--889545264%22%20style%3D%22text-align%20%3A%20justify%3B%22%3EPower%20up%20and%20jumper%20configuration%3C%2FH4%3E%0A%3CUL%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%0A%3CLI%3ETo%20correctly%20power%20up%20the%20board.%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20Powering%20it%20up%20over%20USB%20does%20not%20provide%20enough%20current.%20It%20will%20be%20powered%20with%20an%20external%20power%20supply%20of%207.5V%20over%20connector%20J17.%3C%2FP%3E%0A%3CUL%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%0A%3CLI%3EPut%20jumper%20on%20following%20pins%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20J9%202-3%3A%20External%20power%20supply%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20J8%3A%20VBATPWR%20supplied%20with%20VBAT%3D3.3%20V%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20J12%3A%20VBAT%20supplied%20with%203.3%20V%3C%2FP%3E%0A%3CUL%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%0A%3CLI%3ERemove%20jumpers%20on%20following%20pins%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20J22%2C%20J23%3A%20open%20SDA%20signals%20for%20K82F%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20J19%3A%20RTS%20push-button%20bypass%20for%20K82F%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20J3%2C%20J4%2C%20J5%2C%20J6%3A%20pull%20down%20jumpers%20for%20NFC%20module%20signals%3C%2FP%3E%0A%3CUL%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%0A%3CLI%3ESet%20GPIO%20and%20SPI%20voltage%20to%203.3%20V%3A%20supplying%203.3%20V%20to%20VDDIO%20and%20the%20%CE%BCC%20supply%3A%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20Remove%20short%20circuit%20on%20R19%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%E2%80%93%20Place%20short%20circuit%20on%20R20%3C%2FP%3E%0A%3CUL%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E%0A%3CLI%3EFor%20any%20additional%20configuration%2C%20please%20see%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fdocs%2Fen%2Fapplication-note%2FAN12550.pdf%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3EPNEV5190B%20evaluation%20board%20quick%20start%20guide%3C%2FA%3E.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3ELocation%20of%20the%20changes%20mentioned%20above%20can%20be%20seen%20in%20the%20following%20image%3A%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1782499687907.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1782499687907.png%22%20style%3D%22width%3A%20490px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390392i96C77DD6783D5989%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1782499687907.png%22%20alt%3D%22Habib_MS_0-1782499687907.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_0-1782499687907.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CH4%20id%3D%22toc-hId-1597074716%22%20id%3D%22toc-hId-1597967569%22%3ERouting%20NFC%20module%20communication%20pins%20to%20JP1%3C%2FH4%3E%0A%3CP%3ETo%20enable%20the%20pins%20on%20JP1%20for%20communication%2C%20we%20must%20enable%20bus%20switch%20U10%20and%20disable%20bus%20switch%20U12%20in%20the%20NFC%20Host%20Interface.%20These%20switches%20enable%20or%20disable%20the%20connections%20from%20K82%20to%20PN5190%20SPI%20pins%2C%20and%20expose%20the%20SPI%20interface%20to%20an%20external%20host.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3ERemove%20short%20on%20R5%20to%20disable%20communication%20routing%20to%20K82F.%3C%2FLI%3E%0A%3CLI%3EPlace%20short%20on%20R7%20to%20enable%20communication%20routing%20to%20JP1%20pins.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1782499777420.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1782499777420.png%22%20style%3D%22width%3A%20832px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390393iB1EB4AB3E91F9BD5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1782499777420.png%22%20alt%3D%22Habib_MS_1-1782499777420.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1782499777420.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EFor%20FRDM-MCXN947%20side%2C%20no%20modifications%20are%20necessary.%26nbsp%3B%20The%20pins%20used%20are%20available%20in%20Header%20J1%20and%20J2.%20Which%20are%20shown%20in%20the%20following%20table.%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CTABLE%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3EName%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EMCXN947%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CP%3EPN5190%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3ESCK%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.12%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CP%3EJP1.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3EMOSI%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.8%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CP%3EJP1.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3EMISO%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.10%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CP%3EJP1.3%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3ESSEL%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.6%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CP%3EJP1.4%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3EIRQ%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ1.16%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CP%3EJP1.5%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3ERESET%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.2%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CP%3EJP6.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3EGND%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.14%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CP%3EJP1.10%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3ESUCCESS%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.17*%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CBR%20%2F%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3EFAIL%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.15*%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CBR%20%2F%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22226%22%3E%0A%3CP%3EDWL%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22207%22%3E%0A%3CP%3EJ2.13*%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22190%22%3E%0A%3CBR%20%2F%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E*%20Pins%20that%20need%20to%20be%20configured%20for%20library%20compatibility%20but%20are%20not%20used%20and%20do%20not%20need%20to%20be%20connected.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CBR%20%2F%3E%0A%3CH3%20id%3D%22toc-hId-1586571612%22%20id%3D%22toc-hId-1587464465%22%3ESoftware%20Changes%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThis%20section%20describes%20the%20software%20changes%20required%20to%20run%20the%20%3CSTRONG%3ENfcrdlibEx1_DiscoveryLoop%3C%2FSTRONG%3E%20example%20from%20the%20NFC%20Reader%20Library.%20This%20example%20implements%20a%20detection%20loop%20that%20displays%20information%20about%20any%20tag%20detected%20by%20the%20PN5190%20in%20a%20terminal%2C%20such%20as%20the%20%3CSTRONG%3EUID%3C%2FSTRONG%3E%2C%20%3CSTRONG%3ESAK%3C%2FSTRONG%3E%2C%20and%20%3CSTRONG%3EProduct%20Type%3C%2FSTRONG%3E%20for%20MIFARE-based%20cards.%20Please%20download%20the%20NFC%20Reader%20Library%20for%20the%20PN5190%20from%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fapplications%2Ftechnologies%2Fsecurity%2Findustrial-security%2Fnfc-reader-library-software-support-for-nfc-frontend-solutions%3ANFC-READER-LIBRARY%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3ENFC%20Reader%20Library%20%7C%20NXP%20Semiconductors%3C%2FA%3E.%3CBR%20%2F%3E%3CBR%20%2F%3ETo%20begin%20the%20integration%2C%20we%20first%20need%20to%20import%20a%20%3CSTRONG%3Ehello_world%3C%2FSTRONG%3E%20project%20from%20the%20FRDM-MCXN947%20%3CSTRONG%3ESDK%20(v26.06.00)%3C%2FSTRONG%3E%20into%20%3CSTRONG%3EMCUXpresso%20IDE%20for%20VS%20Code%3C%2FSTRONG%3E.%20For%20this%20purpose%2C%20download%20and%20install%20the%20%3CSTRONG%3EFRDM-MCXN947%20repository%20(version%2026.06)%3C%2FSTRONG%3E%20using%20the%20extension%20available%20in%20the%20%3CSTRONG%3EQuickstart%3C%2FSTRONG%3E%20panel%20by%20selecting%20Import%20%3CSTRONG%3ERepository%3C%2FSTRONG%3E.%20For%20more%20information%20about%20this%20process%2C%20please%20refer%20to%20the%20corresponding%20user%20%3CA%20href%3D%22https%3A%2F%2Fmcuxpresso.nxp.com%2Fmcuxsdk%2Flatest%2Fhtml%2Fgsd%2Frun_a_demo_using_mcuxvsc.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Eguide%3C%2FA%3E.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--220882851%22%20id%3D%22toc-hId--219989998%22%3EImporting%20NFC%20Reader%20library.%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EDownload%20the%20%E2%80%9CNFC%20Reader%20Library%E2%80%9D%20zip%20from%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.nxp.com%2Fapplications%2Ftechnologies%2Fsecurity%2Findustrial-security%2Fnfc-reader-library-software-support-for-nfc-frontend-solutions%3ANFC-READER-LIBRARY%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noreferrer%22%3Eproduct%20page%3C%2FA%3E%26nbsp%3Band%20extract%20in%20a%20known%20folder.%20This%20will%20be%20useful%20for%20later%20use.%26nbsp%3B%20If%20available%2C%20please%20use%20the%20latest%20version%20of%20the%20NFC%20Reader%20Library.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--2028337314%22%20id%3D%22toc-hId--2027444461%22%3EImporting%20base%20project%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3E1.%20In%20the%20Quick%20Start%20panel%20click%20on%20%E2%80%9CImport%20Example%20from%20Repository%E2%80%9D%20in%20VS%20code.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1782500337538.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1782500337538.png%22%20style%3D%22width%3A%20619px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390398iDF616E1597BB066D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1782500337538.png%22%20alt%3D%22Habib_MS_0-1782500337538.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_0-1782500337538.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E2.%20Select%20%E2%80%9CFRDM-MCXN947%E2%80%9D%20in%20board%20setting.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1785876833645.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1785876833645.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393725i70125E71934447E5%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1785876833645.png%22%20alt%3D%22Habib_MS_0-1785876833645.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_0-1785876833645.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3E3.%20In%20the%20template%20will%20search%20for%20the%20%E2%80%9Cfreertos_hello_cm33_core0%E2%80%9D%20example%2C%20select%20Freestanding%20Application%2C%20chose%20the%20location%20and%20click%20on%20%E2%80%9Cimport%E2%80%9D.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1785876872899.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1785876872899.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393726i88415E3A7B7C634A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1785876872899.png%22%20alt%3D%22Habib_MS_1-1785876872899.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1785876872899.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CH3%20id%3D%22toc-hId-459175519%22%20id%3D%22toc-hId-460068372%22%3EImporting%20SDK%20drivers%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3EOnce%20the%20project%20is%20added%20to%20the%20workspace%20we%20will%20need%20to%20add%20the%20required%20drivers%2C%20which%20are%20SPI%2C%20CTIMER%20and%20CMSIS%20drivers.%20For%20this%20we%20need%20to%20add%20the%20following%20code%20in%20the%20prj.cfg%20file.%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1782500385724.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1782500385724.png%22%20style%3D%22width%3A%20818px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390401i8B39C3DB4AC9C422%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1782500385724.png%22%20alt%3D%22Habib_MS_3-1782500385724.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1782500385724.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3ECONFIG_MCUX_COMPONENT_driver.lpflexcomm_lpspi%3Dy%0ACONFIG_MCUX_COMPONENT_driver.ctimer%3Dy%0ACONFIG_MCUX_COMPONENT_driver.CMSIS%3Dy%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3ECONFIG_MCUX_COMPONENT_driver.lpflexcomm_lpspi%3Dy%0ACONFIG_MCUX_COMPONENT_driver.ctimer%3Dy%0ACONFIG_MCUX_COMPONENT_driver.CMSIS%3Dy%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId--1348278944%22%20id%3D%22toc-hId--1347386091%22%3EAdd%20the%20source%20code%20Discovery%20Loop%20Example%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EFirstly%2C%20delete%20the%20file%20freertos_hello.c%20created%20by%20the%20project.%3C%2FP%3E%0A%3CP%3EFrom%20the%20%E2%80%9CNxpNfcRdLib_PN5190_v07.16.00_PUB%E2%80%9D%20extracted%2C%20find%20and%20drag%20and%20drop%20the%20following%20files%20on%20in%20the%20project%20files%20folder%3A%20NfcrdlibEx1_EmvcoProfile.c%2C%20phApp_Helper.c%2C%20phApp_Init.c%2C%20phApp_PN5190_Init.c.%20You%20can%20find%20these%20files%20in%20the%20following%20path%3A%3C%2FP%3E%0A%3CP%3E%7BNxpNfcRdLibRoot%7D%20%5CExamples%5CNfcrdlibEx1_DiscoveryLoop%5Csrc%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1782504550792.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1782504550792.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390404i658ED56935D88B03%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1782504550792.png%22%20alt%3D%22Habib_MS_2-1782504550792.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1782504550792.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EWhen%20you%20drag%20and%20drop%20a%20file%20into%20VS%20code%20a%20window%20will%20appear%20asking%20whether%20you%20want%20to%20link%20the%20file%20or%20copy%20it.%20Please%20select%20%E2%80%9CCopy%20files.%E2%80%9D%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1782504569947.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1782504569947.png%22%20style%3D%22width%3A%20698px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390405iAE97601A30FB746F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1782504569947.png%22%20alt%3D%22Habib_MS_3-1782504569947.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1782504569947.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAfter%20dragging%20and%20dropping%20any%20file%2C%20the%20CMakeLists.txt%20file%20is%20automatically%20updated%20to%20include%20all%20the%20copied%20.c%20files.%20If%20you%20selected%20all%20these%20files%2C%20the%20generated%20code%20will%20appear%20as%20follows%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_4-1782504588274.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_4-1782504588274.png%22%20style%3D%22width%3A%20416px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390406i405E6F8E6136557B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_4-1782504588274.png%22%20alt%3D%22Habib_MS_4-1782504588274.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_4-1782504588274.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAdditionally%2C%20we%20need%20to%20add%20the%20file%20%E2%80%9CNfcrdlibEx1_DiscoveryLoop.c%E2%80%9D%20which%20is%20the%20main%20source%20file%20of%20the%20project%2C%20to%20achieve%20this%20also%20please%20drag%20and%20drop%20in%20the%20project%20files%20folder.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_5-1782504604217.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_5-1782504604217.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390407i4CB5862D7B27AD5D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_5-1782504604217.png%22%20alt%3D%22Habib_MS_5-1782504604217.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_5-1782504604217.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3EAt%20this%20point%2C%20the%20project%20should%20look%20like%20this%3A%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%20%26nbsp%3B%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1785877154551.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1785877154551.png%22%20style%3D%22width%3A%20548px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393727i725FCC401747D782%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1785877154551.png%22%20alt%3D%22Habib_MS_0-1785877154551.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_0-1785877154551.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CH3%20id%3D%22toc-hId-444070410%22%20id%3D%22toc-hId-444963263%22%3EAdd%20the%20example%20source%20code%20to%20the%20newly%20created%20MCXN947%20project%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EFrom%20the%20%E2%80%9CNxpNfcRdLib_PN5190_v07.14.00_PUB%E2%80%9D%20extracted%20just%20drag%20and%20drop%20in%20the%20project%20files%20folder%20the%20following%20folders.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1782504704260.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1782504704260.png%22%20style%3D%22width%3A%20866px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390409iF6B2B6F272018EDF%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1782504704260.png%22%20alt%3D%22Habib_MS_0-1782504704260.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_0-1782504704260.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1782504734285.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1782504734285.png%22%20style%3D%22width%3A%20694px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390410i588A6A871E6F70FA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1782504734285.png%22%20alt%3D%22Habib_MS_1-1782504734285.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1782504734285.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1782504750818.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1782504750818.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390411i4B97F6EDA5C7980F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1782504750818.png%22%20alt%3D%22Habib_MS_2-1782504750818.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1782504750818.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1782504795659.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1782504795659.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390412i89A56BCBD7FBA6DC%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1782504795659.png%22%20alt%3D%22Habib_MS_3-1782504795659.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1782504795659.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EOnce%20these%20folders%20are%20added%20the%20project%20should%20look%20like%20this%3A%3C%2FP%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1785877203826.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1785877203826.png%22%20style%3D%22width%3A%20541px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393728iACC682942A29CBA2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1785877203826.png%22%20alt%3D%22Habib_MS_1-1785877203826.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1785877203826.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CH3%20id%3D%22toc-hId--1363384053%22%20id%3D%22toc-hId--1362491200%22%3EDefine%20FRDM-MCXN947%20SDK%20preprocessor%20symbol%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EWe%20need%20to%20make%20some%20changes%20to%20the%20compiler%20preprocessor%20configuration%20related%20to%20the%20NFC%20reader%20library%2C%20to%20do%20this%20we%20need%20to%20modify%20the%20Cmakelist.txt%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EPH_OSAL_FREERTOS%3C%2FLI%3E%0A%3CLI%3EPHDRIVER_FRDMMCXN947_PN5190_BOARD%3C%2FLI%3E%0A%3CLI%3ENXPBUILD_CUSTOMER_HEADER_INCLUDED%3C%2FLI%3E%0A%3CLI%3EPHDRIVER_MCXN947_SPI_POLLING%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1782505699286.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1782505699286.png%22%20style%3D%22width%3A%20892px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390423i9C2D52284A085105%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1782505699286.png%22%20alt%3D%22Habib_MS_0-1782505699286.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_0-1782505699286.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Emcux_add_macro(%0A%20%20%20%20CC%22NXPBUILD_CUSTOMER_HEADER_INCLUDED%5C%0A%20%20%20%20PHDRIVER_FRDMMCXN947_PN5190_BOARD%5C%0A%20%20%20%20PH_OSAL_FREERTOS%5C%0A%20%20%20%20PHDRIVER_MCXN947_SPI_POLLING%22%0A)%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Emcux_add_macro(%0A%20%20%20%20CC%22NXPBUILD_CUSTOMER_HEADER_INCLUDED%5C%0A%20%20%20%20PHDRIVER_FRDMMCXN947_PN5190_BOARD%5C%0A%20%20%20%20PH_OSAL_FREERTOS%5C%0A%20%20%20%20PHDRIVER_MCXN947_SPI_POLLING%22%0A)%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CP%3EThese%20symbols%20are%20added%20so%20the%20preprocessor%20knows%20which%20header%20files%20to%20include%20at%20build%20time.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EPHDRIVER_FRDMMCXN947_PN5190_BOARD%3C%2FSTRONG%3E%20will%20help%20include%20the%20BoardSelection.h%20header%2C%20the%20file%20that%20is%20going%20to%20define%20addresses%20for%20registers%20and%20peripherals%20of%20MCXN947.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EPH_OSAL_FREERTOS%3C%2FSTRONG%3E%26nbsp%3Bwill%20include%20headers%20related%20to%20OS%20operation%2C%20meaning%20that%20the%20project%20will%20work%20with%20operative%20system%20(at%20the%20end%20of%20this%20guide%20you%20will%20find%20the%20steps%20to%20add%20NULLOS%20support).%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ENXPBUILD_CUSTOMER_HEADER_INCLUDED%3C%2FSTRONG%3E%20will%20add%20headers%20to%20add%20and%20select%20the%20NFC%20reader%20and%20host%20that%20will%20be%20used%20in%20the%20project.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EPHDRIVER_MCXN947_SPI_POLLING%3C%2FSTRONG%3E%3A%20if%20is%20defined%20the%20example%20will%20perform%20SPI%20communication%20by%20polling%20method%2C%20and%20if%20not%2C%20will%20be%20perform%20through%20non-blocking%20transfers.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CH3%20id%3D%22toc-hId-1124128780%22%20id%3D%22toc-hId-1125021633%22%3EModifying%20the%20Driver%20Abstraction%20Layer%20(DAL)%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThe%20added%20folder%20DAL%20will%20contain%20the%20important%20changes%20to%20be%20able%20to%20use%20the%20MCXN947%20as%20host%20device%20since%20it%20will%20contain%20all%20the%20changes%20regarding%20SPI%2C%20timer%20and%20GPIO%20configurations%20required%20by%20the%20library%20to%20work%20properly.%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId--554242964%22%20id%3D%22toc-hId--553350111%22%3EBoard_FRDM_MCXN947_PN5190.h%3C%2FH4%3E%0A%3CP%3EWe%20need%20to%20create%20a%20header%20file%20that%20will%20contain%20important%20macros%20used%20by%20the%20library%20that%20are%20related%20to%20the%20host%20specific%20SPI%2C%20timer%20and%20GPIO%20peripherals%2C%20as%20well%20as%20interrupt%20vectors%20and%20priorities%2C%20clock%20sources%20and%20addresses.%20This%20file%20is%20required%20to%20be%20inside%20the%20%E2%80%9Cboards%E2%80%9D%20folder%20which%20is%20inside%20DAL.%3C%2FP%3E%0A%3CP%3E1.%20Go%20to%20explorer%20window%20and%20select%20%E2%80%9Cadd%20file%E2%80%9D%20on%20the%20boards%20folder%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1782505314578.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1782505314578.png%22%20style%3D%22width%3A%20573px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390416i32CCBCB89906849F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1782505314578.png%22%20alt%3D%22Habib_MS_1-1782505314578.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1782505314578.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E2.%20Write%20the%20file%E2%80%99s%20name%20as%20follows%20(Board_FRDM_MCXN947_PN5190.h)%20and%20click%20enter%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1782505345384.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1782505345384.png%22%20style%3D%22width%3A%20577px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390417iB62CDE25ECF0971C%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1782505345384.png%22%20alt%3D%22Habib_MS_2-1782505345384.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1782505345384.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EA%20window%20like%20the%20one%20shown%20in%20the%20following%20figure%20will%20appear.%20However%2C%20it%20can%20be%20discarded.%20This%20window%20is%20intended%20to%20add%20the%20newly%20created%20file%20to%20the%20CMakeLists.txt%20file%2C%20but%20we%20will%20instead%20include%20the%20entire%20folder%20later.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1782505364793.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1782505364793.png%22%20style%3D%22width%3A%20614px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390418i52E5E89F7678FC62%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1782505364793.png%22%20alt%3D%22Habib_MS_3-1782505364793.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1782505364793.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3EInside%20this%20file%2C%20some%20important%20macros%20related%20to%20the%20SPI%20peripheral%20and%20the%20important%20pins%20to%20be%20handled%20(IRQ%2C%20Chip%20Select%2C%20Reset)%20are%20defined.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_4-1782505388079.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_4-1782505388079.png%22%20style%3D%22width%3A%20956px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390419i5FAE1B6865FCBF01%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_4-1782505388079.png%22%20alt%3D%22Habib_MS_4-1782505388079.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_4-1782505388079.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23ifndef%20DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_%0A%23define%20DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_%0A%23define%20GPIO_PORT%200%0A%23define%20GPIO_PORT1%201%0A%2F******************************************************************%0A*%20LPSPI%20clock%20configuration%0A******************************************************************%2F%0A%2F*Clock%20Frequency%20for%20SPI%20Flexcomm%201*%2F%0A%23define%20SPI_CLOCK_FREQ%20(CLOCK_GetLPFlexCommClkFreq(1u))%0A%23define%20SPI_MASTER_CLOCK_FREQ%20SPI_CLOCK_FREQ%0A%2F******************************************************************%0A*%20Board%20Pin%2FGpio%20configurations%0A******************************************************************%2F%0A%23define%20PHDRIVER_PIN_RESET%20((GPIO_PORT%20%26lt%3B%26lt%3B%208)%20%7C%2028)%20%2F**%26lt%3B%20Reset%20pin%2C%20Pin28%2C%20PIO0_28%20*%2F%0A%23define%20PHDRIVER_PIN_IRQ%20((GPIO_PORT%20%26lt%3B%26lt%3B%208)%20%7C%2031)%20%20%2F**%26lt%3B%20IRQ%20pin%2C%20Pin10%2C%20PIO0_10%20*%2F%0A%2F*%20For%205190%20busy%20is%20same%20as%20IRQ%20*%2F%0A%23define%20PHDRIVER_PIN_BUSY%20((GPIO_PORT%20%26lt%3B%26lt%3B%208)%20%7C%2031)%20%20%2F**%26lt%3B%20IRQ%20pin%2C%20Pin31%2C%20PIO0_31%20*%2F%0A%23define%20PHDRIVER_PIN_DWL%20%20%20%20((GPIO_PORT%20%26lt%3B%26lt%3B%208)%20%7C%2019)%20%20%2F**%26lt%3B%20Download%20pin%2C%20Pin19%2C%20PIO0_19*%2F%0A%2F*%20These%20pins%20are%20used%20for%20EMVCo%20Interoperability%20test%20status%20indication%2C%0A%20*%20not%20for%20the%20generic%20Reader%20Library%20implementation.%0A%20*%2F%0A%23define%20PHDRIVER_PIN_SUCCESS%20%20%20((GPIO_PORT1%20%26lt%3B%26lt%3B%208)%20%7C%200)%20%20%20%2F**%26lt%3B%20GPIO%2C%20Port%201%2C%20Pin0%20*%2F%0A%23define%20PHDRIVER_PIN_FAIL%20%20%20%20%20%20((GPIO_PORT1%20%26lt%3B%26lt%3B%208)%20%7C%201)%20%20%20%2F**%26lt%3B%20GPIO%2C%20Port%201%2C%20Pin1%20*%2F%0A%2F******************************************************************%0A*%20PIN%20Pull-Up%2FPull-Down%20configurations.%0A******************************************************************%2F%0A%23define%20PHDRIVER_PIN_RESET_PULL_CFG%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_IRQ_PULL_CFG%20%20%20%20%20%20PH_DRIVER_PULL_DOWN%0A%23define%20PHDRIVER_PIN_WKUP_PULL_CFG%20%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_CLK_PULL_CFG%20%20%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_DWL_PULL_CFG%20%20%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_NSS_PULL_CFG%20%20%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_BUSY_PULL_CFG%20%20%20%20%20PH_DRIVER_PULL_UP%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23ifndef%20DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_%0A%23define%20DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_%0A%23define%20GPIO_PORT%200%0A%23define%20GPIO_PORT1%201%0A%2F******************************************************************%0A*%20LPSPI%20clock%20configuration%0A******************************************************************%2F%0A%2F*Clock%20Frequency%20for%20SPI%20Flexcomm%201*%2F%0A%23define%20SPI_CLOCK_FREQ%20(CLOCK_GetLPFlexCommClkFreq(1u))%0A%23define%20SPI_MASTER_CLOCK_FREQ%20SPI_CLOCK_FREQ%0A%2F******************************************************************%0A*%20Board%20Pin%2FGpio%20configurations%0A******************************************************************%2F%0A%23define%20PHDRIVER_PIN_RESET%20((GPIO_PORT%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%2028)%20%2F**%26lt%3B%20Reset%20pin%2C%20Pin28%2C%20PIO0_28%20*%2F%0A%23define%20PHDRIVER_PIN_IRQ%20((GPIO_PORT%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%2031)%20%20%2F**%26lt%3B%20IRQ%20pin%2C%20Pin10%2C%20PIO0_10%20*%2F%0A%2F*%20For%205190%20busy%20is%20same%20as%20IRQ%20*%2F%0A%23define%20PHDRIVER_PIN_BUSY%20((GPIO_PORT%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%2031)%20%20%2F**%26lt%3B%20IRQ%20pin%2C%20Pin31%2C%20PIO0_31%20*%2F%0A%23define%20PHDRIVER_PIN_DWL%20%20%20%20((GPIO_PORT%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%2019)%20%20%2F**%26lt%3B%20Download%20pin%2C%20Pin19%2C%20PIO0_19*%2F%0A%2F*%20These%20pins%20are%20used%20for%20EMVCo%20Interoperability%20test%20status%20indication%2C%0A%20*%20not%20for%20the%20generic%20Reader%20Library%20implementation.%0A%20*%2F%0A%23define%20PHDRIVER_PIN_SUCCESS%20%20%20((GPIO_PORT1%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%200)%20%20%20%2F**%26lt%3B%20GPIO%2C%20Port%201%2C%20Pin0%20*%2F%0A%23define%20PHDRIVER_PIN_FAIL%20%20%20%20%20%20((GPIO_PORT1%20%26lt%3B%26lt%3B%20%3CLI-EMOJI%20id%3D%22lia_smiling-face-with-sunglasses%22%20title%3D%22%3Asmiling_face_with_sunglasses%3A%22%3E%3C%2FLI-EMOJI%3E%20%7C%201)%20%20%20%2F**%26lt%3B%20GPIO%2C%20Port%201%2C%20Pin1%20*%2F%0A%2F******************************************************************%0A*%20PIN%20Pull-Up%2FPull-Down%20configurations.%0A******************************************************************%2F%0A%23define%20PHDRIVER_PIN_RESET_PULL_CFG%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_IRQ_PULL_CFG%20%20%20%20%20%20PH_DRIVER_PULL_DOWN%0A%23define%20PHDRIVER_PIN_WKUP_PULL_CFG%20%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_CLK_PULL_CFG%20%20%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_DWL_PULL_CFG%20%20%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_NSS_PULL_CFG%20%20%20%20%20%20PH_DRIVER_PULL_UP%0A%23define%20PHDRIVER_PIN_BUSY_PULL_CFG%20%20%20%20%20PH_DRIVER_PULL_UP%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EWe%20define%20the%20macros%20as%20well%20for%20the%20interrupt%20vector%20of%20MCXN947%2C%20its%20priority%2C%20handler%20and%20trigger%20type.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_5-1782505436112.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_5-1782505436112.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390420iFDB5C6F2D8F7B0BB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_5-1782505436112.png%22%20alt%3D%22Habib_MS_5-1782505436112.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_5-1782505436112.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%2F******************************************************************%0A*%20IRQ%20PIN%20NVIC%20settings%0A******************************************************************%2F%0A%23define%20EINT_IRQn%20GPIO00_IRQn%20%2F*Adding%20interrupt%20vector%20A%20of%20GPIO*%2F%0A%23define%20EINT_PRIORITY%207%20%2F*Default%20interrupt%20priority%20for%20GPIO*%2F%0A%23define%20CLIF_IRQHandler%20GPIO00_IRQHandler%20%2F*Interrupt%20handler%20for%20vector%20A*%2F%0A%23define%20PIN_IRQ_TRIGGER_TYPE%20PH_DRIVER_INTERRUPT_RISINGEDGE%20%2F*Rising%20edge%20Trigger*%2F%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%2F******************************************************************%0A*%20IRQ%20PIN%20NVIC%20settings%0A******************************************************************%2F%0A%23define%20EINT_IRQn%20GPIO00_IRQn%20%2F*Adding%20interrupt%20vector%20A%20of%20GPIO*%2F%0A%23define%20EINT_PRIORITY%207%20%2F*Default%20interrupt%20priority%20for%20GPIO*%2F%0A%23define%20CLIF_IRQHandler%20GPIO00_IRQHandler%20%2F*Interrupt%20handler%20for%20vector%20A*%2F%0A%23define%20PIN_IRQ_TRIGGER_TYPE%20PH_DRIVER_INTERRUPT_RISINGEDGE%20%2F*Rising%20edge%20Trigger*%2F%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EAs%20well%20as%20some%20macros%20for%20pin%20logic%20levels.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_6-1782505468893.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_6-1782505468893.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390421i01929397A7073804%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_6-1782505468893.png%22%20alt%3D%22Habib_MS_6-1782505468893.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_6-1782505468893.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%2F*****************************************************************%0A*%20Front%20End%20Reset%20logic%20level%20settings%0A****************************************************************%2F%0A%23define%20PH_DRIVER_SET_HIGH%201%20%2F**%26lt%3B%20Logic%20High.%20*%2F%0A%23define%20PH_DRIVER_SET_LOW%200%20%2F**%26lt%3B%20Logic%20Low.%20*%2F%0A%23define%20RESET_POWERDOWN_LEVEL%20PH_DRIVER_SET_LOW%0A%23define%20RESET_POWERUP_LEVEL%20PH_DRIVER_SET_HIGH%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%2F*****************************************************************%0A*%20Front%20End%20Reset%20logic%20level%20settings%0A****************************************************************%2F%0A%23define%20PH_DRIVER_SET_HIGH%201%20%2F**%26lt%3B%20Logic%20High.%20*%2F%0A%23define%20PH_DRIVER_SET_LOW%200%20%2F**%26lt%3B%20Logic%20Low.%20*%2F%0A%23define%20RESET_POWERDOWN_LEVEL%20PH_DRIVER_SET_LOW%0A%23define%20RESET_POWERUP_LEVEL%20PH_DRIVER_SET_HIGH%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EFinally%2C%20we%20define%20macros%20for%20the%20base%20address%20of%20CTIMER%20and%20SPI%20peripherals%2C%20clock%20frequencies%2C%20interrupt%20vectors%20and%20related%20pins.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_7-1782505509612.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_7-1782505509612.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390422iD6E03036A4A75F31%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_7-1782505509612.png%22%20alt%3D%22Habib_MS_7-1782505509612.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_7-1782505509612.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%2F*****************************************************************%0A*%20SPI%20Configuration%0A****************************************************************%2F%0A%23define%20PHDRIVER_MCXN947_SPI_MASTER%20LPSPI1%0A%23define%20PHDRIVER_MCXN947_SPI_DATA_RATE%205000000U%0A%23define%20PHDRIVER_MCXN947_SPI_CLK_SRC%20SPI_MASTER_CLOCK_FREQ%0A%23define%20PHDRIVER_MCXN947_SPI_IRQ%20LP_FLEXCOMM1_IRQn%0A%23define%20SPI_IRQ_PRIORITY%206%20%2F*SPI%20interrupt%20priority*%2F%0A%23define%20PHDRIVER_PIN_SSEL%20%2027U%2F*%20Chip%20Select%2C%20Pin6%2C%20SPI%20*%2F%0A%23define%20PHDRIVER_PIN_SCK%20%20%2025U%2F*%20SPI%20clock%2C%20Pin7%2C%20SPI%20*%2F%0A%23define%20PHDRIVER_PIN_MISO%20%2026U%2F*%20MISO%2C%20Pin8%2C%20SPI%20*%2F%0A%23define%20PHDRIVER_PIN_MOSI%20%2024U%2F*%20MOSI%2C%20Pin9%2C%20SPI%20*%2F%0A%23define%20PHDRIVER_FC1_SPI_DIV%20kCLOCK_DivFlexcom1Clk%0A%23define%20PHDRIVER_FC1_SPI_CLK%20kFRO12M_to_FLEXCOMM1%20%2F*Clock%20to%20attach%20to%20Flexcomm1*%2F%0A%2F*****************************************************************%0A*%20Timer%20Configuration%0A****************************************************************%2F%0A%23define%20PH_DRIVER_SDK_CTIMER%20CTIMER0%20%2F*CTIMER0%20base*%2F%0A%23define%20PH_DRIVER_SDK_CTIMER_CLK%20%20kCLOCK_DivCtimer0Clk%2F*CTIMER0%20clock*%2F%0A%23define%20PH_DRIVER_SDK_CTIMER_NVIC%20CTIMER0_IRQn%20%2F*Interrupt%20vector*%2F%0A%23define%20PH_DRIVER_SDK_CTIMER_PRIORITY%204%0A%23define%20PH_DRIVER_SDK_CTIMER_CLK_FREQ%20CLOCK_GetCTimerClkFreq(0U)%20%2F*CTIMER0%20Clock%20frequency*%2F%0A%0A%23endif%20%2F*%20DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_%20*%2F%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%2F*****************************************************************%0A*%20SPI%20Configuration%0A****************************************************************%2F%0A%23define%20PHDRIVER_MCXN947_SPI_MASTER%20LPSPI1%0A%23define%20PHDRIVER_MCXN947_SPI_DATA_RATE%205000000U%0A%23define%20PHDRIVER_MCXN947_SPI_CLK_SRC%20SPI_MASTER_CLOCK_FREQ%0A%23define%20PHDRIVER_MCXN947_SPI_IRQ%20LP_FLEXCOMM1_IRQn%0A%23define%20SPI_IRQ_PRIORITY%206%20%2F*SPI%20interrupt%20priority*%2F%0A%23define%20PHDRIVER_PIN_SSEL%20%2027U%2F*%20Chip%20Select%2C%20Pin6%2C%20SPI%20*%2F%0A%23define%20PHDRIVER_PIN_SCK%20%20%2025U%2F*%20SPI%20clock%2C%20Pin7%2C%20SPI%20*%2F%0A%23define%20PHDRIVER_PIN_MISO%20%2026U%2F*%20MISO%2C%20Pin8%2C%20SPI%20*%2F%0A%23define%20PHDRIVER_PIN_MOSI%20%2024U%2F*%20MOSI%2C%20Pin9%2C%20SPI%20*%2F%0A%23define%20PHDRIVER_FC1_SPI_DIV%20kCLOCK_DivFlexcom1Clk%0A%23define%20PHDRIVER_FC1_SPI_CLK%20kFRO12M_to_FLEXCOMM1%20%2F*Clock%20to%20attach%20to%20Flexcomm1*%2F%0A%2F*****************************************************************%0A*%20Timer%20Configuration%0A****************************************************************%2F%0A%23define%20PH_DRIVER_SDK_CTIMER%20CTIMER0%20%2F*CTIMER0%20base*%2F%0A%23define%20PH_DRIVER_SDK_CTIMER_CLK%20%20kCLOCK_DivCtimer0Clk%2F*CTIMER0%20clock*%2F%0A%23define%20PH_DRIVER_SDK_CTIMER_NVIC%20CTIMER0_IRQn%20%2F*Interrupt%20vector*%2F%0A%23define%20PH_DRIVER_SDK_CTIMER_PRIORITY%204%0A%23define%20PH_DRIVER_SDK_CTIMER_CLK_FREQ%20CLOCK_GetCTimerClkFreq(0U)%20%2F*CTIMER0%20Clock%20frequency*%2F%0A%0A%23endif%20%2F*%20DAL_BOARDS_BOARD_FRDM_MCXN947_PN5190_H_%20*%2F%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CH4%20id%3D%22toc-hId-1933269869%22%20id%3D%22toc-hId-1934162722%22%3EMCXN947%20SPI%20and%20SDK%20files%3C%2FH4%3E%0A%3CP%3E%26nbsp%3BNow%2C%20inside%20DAL%20%26gt%3B%20src%20folder%20we%20will%20create%20a%20folder%20named%20%E2%80%9CMCXN947%E2%80%9D%20that%20will%20contain%202%20source%20files%3A%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EphbalReg_Mcxn947Spi.c%3C%2FLI%3E%0A%3CLI%3EphDriver_Mcxn947SDK.c%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E1.%20Firstly%2C%20we%20will%20need%20to%20delete%20the%20%E2%80%9CKinetisSDK%E2%80%9D%20folder%20located%20in%20the%20src%20folder%20to%20avoid%20multiple%20definition%20issues.%20Please%20right-click%20on%20src%2FKinetisSDK%20and%20click%20on%20%E2%80%9CDelete%E2%80%9D%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1782505869521.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1782505869521.png%22%20style%3D%22width%3A%20613px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390424i0A7CCAB6B6BF6754%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1782505869521.png%22%20alt%3D%22Habib_MS_1-1782505869521.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1782505869521.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%3CSPAN%3E2.%20A%20window%20as%20the%20following%20figure%20will%20appear%2C%20please%20click%20on%20%E2%80%9CMove%20to%20Recycle%20Bin%E2%80%9D%3A%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1782505893781.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1782505893781.png%22%20style%3D%22width%3A%20628px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390425i574E3941E9B82D90%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1782505893781.png%22%20alt%3D%22Habib_MS_2-1782505893781.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1782505893781.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E3.%20In%20the%20same%20folder%20please%20right-click%20and%20click%20on%20%E2%80%9CNew%20folder%E2%80%A6%E2%80%9D%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1782505917835.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1782505917835.png%22%20style%3D%22width%3A%20732px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390426i6E7A6EA0E7707261%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1782505917835.png%22%20alt%3D%22Habib_MS_3-1782505917835.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1782505917835.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%3E4.%20Write%20the%20folder%E2%80%99s%20name%20as%20follows%20(MCXN947)%20and%20click%20enter%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_4-1782505943176.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_4-1782505943176.png%22%20style%3D%22width%3A%20652px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390427i4449E6D2E8E63114%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_4-1782505943176.png%22%20alt%3D%22Habib_MS_4-1782505943176.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_4-1782505943176.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3E5.%20Add%20both%20files%20following%20the%20same%20steps%20mentioned%20in%20the%20section%20Board_FRDM_MCXN947_PN5190.h%20but%20with%20those%20files%20(phbalReg_Mcxn947Spi.c%20and%20phDriver_Mcxn947SDK.c).%20We%20will%20add%20these%20source%20files%20in%20the%20CMake_List.txt%20on%20the%20next%20step.%3C%2FP%3E%0A%3CP%3EOnce%20these%20files%20are%20added%20the%20src%20folder%20should%20look%20like%20this%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_5-1782505974388.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_5-1782505974388.png%22%20style%3D%22width%3A%20515px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390428iE727E78F345C5C8D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_5-1782505974388.png%22%20alt%3D%22Habib_MS_5-1782505974388.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_5-1782505974388.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3E6.%20Finally%2C%20we%20will%20add%20both%20files%20to%20the%20CMakeLists.txt%20file%20so%20they%20are%20included%20in%20the%20compilation%20process.%20Please%20add%20the%20following%20code%20in%20the%20CMake_list.txt%20file%3A%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_6-1782505996170.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_6-1782505996170.png%22%20style%3D%22width%3A%20858px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390429i8E6E3BCCFBC39326%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_6-1782505996170.png%22%20alt%3D%22Habib_MS_6-1782505996170.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_6-1782505996170.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Emcux_add_source(BASE_PATH%20%24%7BCMAKE_CURRENT_LIST_DIR%7D%0A%20%20%20%20SOURCES%20%22DAL%2Fsrc%2FMCXN947%2FphbalReg_Mcxn947Spi.c%22%0A%20%20%20%20%22DAL%2Fsrc%2FMCXN947%2FphDriver_Mcxn947SDK.c%22)%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Emcux_add_source(BASE_PATH%20%24%7BCMAKE_CURRENT_LIST_DIR%7D%0A%20%20%20%20SOURCES%20%22DAL%2Fsrc%2FMCXN947%2FphbalReg_Mcxn947Spi.c%22%0A%20%20%20%20%22DAL%2Fsrc%2FMCXN947%2FphDriver_Mcxn947SDK.c%22)%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EAlthough%20the%20Kinetis%20SDK%20folder%20has%20been%20deleted%2C%20it%20is%20still%20referenced%20in%20the%20CMakeLists.txt%20file.%20Please%20remove%20those%20includes%20from%20this%20file.%3C%2FP%3E%0A%3CP%20class%3D%22lia-align-justify%22%20style%3D%22text-align%20%3A%20justify%3B%22%20style%3D%22text-align%20%3A%20justify%3B%22%3ENow%2C%20we%20will%20return%20to%20the%20MCUXpresso%20extension.%20Within%20these%20source%20files%2C%20we%20will%20modify%20the%20functions%20inherited%20from%20other%20board%20host%20implementations%2C%20replacing%20them%20with%20configurations%20specific%20to%20the%20MCXN947%20peripheral%20drivers%2C%20including%20%3CSTRONG%3ESPI%3C%2FSTRONG%3E%2C%20%3CSTRONG%3Etimers%3C%2FSTRONG%3E%2C%20%3CSTRONG%3EGPIOs%3C%2FSTRONG%3E%2C%20and%20%3CSTRONG%3Einterrupt%20handlers%3C%2FSTRONG%3E.%3CBR%20%2F%3EThese%20modifications%20are%20based%20on%20SDK%20examples%20such%20as%20%3CSTRONG%3Ectimer_match_interrupt_example_cm33_core0%3C%2FSTRONG%3E%20and%20%3CSTRONG%3Elpspi_polling_b2b_transfer_master_cm33_core0%3C%2FSTRONG%3E.%3C%2FP%3E%0A%3CH4%20id%3D%22toc-hId-125815406%22%20id%3D%22toc-hId-126708259%22%3EphbalReg_Mcxn947Spi.c%3A%3C%2FH4%3E%0A%3CP%3EIn%20this%20file%20we%20first%20need%20to%20include%20the%20necessary%20files%20and%20include%20the%20headers%20and%20callbacks%20to%20ensure%20the%20correct%20functionality%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1782506156720.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1782506156720.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390432i9ADBCF99C8B203D2%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1782506156720.png%22%20alt%3D%22Habib_MS_1-1782506156720.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1782506156720.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23include%20%22phDriver.h%22%0A%23include%20%3CBOARD.H%3E%0A%23include%20%22BoardSelection.h%22%0A%23include%20%3CFSL_LPSPI.H%3E%0A%23include%20%3CFSL_CLOCK.H%3E%0A%23include%20%3CFSL_PORT.H%3E%0A%0A%23define%20PHBAL_REG_MCXN947_SPI_ID%200x0FU%20%2F**%26lt%3B%20ID%20for%20MCXN947%20SPI%20BAL%20component%20*%2F%0A%23define%20RX_BUFFER_SIZE_MAX%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20272U%20%2F*%20Receive%20Buffer%20size%20while%20exchange%20*%2F%0A%0A%23ifndef%20PHDRIVER_MCXN947_SPI_POLLING%0Alpspi_master_handle_t%20g_masterHandle%3B%0A%2F*%20LPSPI%20user%20callback%20*%2F%0Avoid%20LPSPI_MasterUserCallback(LPSPI_Type%20*base%2C%20lpspi_master_handle_t%20*handle%2C%20status_t%20status%2C%20void%20*userData)%3B%0A%23endif%0Astatic%20void%20phbalReg_Mcxn947SpiConfig(void)%3B%0A%23ifndef%20PHDRIVER_MCXN947_SPI_POLLING%0Avolatile%20bool%20isTransferCompleted%20%20%3D%20false%3B%0Avoid%20LPSPI_MasterUserCallback(LPSPI_Type%20*base%2C%20lpspi_master_handle_t%20*handle%2C%20status_t%20status%2C%20void%20*userData)%0A%7B%0A%20%20%20%20if%20(status%20%3D%3D%20kStatus_Success)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20__NOP()%3B%0A%20%20%20%20%7D%0A%20%20%20%20isTransferCompleted%20%3D%20true%3B%0A%7D%0A%23endif%0A%3C%2FFSL_PORT.H%3E%3C%2FFSL_CLOCK.H%3E%3C%2FFSL_LPSPI.H%3E%3C%2FBOARD.H%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23include%20%22phDriver.h%22%0A%23include%20%3CBOARD.H%3E%0A%23include%20%22BoardSelection.h%22%0A%23include%20%3CFSL_LPSPI.H%3E%0A%23include%20%3CFSL_CLOCK.H%3E%0A%23include%20%3CFSL_PORT.H%3E%0A%0A%23define%20PHBAL_REG_MCXN947_SPI_ID%200x0FU%20%2F**%26lt%3B%20ID%20for%20MCXN947%20SPI%20BAL%20component%20*%2F%0A%23define%20RX_BUFFER_SIZE_MAX%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20272U%20%2F*%20Receive%20Buffer%20size%20while%20exchange%20*%2F%0A%0A%23ifndef%20PHDRIVER_MCXN947_SPI_POLLING%0Alpspi_master_handle_t%20g_masterHandle%3B%0A%2F*%20LPSPI%20user%20callback%20*%2F%0Avoid%20LPSPI_MasterUserCallback(LPSPI_Type%20*base%2C%20lpspi_master_handle_t%20*handle%2C%20status_t%20status%2C%20void%20*userData)%3B%0A%23endif%0Astatic%20void%20phbalReg_Mcxn947SpiConfig(void)%3B%0A%23ifndef%20PHDRIVER_MCXN947_SPI_POLLING%0Avolatile%20bool%20isTransferCompleted%20%20%3D%20false%3B%0Avoid%20LPSPI_MasterUserCallback(LPSPI_Type%20*base%2C%20lpspi_master_handle_t%20*handle%2C%20status_t%20status%2C%20void%20*userData)%0A%7B%0A%20%20%20%20if%20(status%20%3D%3D%20kStatus_Success)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20__NOP()%3B%0A%20%20%20%20%7D%0A%20%20%20%20isTransferCompleted%20%3D%20true%3B%0A%7D%0A%23endif%0A%3C%2FFSL_PORT.H%3E%3C%2FFSL_CLOCK.H%3E%3C%2FFSL_LPSPI.H%3E%3C%2FBOARD.H%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EAfter%2C%20we%20will%20define%20the%20phbalReg_Init%20function%2C%20which%20will%20be%20used%20by%20the%20library%20to%20initialize%20the%20SPI%20peripheral%20in%20this%20case%2C%20and%20it%20is%20defined%20as%20follows%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1782506214363.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1782506214363.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390433i0E9CC341D5B1072B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1782506214363.png%22%20alt%3D%22Habib_MS_2-1782506214363.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1782506214363.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%2F**%0A*%20%5Cbrief%20Initialize%20the%20Rw612%20SPI%20BAL%20layer.%0A*%0A*%20%5Creturn%20Status%20code%0A*%20%5Cretval%20%23PH_DRIVER_SUCCESS%20Operation%20successful.%0A*%20%5Cretval%20%23PH_ERR_INVALID_DATA_PARAMS%20Parameter%20structure%20size%20is%20invalid.%0A*%2F%0A%0AphStatus_t%20phbalReg_Init(%20void%20*%20pDataParams%2C%20uint16_t%20wSizeOfDataParams)%0A%7B%0A%09lpspi_master_config_t%20userConfig%3B%0A%09uint32_t%20srcFreq%20%3D%200%3B%0A%09if((pDataParams%20%3D%3D%20NULL)%20%7C%7C%20(sizeof(phbalReg_Type_t)%20!%3D%20wSizeOfDataParams))%0A%09%7B%0A%09return%20(PH_DRIVER_ERROR%20%7C%20PH_COMP_DRIVER)%3B%0A%09%7D%0A%09((phbalReg_Type_t%20*)pDataParams)-%26gt%3BwId%20%3D%20PH_COMP_DRIVER%20%7C%20PHBAL_REG_MCXN947_SPI_ID%3B%0A%09((phbalReg_Type_t%20*)pDataParams)-%26gt%3BbBalType%20%3D%20PHBAL_REG_TYPE_SPI%3B%0A%09%2F*Initialize%20Flexcomm1%20clock*%2F%0A%09%2F*%20attach%20FRO%2012M%20to%20FLEXCOMM1%20*%2F%0A%09CLOCK_SetClkDiv(PHDRIVER_FC1_SPI_DIV%2C%201u)%3B%0A%09CLOCK_AttachClk(PHDRIVER_FC1_SPI_CLK)%3B%0A%09%2F*Configure%20SPI%20pins*%2F%0A%09phbalReg_Mcxn947SpiConfig()%3B%0A%09%2F*SPI%20configuration*%2F%0A%09LPSPI_MasterGetDefaultConfig(%26amp%3BuserConfig)%3B%0A%09userConfig.baudRate%20%3D%20PHDRIVER_MCXN947_SPI_DATA_RATE%3B%0A%09srcFreq%20%3D%20SPI_MASTER_CLOCK_FREQ%3B%0A%09userConfig.whichPcs%20%3D%20(lpspi_which_pcs_t)kLPSPI_Pcs0%3B%0A%09userConfig.pcsActiveHighOrLow%20%3D%20(lpspi_pcs_polarity_config_t)kLPSPI_PcsActiveLow%3B%0A%09userConfig.pcsToSckDelayInNanoSec%20%20%20%20%20%20%20%20%3D%201000000000U%20%2F%20(userConfig.baudRate%20*%201U)%3B%0A%09userConfig.lastSckToPcsDelayInNanoSec%20%20%20%20%3D%201000000000U%20%2F%20(userConfig.baudRate%20*%201U)%3B%0A%09userConfig.betweenTransferDelayInNanoSec%20%3D%201000000000U%20%2F%20(userConfig.baudRate%20*%201U)%3B%0A%0A%09%2F*Initialize%20SPI*%2F%0A%23ifdef%20PHDRIVER_MCXN947_SPI_POLLING%0A%09LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3BuserConfig%2C%20srcFreq)%3B%0A%23else%0A%09LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3BuserConfig%2C%20srcFreq)%3B%0A%20%20%20%20LPSPI_MasterTransferCreateHandle(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3Bg_masterHandle%2C%20LPSPI_MasterUserCallback%2C%20NULL)%3B%0A%23endif%0A%09return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%2F**%0A*%20%5Cbrief%20Initialize%20the%20Rw612%20SPI%20BAL%20layer.%0A*%0A*%20%5Creturn%20Status%20code%0A*%20%5Cretval%20%23PH_DRIVER_SUCCESS%20Operation%20successful.%0A*%20%5Cretval%20%23PH_ERR_INVALID_DATA_PARAMS%20Parameter%20structure%20size%20is%20invalid.%0A*%2F%0A%0AphStatus_t%20phbalReg_Init(%20void%20*%20pDataParams%2C%20uint16_t%20wSizeOfDataParams)%0A%7B%0A%09lpspi_master_config_t%20userConfig%3B%0A%09uint32_t%20srcFreq%20%3D%200%3B%0A%09if((pDataParams%20%3D%3D%20NULL)%20%7C%7C%20(sizeof(phbalReg_Type_t)%20!%3D%20wSizeOfDataParams))%0A%09%7B%0A%09return%20(PH_DRIVER_ERROR%20%7C%20PH_COMP_DRIVER)%3B%0A%09%7D%0A%09((phbalReg_Type_t%20*)pDataParams)-%26gt%3BwId%20%3D%20PH_COMP_DRIVER%20%7C%20PHBAL_REG_MCXN947_SPI_ID%3B%0A%09((phbalReg_Type_t%20*)pDataParams)-%26gt%3BbBalType%20%3D%20PHBAL_REG_TYPE_SPI%3B%0A%09%2F*Initialize%20Flexcomm1%20clock*%2F%0A%09%2F*%20attach%20FRO%2012M%20to%20FLEXCOMM1%20*%2F%0A%09CLOCK_SetClkDiv(PHDRIVER_FC1_SPI_DIV%2C%201u)%3B%0A%09CLOCK_AttachClk(PHDRIVER_FC1_SPI_CLK)%3B%0A%09%2F*Configure%20SPI%20pins*%2F%0A%09phbalReg_Mcxn947SpiConfig()%3B%0A%09%2F*SPI%20configuration*%2F%0A%09LPSPI_MasterGetDefaultConfig(%26amp%3BuserConfig)%3B%0A%09userConfig.baudRate%20%3D%20PHDRIVER_MCXN947_SPI_DATA_RATE%3B%0A%09srcFreq%20%3D%20SPI_MASTER_CLOCK_FREQ%3B%0A%09userConfig.whichPcs%20%3D%20(lpspi_which_pcs_t)kLPSPI_Pcs0%3B%0A%09userConfig.pcsActiveHighOrLow%20%3D%20(lpspi_pcs_polarity_config_t)kLPSPI_PcsActiveLow%3B%0A%09userConfig.pcsToSckDelayInNanoSec%20%20%20%20%20%20%20%20%3D%201000000000U%20%2F%20(userConfig.baudRate%20*%201U)%3B%0A%09userConfig.lastSckToPcsDelayInNanoSec%20%20%20%20%3D%201000000000U%20%2F%20(userConfig.baudRate%20*%201U)%3B%0A%09userConfig.betweenTransferDelayInNanoSec%20%3D%201000000000U%20%2F%20(userConfig.baudRate%20*%201U)%3B%0A%0A%09%2F*Initialize%20SPI*%2F%0A%23ifdef%20PHDRIVER_MCXN947_SPI_POLLING%0A%09LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3BuserConfig%2C%20srcFreq)%3B%0A%23else%0A%09LPSPI_MasterInit(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3BuserConfig%2C%20srcFreq)%3B%0A%20%20%20%20LPSPI_MasterTransferCreateHandle(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3Bg_masterHandle%2C%20LPSPI_MasterUserCallback%2C%20NULL)%3B%0A%23endif%0A%09return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EWe%20have%20to%20define%20the%20phbalReg_Exchange%20function%20as%20well%2C%20which%20is%20used%20for%20communicating%20via%20SPI%20with%20the%20PN5190.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1782506250553.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1782506250553.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390434i625306CBE18FD515%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1782506250553.png%22%20alt%3D%22Habib_MS_3-1782506250553.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1782506250553.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_4-1782506278106.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_4-1782506278106.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390435i195F690F16B29280%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Habib_MS_4-1782506278106.png%22%20alt%3D%22Habib_MS_4-1782506278106.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_4-1782506278106.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EphStatus_t%20phbalReg_Exchange(%0A%09%09%09%09void%20*%20pDataParams%2C%0A%09%09%09%09uint16_t%20wOption%2C%0A%09%09%09%09uint8_t%20*%20pTxBuffer%2C%0A%09%09%09%09uint16_t%20wTxLength%2C%0A%09%09%09%09uint16_t%20wRxBufSize%2C%0A%09%09%09%09uint8_t%20*%20pRxBuffer%2C%0A%09%09%09%09uint16_t%20*%20pRxLength%0A%09%09%09%09)%0A%7B%0A%20%20%20%20phStatus_t%20status%20%3D%20PH_DRIVER_SUCCESS%3B%0A%20%20%20%20uint8_t%20*%20pRxBuf%3B%0A%20%20%20%20status_t%20lpspiStatus%3B%0A%20%20%20%20lpspi_transfer_t%20g_masterXfer%3B%0A%20%20%20%20uint8_t%20g_dummyBuffer%5BRX_BUFFER_SIZE_MAX%5D%3B%0A%20%20%20%20if(pRxBuffer%20%3D%3D%20NULL)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20pRxBuf%20%3D%20g_dummyBuffer%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20pRxBuf%20%3D%20pRxBuffer%3B%0A%20%20%20%20%7D%0A%20%20%20%20if(pTxBuffer%20%3D%3D%20NULL)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wTxLength%20%3D%20wRxBufSize%3B%0A%20%20%20%20%20%20%20%20g_dummyBuffer%5B0%5D%20%3D%200xFF%3B%0A%20%20%20%20%20%20%20%20pTxBuffer%20%3D%20g_dummyBuffer%3B%0A%20%20%20%20%7D%0A%20%20%20%20memset(%26amp%3Bg_masterXfer%2C%200%2C%20sizeof(lpspi_transfer_t))%3B%0A%20%20%20%20%2F*%20Set%20up%20the%20transfer%20*%2F%0A%20%20%20%20g_masterXfer.txData%20%3D%20pTxBuffer%3B%0A%20%20%20%20g_masterXfer.rxData%20%3D%20pRxBuf%3B%0A%20%20%20%20g_masterXfer.dataSize%20%3D%20wTxLength%3B%0A%20%20%20%20g_masterXfer.configFlags%20%3D%20kLPSPI_MasterPcs0%20%7C%20kLPSPI_MasterPcsContinuous%20%7C%20kLPSPI_MasterByteSwap%3B%0A%20%20%20%20%2F*%20Start%20transfer%20*%2F%0A%23ifdef%20PHDRIVER_MCXN947_SPI_POLLING%0A%20%20%20%20lpspiStatus%20%3D%20LPSPI_MasterTransferBlocking(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3Bg_masterXfer)%3B%0A%23else%0A%20%20%20%20lpspiStatus%20%3D%20LPSPI_MasterTransferNonBlocking(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3Bg_masterHandle%2C%20%26amp%3Bg_masterXfer)%3B%0A%20%20%20%20%2F*%20Wait%20transfer%20complete%20*%2F%0A%20%20%20%20while%20(!isTransferCompleted)%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%23endif%0A%20%20%20%20if%20(lpspiStatus%20!%3D%20kStatus_Success)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20return%20(PH_DRIVER_FAILURE%20%7C%20PH_COMP_DRIVER)%3B%0A%20%20%20%20%7D%0A%20%20%20%20if%20(pRxLength%20!%3D%20NULL)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20*pRxLength%20%3D%20wTxLength%3B%0A%20%20%20%20%7D%0A%23ifndef%20PHDRIVER_MCXN947_SPI_POLLING%0A%20%20%20%20SDK_DelayAtLeastUs(300U%2C%20BOARD_BOOTCLOCKPLL150M_CORE_CLOCK)%3B%0A%23endif%0A%20%20%20%20return%20status%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3EphStatus_t%20phbalReg_Exchange(%0A%09%09%09%09void%20*%20pDataParams%2C%0A%09%09%09%09uint16_t%20wOption%2C%0A%09%09%09%09uint8_t%20*%20pTxBuffer%2C%0A%09%09%09%09uint16_t%20wTxLength%2C%0A%09%09%09%09uint16_t%20wRxBufSize%2C%0A%09%09%09%09uint8_t%20*%20pRxBuffer%2C%0A%09%09%09%09uint16_t%20*%20pRxLength%0A%09%09%09%09)%0A%7B%0A%20%20%20%20phStatus_t%20status%20%3D%20PH_DRIVER_SUCCESS%3B%0A%20%20%20%20uint8_t%20*%20pRxBuf%3B%0A%20%20%20%20status_t%20lpspiStatus%3B%0A%20%20%20%20lpspi_transfer_t%20g_masterXfer%3B%0A%20%20%20%20uint8_t%20g_dummyBuffer%5BRX_BUFFER_SIZE_MAX%5D%3B%0A%20%20%20%20if(pRxBuffer%20%3D%3D%20NULL)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20pRxBuf%20%3D%20g_dummyBuffer%3B%0A%20%20%20%20%7D%0A%20%20%20%20else%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20pRxBuf%20%3D%20pRxBuffer%3B%0A%20%20%20%20%7D%0A%20%20%20%20if(pTxBuffer%20%3D%3D%20NULL)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20wTxLength%20%3D%20wRxBufSize%3B%0A%20%20%20%20%20%20%20%20g_dummyBuffer%5B0%5D%20%3D%200xFF%3B%0A%20%20%20%20%20%20%20%20pTxBuffer%20%3D%20g_dummyBuffer%3B%0A%20%20%20%20%7D%0A%20%20%20%20memset(%26amp%3Bg_masterXfer%2C%200%2C%20sizeof(lpspi_transfer_t))%3B%0A%20%20%20%20%2F*%20Set%20up%20the%20transfer%20*%2F%0A%20%20%20%20g_masterXfer.txData%20%3D%20pTxBuffer%3B%0A%20%20%20%20g_masterXfer.rxData%20%3D%20pRxBuf%3B%0A%20%20%20%20g_masterXfer.dataSize%20%3D%20wTxLength%3B%0A%20%20%20%20g_masterXfer.configFlags%20%3D%20kLPSPI_MasterPcs0%20%7C%20kLPSPI_MasterPcsContinuous%20%7C%20kLPSPI_MasterByteSwap%3B%0A%20%20%20%20%2F*%20Start%20transfer%20*%2F%0A%23ifdef%20PHDRIVER_MCXN947_SPI_POLLING%0A%20%20%20%20lpspiStatus%20%3D%20LPSPI_MasterTransferBlocking(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3Bg_masterXfer)%3B%0A%23else%0A%20%20%20%20lpspiStatus%20%3D%20LPSPI_MasterTransferNonBlocking(PHDRIVER_MCXN947_SPI_MASTER%2C%20%26amp%3Bg_masterHandle%2C%20%26amp%3Bg_masterXfer)%3B%0A%20%20%20%20%2F*%20Wait%20transfer%20complete%20*%2F%0A%20%20%20%20while%20(!isTransferCompleted)%0A%20%20%20%20%7B%0A%20%20%20%20%7D%0A%23endif%0A%20%20%20%20if%20(lpspiStatus%20!%3D%20kStatus_Success)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20return%20(PH_DRIVER_FAILURE%20%7C%20PH_COMP_DRIVER)%3B%0A%20%20%20%20%7D%0A%20%20%20%20if%20(pRxLength%20!%3D%20NULL)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20*pRxLength%20%3D%20wTxLength%3B%0A%20%20%20%20%7D%0A%23ifndef%20PHDRIVER_MCXN947_SPI_POLLING%0A%20%20%20%20SDK_DelayAtLeastUs(300U%2C%20BOARD_BOOTCLOCKPLL150M_CORE_CLOCK)%3B%0A%23endif%0A%20%20%20%20return%20status%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EFinally%2C%20we%20will%20define%20the%20phbalReg_Mcxn947SpiConfig%20function%2C%20which%20is%20called%20by%20phbalReg_Init%20to%20configure%20the%20SPI%20pins%20on%20the%20MCXN947%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_5-1782506335570.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_5-1782506335570.png%22%20style%3D%22width%3A%20642px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390436iABC45260C676E477%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_5-1782506335570.png%22%20alt%3D%22Habib_MS_5-1782506335570.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_5-1782506335570.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Estatic%20void%20phbalReg_Mcxn947SpiConfig(void)%0A%7B%0A%20%20%20%20const%20port_pin_config_t%20port0_24_pinB6_config%20%3D%20%7B%0AkPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_SlowSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC1_P0%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_24%20(pin%20B6)%20is%20configured%20as%20SPI_MOSI%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2024U%2C%20%26amp%3Bport0_24_pinB6_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_25_pinA6_config%20%3D%20%7B%0AkPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_SlowSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC1_P1%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_25%20(pin%20A6)%20is%20configured%20as%20SPI_SCK%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2025U%2C%20%26amp%3Bport0_25_pinA6_config)%3B%0Aconst%20port_pin_config_t%20port0_26_pinF10_config%20%3D%20%7B%0AkPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_SlowSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC1_P2%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_26%20(pin%20F10)%20is%20configured%20as%20SPI_MISO%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2026U%2C%20%26amp%3Bport0_26_pinF10_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_27_pinE10_config%20%3D%20%7B%0AkPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_SlowSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC1_P3%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_27%20(pin%20E10)%20is%20configured%20as%20SPI_CS%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2027U%2C%20%26amp%3Bport0_27_pinE10_config)%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Estatic%20void%20phbalReg_Mcxn947SpiConfig(void)%0A%7B%0A%20%20%20%20const%20port_pin_config_t%20port0_24_pinB6_config%20%3D%20%7B%0AkPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_SlowSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC1_P0%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_24%20(pin%20B6)%20is%20configured%20as%20SPI_MOSI%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2024U%2C%20%26amp%3Bport0_24_pinB6_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_25_pinA6_config%20%3D%20%7B%0AkPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_SlowSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC1_P1%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_25%20(pin%20A6)%20is%20configured%20as%20SPI_SCK%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2025U%2C%20%26amp%3Bport0_25_pinA6_config)%3B%0Aconst%20port_pin_config_t%20port0_26_pinF10_config%20%3D%20%7B%0AkPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_SlowSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC1_P2%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_26%20(pin%20F10)%20is%20configured%20as%20SPI_MISO%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2026U%2C%20%26amp%3Bport0_26_pinF10_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_27_pinE10_config%20%3D%20%7B%0AkPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_SlowSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC1_P3%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_27%20(pin%20E10)%20is%20configured%20as%20SPI_CS%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2027U%2C%20%26amp%3Bport0_27_pinE10_config)%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH4%20id%3D%22toc-hId--1681639057%22%20id%3D%22toc-hId--1680746204%22%3EphDriver_Mcxn947SDK.c%3A%3C%2FH4%3E%0A%3CP%3EIn%20this%20file%20we%20will%20have%20the%20following%20definitions%20and%20includes%20that%20describe%20relevant%20characteristics%20of%20the%20ctimer%20(configuration%20structures%2C%20interrupt%20handlers%20and%20maximum%20count%20value)%2C%20and%20of%20the%20GPIO%20port%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1782506665356.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1782506665356.png%22%20style%3D%22width%3A%20815px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390438i070E13AC4CAC9BF0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1782506665356.png%22%20alt%3D%22Habib_MS_1-1782506665356.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1782506665356.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23include%20%22phDriver.h%22%0A%23include%20%22BoardSelection.h%22%0A%23include%20%22fsl_device_registers.h%22%0A%23include%20%3CFSL_GPIO.H%3E%0A%23include%20%3CFSL_CTIMER.H%3E%0A%2F*%20***********************************************************************************************************%0A*%20Internal%20Definitions%0A*%20**********************************************************************************************************%20*%2F%0A%23define%20MCXN947_TIMER_MAX_32BIT%200xFFFFFFFFU%0A%23define%20CTIMER_HANDLER%20CTIMER0_IRQHandler%0A%2F*%20***********************************************************************************************************%0A%20*%20*%20Type%20Definitions%0A***********************************************************************************************************%20*%2F%0Avolatile%20bool%20ctimerIsrFlag%20%3D%20false%3B%0A%2F*%20***********************************************************************************************************%0A*%20Global%20and%20Static%20Variables%0A*%0A*%20Match%20Configuration%20for%20CTIMER%20Channel%200*%2F%0Astatic%20ctimer_match_config_t%20matchConfig0%3B%0A%2F*%20Total%20Size%3A%20NNNbytes%0A*%20**********************************************************************************************************%20*%2F%0A%2F*%20Array%20initializer%20of%20GPIO%20peripheral%20base%20pointers%20*%2F%0Astatic%20const%20GPIO_Type%20*pGpiosBaseAddr%5B%5D%20%3D%20GPIO_BASE_PTRS%3B%0A%0Astatic%20pphDriver_TimerCallBck_t%20pCTimerCallBack%3B%0Astatic%20volatile%20uint8_t%20dwTimerExp%3B%0A%0Astatic%20const%20gpio_interrupt_config_t%20aInterruptTypes%5B%5D%20%3D%20%7BkGPIO_InterruptLogicZero%2C%20%2F*%20Unused.%20*%2F%0A%20%20%20%20%20%20%20%20kGPIO_InterruptLogicZero%2C%0A%20%20%20%20%20%20%20%20kGPIO_InterruptLogicOne%2C%0A%20%20%20%20%20%20%20%20kGPIO_InterruptRisingEdge%2C%0A%20%20%20%20%20%20%20%20kGPIO_InterruptFallingEdge%2C%0A%20%20%20%20%20%20%20%20kGPIO_InterruptEitherEdge%2C%0A%7D%3B%0A%2F*%20***********************************************************************************************************%0A*%20Private%20Functions%20Prototypes%0A*%20**********************************************************************************************************%20*%2F%0Astatic%20void%20phDriver_CTimerIsrCallBack(void)%3B%0A%3C%2FFSL_CTIMER.H%3E%3C%2FFSL_GPIO.H%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23include%20%22phDriver.h%22%0A%23include%20%22BoardSelection.h%22%0A%23include%20%22fsl_device_registers.h%22%0A%23include%20%3CFSL_GPIO.H%3E%0A%23include%20%3CFSL_CTIMER.H%3E%0A%2F*%20***********************************************************************************************************%0A*%20Internal%20Definitions%0A*%20**********************************************************************************************************%20*%2F%0A%23define%20MCXN947_TIMER_MAX_32BIT%200xFFFFFFFFU%0A%23define%20CTIMER_HANDLER%20CTIMER0_IRQHandler%0A%2F*%20***********************************************************************************************************%0A%20*%20*%20Type%20Definitions%0A***********************************************************************************************************%20*%2F%0Avolatile%20bool%20ctimerIsrFlag%20%3D%20false%3B%0A%2F*%20***********************************************************************************************************%0A*%20Global%20and%20Static%20Variables%0A*%0A*%20Match%20Configuration%20for%20CTIMER%20Channel%200*%2F%0Astatic%20ctimer_match_config_t%20matchConfig0%3B%0A%2F*%20Total%20Size%3A%20NNNbytes%0A*%20**********************************************************************************************************%20*%2F%0A%2F*%20Array%20initializer%20of%20GPIO%20peripheral%20base%20pointers%20*%2F%0Astatic%20const%20GPIO_Type%20*pGpiosBaseAddr%5B%5D%20%3D%20GPIO_BASE_PTRS%3B%0A%0Astatic%20pphDriver_TimerCallBck_t%20pCTimerCallBack%3B%0Astatic%20volatile%20uint8_t%20dwTimerExp%3B%0A%0Astatic%20const%20gpio_interrupt_config_t%20aInterruptTypes%5B%5D%20%3D%20%7BkGPIO_InterruptLogicZero%2C%20%2F*%20Unused.%20*%2F%0A%20%20%20%20%20%20%20%20kGPIO_InterruptLogicZero%2C%0A%20%20%20%20%20%20%20%20kGPIO_InterruptLogicOne%2C%0A%20%20%20%20%20%20%20%20kGPIO_InterruptRisingEdge%2C%0A%20%20%20%20%20%20%20%20kGPIO_InterruptFallingEdge%2C%0A%20%20%20%20%20%20%20%20kGPIO_InterruptEitherEdge%2C%0A%7D%3B%0A%2F*%20***********************************************************************************************************%0A*%20Private%20Functions%20Prototypes%0A*%20**********************************************************************************************************%20*%2F%0Astatic%20void%20phDriver_CTimerIsrCallBack(void)%3B%0A%3C%2FFSL_CTIMER.H%3E%3C%2FFSL_GPIO.H%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EWe%20will%20define%20the%20following%20functions%20to%20initialize%20and%20stop%20the%20timer%2C%20and%20to%20enable%20timer%20interruptions%20and%20its%20callback%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1782506722983.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1782506722983.png%22%20style%3D%22width%3A%20640px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390439iF4617BB58F06391F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1782506722983.png%22%20alt%3D%22Habib_MS_2-1782506722983.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1782506722983.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1782506736273.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1782506736273.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390440i68E47758388A7E1E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1782506736273.png%22%20alt%3D%22Habib_MS_3-1782506736273.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1782506736273.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EphStatus_t%20phDriver_TimerStart(phDriver_Timer_Unit_t%20eTimerUnit%2C%20uint32_t%20dwTimePeriod%2C%0ApphDriver_TimerCallBck_t%20pTimerCallBack)%0A%7B%0A%09uint64_t%20qwTimerCnt%3B%0A%09uint32_t%20dwTimerFreq%3B%0A%0A%09dwTimerFreq%20%3D%20PH_DRIVER_SDK_CTIMER_CLK_FREQ%3B%0A%0A%09qwTimerCnt%20%3D%20dwTimerFreq%3B%0A%09qwTimerCnt%20%3D%20(qwTimerCnt%20%2F%20eTimerUnit)%3B%0A%09qwTimerCnt%20%3D%20(dwTimePeriod%20*%20qwTimerCnt)%3B%0A%09%2F*%2032-bit%20timers.%20*%2F%0A%09if(qwTimerCnt%20%26gt%3B%20(uint64_t)MCXN947_TIMER_MAX_32BIT)%0A%09%7B%0A%09%09return%20PH_DRIVER_ERROR%20%7C%20PH_COMP_DRIVER%3B%0A%09%7D%0A%09if(pTimerCallBack%20%3D%3D%20NULL)%20%2F*%20Timer%20Start%20is%20blocking%20call.%20*%2F%0A%09%7B%0A%09%09dwTimerExp%20%3D%200%3B%0A%09%09pCTimerCallBack%20%3D%20phDriver_CTimerIsrCallBack%3B%0A%09%7D%0A%09else%20%2F*%20Call%20the%20Timer%20callback.%20*%2F%0A%09%7B%0A%09%09pCTimerCallBack%20%3D%20pTimerCallBack%3B%0A%09%7D%0A%09%2F*Configure%20%26amp%3B%20start%20CTIMER*%2F%0A%09%2F*Ctimer%20config%20structure*%2F%0A%09ctimer_config_t%20config%3B%0A%0A%09%2F*Timer%20mode%2C%20init*%2F%0A%09CTIMER_GetDefaultConfig(%26amp%3Bconfig)%3B%0A%09CTIMER_Init(PH_DRIVER_SDK_CTIMER%2C%20%26amp%3Bconfig)%3B%0A%09CTIMER_EnableInterrupts(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match0InterruptEnable%7CkCTIMER_Capture0InterruptEnable)%3B%0A%09%2F*%20Configuration%20match%200%20*%2F%0A%09matchConfig0.enableCounterReset%20%3D%20true%3B%0A%09matchConfig0.enableCounterStop%20%09%3D%20false%3B%0A%09matchConfig0.matchValue%20%09%20%09%3D%20(uint32_t)qwTimerCnt%3B%0A%09matchConfig0.outControl%20%09%09%3D%20kCTIMER_Output_NoAction%3B%0A%09matchConfig0.outPinInitState%20%09%3D%20false%3B%0A%09matchConfig0.enableInterrupt%20%09%3D%20true%3B%0A%0A%09EnableIRQ(PH_DRIVER_SDK_CTIMER_NVIC)%3B%0A%09NVIC_SetPriority(PH_DRIVER_SDK_CTIMER_NVIC%2C%20PH_DRIVER_SDK_CTIMER_PRIORITY)%3B%0A%09%2F*Setup%20Match*%2F%0A%09CTIMER_SetupMatch(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match_0%2C%20%26amp%3BmatchConfig0)%3B%0A%09%2F*Start*%2F%0A%09CTIMER_StartTimer(PH_DRIVER_SDK_CTIMER)%3B%0Awhile%20(true)%0A%09%7B%0A%09%09%2F*%20Check%20whether%20an%20interrupt%20occurred%20*%2F%0A%09%09if%20(true%20%3D%3D%20ctimerIsrFlag%20%26amp%3B%26amp%3B%20dwTimerExp)%0A%09%09%7B%0A%09%09%09%2F*%20Clear%20interrupt%20flag*%2F%0A%09%09%09ctimerIsrFlag%20%3D%20false%3B%0A%09%09%09break%3B%0A%09%09%7D%0A%09%7D%0A%0A%09return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3EphStatus_t%20phDriver_TimerStart(phDriver_Timer_Unit_t%20eTimerUnit%2C%20uint32_t%20dwTimePeriod%2C%0ApphDriver_TimerCallBck_t%20pTimerCallBack)%0A%7B%0A%09uint64_t%20qwTimerCnt%3B%0A%09uint32_t%20dwTimerFreq%3B%0A%0A%09dwTimerFreq%20%3D%20PH_DRIVER_SDK_CTIMER_CLK_FREQ%3B%0A%0A%09qwTimerCnt%20%3D%20dwTimerFreq%3B%0A%09qwTimerCnt%20%3D%20(qwTimerCnt%20%2F%20eTimerUnit)%3B%0A%09qwTimerCnt%20%3D%20(dwTimePeriod%20*%20qwTimerCnt)%3B%0A%09%2F*%2032-bit%20timers.%20*%2F%0A%09if(qwTimerCnt%20%26gt%3B%20(uint64_t)MCXN947_TIMER_MAX_32BIT)%0A%09%7B%0A%09%09return%20PH_DRIVER_ERROR%20%7C%20PH_COMP_DRIVER%3B%0A%09%7D%0A%09if(pTimerCallBack%20%3D%3D%20NULL)%20%2F*%20Timer%20Start%20is%20blocking%20call.%20*%2F%0A%09%7B%0A%09%09dwTimerExp%20%3D%200%3B%0A%09%09pCTimerCallBack%20%3D%20phDriver_CTimerIsrCallBack%3B%0A%09%7D%0A%09else%20%2F*%20Call%20the%20Timer%20callback.%20*%2F%0A%09%7B%0A%09%09pCTimerCallBack%20%3D%20pTimerCallBack%3B%0A%09%7D%0A%09%2F*Configure%20%26amp%3B%20start%20CTIMER*%2F%0A%09%2F*Ctimer%20config%20structure*%2F%0A%09ctimer_config_t%20config%3B%0A%0A%09%2F*Timer%20mode%2C%20init*%2F%0A%09CTIMER_GetDefaultConfig(%26amp%3Bconfig)%3B%0A%09CTIMER_Init(PH_DRIVER_SDK_CTIMER%2C%20%26amp%3Bconfig)%3B%0A%09CTIMER_EnableInterrupts(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match0InterruptEnable%7CkCTIMER_Capture0InterruptEnable)%3B%0A%09%2F*%20Configuration%20match%200%20*%2F%0A%09matchConfig0.enableCounterReset%20%3D%20true%3B%0A%09matchConfig0.enableCounterStop%20%09%3D%20false%3B%0A%09matchConfig0.matchValue%20%09%20%09%3D%20(uint32_t)qwTimerCnt%3B%0A%09matchConfig0.outControl%20%09%09%3D%20kCTIMER_Output_NoAction%3B%0A%09matchConfig0.outPinInitState%20%09%3D%20false%3B%0A%09matchConfig0.enableInterrupt%20%09%3D%20true%3B%0A%0A%09EnableIRQ(PH_DRIVER_SDK_CTIMER_NVIC)%3B%0A%09NVIC_SetPriority(PH_DRIVER_SDK_CTIMER_NVIC%2C%20PH_DRIVER_SDK_CTIMER_PRIORITY)%3B%0A%09%2F*Setup%20Match*%2F%0A%09CTIMER_SetupMatch(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match_0%2C%20%26amp%3BmatchConfig0)%3B%0A%09%2F*Start*%2F%0A%09CTIMER_StartTimer(PH_DRIVER_SDK_CTIMER)%3B%0Awhile%20(true)%0A%09%7B%0A%09%09%2F*%20Check%20whether%20an%20interrupt%20occurred%20*%2F%0A%09%09if%20(true%20%3D%3D%20ctimerIsrFlag%20%26amp%3B%26amp%3B%20dwTimerExp)%0A%09%09%7B%0A%09%09%09%2F*%20Clear%20interrupt%20flag*%2F%0A%09%09%09ctimerIsrFlag%20%3D%20false%3B%0A%09%09%09break%3B%0A%09%09%7D%0A%09%7D%0A%0A%09return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_4-1782506821715.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_4-1782506821715.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390441i27CFC560989571C7%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_4-1782506821715.png%22%20alt%3D%22Habib_MS_4-1782506821715.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_4-1782506821715.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EphStatus_t%20phDriver_TimerStop(void)%0A%7B%0A%09%2F*Stop%20timer%20%26amp%3B%20disable%20interrupts*%2F%0A%09CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER)%3B%0A%09CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match0InterruptEnable%7CkCTIMER_Capture0InterruptEnable)%3B%0A%0A%09%2F*%20Disable%20at%20the%20NVIC%20*%2F%0A%09DisableIRQ(PH_DRIVER_SDK_CTIMER_NVIC)%3B%0A%0A%09return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3EphStatus_t%20phDriver_TimerStop(void)%0A%7B%0A%09%2F*Stop%20timer%20%26amp%3B%20disable%20interrupts*%2F%0A%09CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER)%3B%0A%09CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match0InterruptEnable%7CkCTIMER_Capture0InterruptEnable)%3B%0A%0A%09%2F*%20Disable%20at%20the%20NVIC%20*%2F%0A%09DisableIRQ(PH_DRIVER_SDK_CTIMER_NVIC)%3B%0A%0A%09return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EWe%20will%20also%20have%20definitions%20for%20the%20functions%20that%20configure%20and%20handle%20GPIOs%20of%20the%20MCXN947%20and%20enable%20interruptions.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_4-1784224063232.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_4-1784224063232.png%22%20style%3D%22width%3A%20976px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392510i5684CEE4773142C8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_4-1784224063232.png%22%20alt%3D%22Habib_MS_4-1784224063232.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_4-1784224063232.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3EphStatus_t%20phDriver_PinConfig(uint32_t%20dwPinNumber%2C%20phDriver_Pin_Func_t%20ePinFunc%2C%20phDriver_Pin_Config_t%20*pPinConfig)%0A%7B%0A%09gpio_pin_config_t%20sGpioConfig%3B%0A%09uint8_t%20bPinNum%3B%0A%0A%09if((ePinFunc%20%3D%3D%20PH_DRIVER_PINFUNC_BIDIR)%20%7C%7C%20(pPinConfig%20%3D%3D%20NULL))%0A%09%7B%0A%09%09return%20PH_DRIVER_ERROR%20%7C%20PH_COMP_DRIVER%3B%0A%09%7D%0A%09%2F*%20Extract%20the%20Pin%2C%20Gpio%2C%20Port%20details%20from%20dwPinNumber%20*%2F%0A%09bPinNum%20%3D%20(uint8_t)(dwPinNumber%20%26amp%3B%200xFF)%3B%0A%0A%09sGpioConfig.pinDirection%20%3D%20(ePinFunc%20%3D%3D%20PH_DRIVER_PINFUNC_OUTPUT)%20%3F%20kGPIO_DigitalOutput%3AkGPIO_DigitalInput%3B%0A%09sGpioConfig.outputLogic%20%3D%20pPinConfig-%26gt%3BbOutputLogic%3B%0A%0A%09if(ePinFunc%20%3D%3D%20PH_DRIVER_PINFUNC_INTERRUPT)%0A%09%7B%0A%09%09gpio_interrupt_config_t%20intConfig%20%3D%20aInterruptTypes%5B(uint8_t)pPinConfig-%26gt%3BeInterruptConfig%5D%3B%0A%0A%09%09GPIO_GpioClearInterruptFlags((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum)%3B%0A%09%09GPIO_SetPinInterruptConfig((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum%2C%20intConfig)%3B%0A%09%09EnableIRQ(EINT_IRQn)%3B%0A%0A%09%09GPIO_PinInit((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2CbPinNum%2C%26amp%3BsGpioConfig)%3B%0A%09%7D%0A%09else%0A%09%7B%0A%09%09GPIO_PinInit((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2CbPinNum%2C%26amp%3BsGpioConfig)%3B%0A%09%7D%0A%0A%09return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3EphStatus_t%20phDriver_PinConfig(uint32_t%20dwPinNumber%2C%20phDriver_Pin_Func_t%20ePinFunc%2C%20phDriver_Pin_Config_t%20*pPinConfig)%0A%7B%0A%09gpio_pin_config_t%20sGpioConfig%3B%0A%09uint8_t%20bPinNum%3B%0A%0A%09if((ePinFunc%20%3D%3D%20PH_DRIVER_PINFUNC_BIDIR)%20%7C%7C%20(pPinConfig%20%3D%3D%20NULL))%0A%09%7B%0A%09%09return%20PH_DRIVER_ERROR%20%7C%20PH_COMP_DRIVER%3B%0A%09%7D%0A%09%2F*%20Extract%20the%20Pin%2C%20Gpio%2C%20Port%20details%20from%20dwPinNumber%20*%2F%0A%09bPinNum%20%3D%20(uint8_t)(dwPinNumber%20%26amp%3B%200xFF)%3B%0A%0A%09sGpioConfig.pinDirection%20%3D%20(ePinFunc%20%3D%3D%20PH_DRIVER_PINFUNC_OUTPUT)%20%3F%20kGPIO_DigitalOutput%3AkGPIO_DigitalInput%3B%0A%09sGpioConfig.outputLogic%20%3D%20pPinConfig-%26gt%3BbOutputLogic%3B%0A%0A%09if(ePinFunc%20%3D%3D%20PH_DRIVER_PINFUNC_INTERRUPT)%0A%09%7B%0A%09%09gpio_interrupt_config_t%20intConfig%20%3D%20aInterruptTypes%5B(uint8_t)pPinConfig-%26gt%3BeInterruptConfig%5D%3B%0A%0A%09%09GPIO_GpioClearInterruptFlags((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum)%3B%0A%09%09GPIO_SetPinInterruptConfig((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum%2C%20intConfig)%3B%0A%09%09EnableIRQ(EINT_IRQn)%3B%0A%0A%09%09GPIO_PinInit((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2CbPinNum%2C%26amp%3BsGpioConfig)%3B%0A%09%7D%0A%09else%0A%09%7B%0A%09%09GPIO_PinInit((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2CbPinNum%2C%26amp%3BsGpioConfig)%3B%0A%09%7D%0A%0A%09return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1784224025491.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1784224025491.png%22%20style%3D%22width%3A%20830px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392509i09D2D9B791547F1E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1784224025491.png%22%20alt%3D%22Habib_MS_3-1784224025491.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1784224025491.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Euint8_t%20phDriver_PinRead(uint32_t%20dwPinNumber%2C%20phDriver_Pin_Func_t%20ePinFunc)%0A%7B%0A%09uint8_t%20bValue%3B%0A%09uint32_t%20intStatus%3B%0A%09uint8_t%20bPinNum%3B%0A%0A%09%2F*%20Extract%20the%20Pin%2C%20Gpio%20details%20from%20dwPinNumber%20*%2F%0A%09bPinNum%20%3D%20(uint8_t)(dwPinNumber%20%26amp%3B%200xFF)%3B%0A%0A%09if(ePinFunc%20%3D%3D%20PH_DRIVER_PINFUNC_INTERRUPT)%0A%09%7B%0A%09%09%2F*Get%20value%20of%20pin%20interrupt%20status*%2F%0A%09%09intStatus%20%3D%20GPIO_PinGetInterruptFlag((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum)%3B%0A%09%09bValue%20%3D%20intStatus%20%3F%201%3A0%3B%0A%09%7D%0A%09else%0A%09%7B%0A%09%09%2F*Read%20pin%20value*%2F%0A%09%09bValue%20%3D%20(uint8_t)GPIO_PinRead((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum)%3B%0A%09%7D%0A%09return%20bValue%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Euint8_t%20phDriver_PinRead(uint32_t%20dwPinNumber%2C%20phDriver_Pin_Func_t%20ePinFunc)%0A%7B%0A%09uint8_t%20bValue%3B%0A%09uint32_t%20intStatus%3B%0A%09uint8_t%20bPinNum%3B%0A%0A%09%2F*%20Extract%20the%20Pin%2C%20Gpio%20details%20from%20dwPinNumber%20*%2F%0A%09bPinNum%20%3D%20(uint8_t)(dwPinNumber%20%26amp%3B%200xFF)%3B%0A%0A%09if(ePinFunc%20%3D%3D%20PH_DRIVER_PINFUNC_INTERRUPT)%0A%09%7B%0A%09%09%2F*Get%20value%20of%20pin%20interrupt%20status*%2F%0A%09%09intStatus%20%3D%20GPIO_PinGetInterruptFlag((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum)%3B%0A%09%09bValue%20%3D%20intStatus%20%3F%201%3A0%3B%0A%09%7D%0A%09else%0A%09%7B%0A%09%09%2F*Read%20pin%20value*%2F%0A%09%09bValue%20%3D%20(uint8_t)GPIO_PinRead((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum)%3B%0A%09%7D%0A%09return%20bValue%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1784223977410.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1784223977410.png%22%20style%3D%22width%3A%20647px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F392508i4CF32B9DDBC32087%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1784223977410.png%22%20alt%3D%22Habib_MS_2-1784223977410.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1784223977410.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Evoid%20phDriver_PinWrite(uint32_t%20dwPinNumber%2C%20uint8_t%20bValue)%0A%7B%0A%09uint8_t%20bPinNum%3B%0A%0A%09%2F*%20Extract%20the%20Pin%2C%20Gpio%20details%20from%20dwPinNumber%20*%2F%0A%09bPinNum%20%3D%20(uint8_t)(dwPinNumber%20%26amp%3B%200xFF)%3B%0A%0A%09GPIO_PinWrite((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum%2C%20bValue)%3B%0A%7D%0A%0Avoid%20phDriver_PinClearIntStatus(uint32_t%20dwPinNumber)%0A%7B%0A%09uint8_t%20bPinNum%3B%0A%0A%09%2F*%20Extract%20the%20Pin%2C%20Gpio%20details%20from%20dwPinNumber%20*%2F%0A%09bPinNum%20%3D%20(uint8_t)(dwPinNumber%20%26amp%3B%200xFF)%3B%0A%09%2F*Clear%20interrupt%20flag*%2F%0A%09GPIO_GpioClearInterruptFlags((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20(1U%20%26lt%3B%26lt%3B%20bPinNum))%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Evoid%20phDriver_PinWrite(uint32_t%20dwPinNumber%2C%20uint8_t%20bValue)%0A%7B%0A%09uint8_t%20bPinNum%3B%0A%0A%09%2F*%20Extract%20the%20Pin%2C%20Gpio%20details%20from%20dwPinNumber%20*%2F%0A%09bPinNum%20%3D%20(uint8_t)(dwPinNumber%20%26amp%3B%200xFF)%3B%0A%0A%09GPIO_PinWrite((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20bPinNum%2C%20bValue)%3B%0A%7D%0A%0Avoid%20phDriver_PinClearIntStatus(uint32_t%20dwPinNumber)%0A%7B%0A%09uint8_t%20bPinNum%3B%0A%0A%09%2F*%20Extract%20the%20Pin%2C%20Gpio%20details%20from%20dwPinNumber%20*%2F%0A%09bPinNum%20%3D%20(uint8_t)(dwPinNumber%20%26amp%3B%200xFF)%3B%0A%09%2F*Clear%20interrupt%20flag*%2F%0A%09GPIO_GpioClearInterruptFlags((GPIO_Type%20*)pGpiosBaseAddr%5BGPIO_PORT%5D%2C%20(1U%20%26lt%3B%26lt%3B%20bPinNum))%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EIt%20is%20also%20necessary%20to%20add%20functions%20required%20for%20the%20library%20to%20function%20correctly.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_8-1782506978124.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_8-1782506978124.png%22%20style%3D%22width%3A%20877px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390445i9BED7369B369ED9B%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_8-1782506978124.png%22%20alt%3D%22Habib_MS_8-1782506978124.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_8-1782506978124.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Evoid%20phDriver_EnterCriticalSection(void)%0A%7B%0A%20%20%20%20NVIC_DisableIRQ(EINT_IRQn)%3B%0A%7D%0A%0Avoid%20phDriver_ExitCriticalSection(void)%0A%7B%0A%09NVIC_EnableIRQ(EINT_IRQn)%3B%0A%7D%0A%0AphStatus_t%20phDriver_IRQPinRead(uint32_t%20dwPinNumber)%0A%7B%0A%09phStatus_t%20bGpioVal%20%3D%20false%3B%0A%0A%09bGpioVal%20%3D%20phDriver_PinRead(dwPinNumber%2C%20PH_DRIVER_PINFUNC_INPUT)%3B%0A%0A%09return%20bGpioVal%3B%0A%7D%0AphStatus_t%20phDriver_IRQPinPoll(uint32_t%20dwPinNumber%2C%20phDriver_Pin_Func_t%20ePinFunc%2C%20phDriver_Interrupt_Config_t%20eInterruptType)%0A%7B%0A%20%20%20%20uint8_t%20%20%20%20bGpioState%20%3D%200%3B%0A%0A%20%20%20%20if%20((eInterruptType%20!%3D%20PH_DRIVER_INTERRUPT_RISINGEDGE)%20%26amp%3B%26amp%3B%20(eInterruptType%20!%3D%20PH_DRIVER_INTERRUPT_FALLINGEDGE))%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20return%20PH_DRIVER_ERROR%20%7C%20PH_COMP_DRIVER%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20(eInterruptType%20%3D%3D%20PH_DRIVER_INTERRUPT_FALLINGEDGE)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20bGpioState%20%3D%201%3B%0A%20%20%20%20%7D%0A%0A%09while(phDriver_PinRead(dwPinNumber%2C%20ePinFunc)%20%3D%3D%20bGpioState)%3B%0A%0A%20%20%20%20return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Evoid%20phDriver_EnterCriticalSection(void)%0A%7B%0A%20%20%20%20NVIC_DisableIRQ(EINT_IRQn)%3B%0A%7D%0A%0Avoid%20phDriver_ExitCriticalSection(void)%0A%7B%0A%09NVIC_EnableIRQ(EINT_IRQn)%3B%0A%7D%0A%0AphStatus_t%20phDriver_IRQPinRead(uint32_t%20dwPinNumber)%0A%7B%0A%09phStatus_t%20bGpioVal%20%3D%20false%3B%0A%0A%09bGpioVal%20%3D%20phDriver_PinRead(dwPinNumber%2C%20PH_DRIVER_PINFUNC_INPUT)%3B%0A%0A%09return%20bGpioVal%3B%0A%7D%0AphStatus_t%20phDriver_IRQPinPoll(uint32_t%20dwPinNumber%2C%20phDriver_Pin_Func_t%20ePinFunc%2C%20phDriver_Interrupt_Config_t%20eInterruptType)%0A%7B%0A%20%20%20%20uint8_t%20%20%20%20bGpioState%20%3D%200%3B%0A%0A%20%20%20%20if%20((eInterruptType%20!%3D%20PH_DRIVER_INTERRUPT_RISINGEDGE)%20%26amp%3B%26amp%3B%20(eInterruptType%20!%3D%20PH_DRIVER_INTERRUPT_FALLINGEDGE))%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20return%20PH_DRIVER_ERROR%20%7C%20PH_COMP_DRIVER%3B%0A%20%20%20%20%7D%0A%0A%20%20%20%20if%20(eInterruptType%20%3D%3D%20PH_DRIVER_INTERRUPT_FALLINGEDGE)%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20bGpioState%20%3D%201%3B%0A%20%20%20%20%7D%0A%0A%09while(phDriver_PinRead(dwPinNumber%2C%20ePinFunc)%20%3D%3D%20bGpioState)%3B%0A%0A%20%20%20%20return%20PH_DRIVER_SUCCESS%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EFinally%2C%20here%2C%20we%20will%20have%20the%20definition%20of%20the%20timer%20interrupt%20handler%20and%20ISR%20callback.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_9-1782507031648.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_9-1782507031648.png%22%20style%3D%22width%3A%20700px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390446i0281D78BB1D41A81%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_9-1782507031648.png%22%20alt%3D%22Habib_MS_9-1782507031648.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_9-1782507031648.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Evoid%20CTIMER0_IRQHandler(void)%0A%7B%0A%09%2F*%20Clear%20interrupt%20flag.*%2F%0A%09CTIMER_ClearStatusFlags(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match0Flag%7CkCTIMER_Capture0Flag)%3B%0A%09%2F*%20Single%20shot%20timer.%20Stop%20it.%20*%2F%0A%09CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER)%3B%0A%09CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match0InterruptEnable%7CkCTIMER_Capture0InterruptEnable)%3B%0A%09pCTimerCallBack()%3B%0A%0A%09ctimerIsrFlag%20%3D%20true%3B%0A%7D%0A%0Astatic%20void%20phDriver_CTimerIsrCallBack(void)%0A%7B%0A%09dwTimerExp%20%3D%201%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Evoid%20CTIMER0_IRQHandler(void)%0A%7B%0A%09%2F*%20Clear%20interrupt%20flag.*%2F%0A%09CTIMER_ClearStatusFlags(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match0Flag%7CkCTIMER_Capture0Flag)%3B%0A%09%2F*%20Single%20shot%20timer.%20Stop%20it.%20*%2F%0A%09CTIMER_StopTimer(PH_DRIVER_SDK_CTIMER)%3B%0A%09CTIMER_DisableInterrupts(PH_DRIVER_SDK_CTIMER%2C%20kCTIMER_Match0InterruptEnable%7CkCTIMER_Capture0InterruptEnable)%3B%0A%09pCTimerCallBack()%3B%0A%0A%09ctimerIsrFlag%20%3D%20true%3B%0A%7D%0A%0Astatic%20void%20phDriver_CTimerIsrCallBack(void)%0A%7B%0A%09dwTimerExp%20%3D%201%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EWith%20these%20additions%2C%20we%20have%20all%20the%20functions%20needed%20(based%20on%20the%20FRDM-MCXN947%20SDK)%20by%20the%20library%20to%20communicate%20with%20the%20PN5190.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId-676791057%22%20id%3D%22toc-hId-677683910%22%3EBoardSelection.h%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIn%20this%20header%20file%2C%20which%20is%20found%20at%20%E2%80%9CDAL%20%26gt%3B%20cfg%E2%80%9D%20we%20will%20add%20the%20definition%20set%20in%20the%20preprocessor%20settings%20to%20use%20the%20FRDM-MCXN947%20board%20as%20host%20by%20adding%20the%20following%20lines%20to%20the%20file%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_10-1782507079841.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_10-1782507079841.png%22%20style%3D%22width%3A%20566px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390447i61D488E2D666E013%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_10-1782507079841.png%22%20alt%3D%22Habib_MS_10-1782507079841.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_10-1782507079841.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23ifdef%20PHDRIVER_FRDMMCXN947_PN5190_BOARD%0A%23%20%20%20%20include%20%3CBOARD_FRDM_MCXN947_PN5190.H%3E%0A%23endif%0A%3C%2FBOARD_FRDM_MCXN947_PN5190.H%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23ifdef%20PHDRIVER_FRDMMCXN947_PN5190_BOARD%0A%23%20%20%20%20include%20%3CBOARD_FRDM_MCXN947_PN5190.H%3E%0A%23endif%0A%3C%2FBOARD_FRDM_MCXN947_PN5190.H%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId--1130663406%22%20id%3D%22toc-hId--1129770553%22%3Eph_NxpBuild_App.h%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIn%20this%20header%20found%20at%20%E2%80%9Cintfs%E2%80%9D%20folder%2C%20we%20will%20add%20our%20board%20support%20to%20use%20it%20with%20the%20PN5190%20by%20adding%20the%20following%20change%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1782507715135.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1782507715135.png%22%20style%3D%22width%3A%20675px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390450iB2725BF1205A1D50%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1782507715135.png%22%20alt%3D%22Habib_MS_1-1782507715135.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1782507715135.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23if%20defined(PHDRIVER_LPC1769PN5190_BOARD)%20%5C%0A%20%20%20%20%7C%7C%20defined(PHDRIVER_K82F_PNEV5190B_BOARD)%5C%0A%09%7C%7C%20defined(PHDRIVER_FRDMMCXN947_PN5190_BOARD)%0A%23%20%20%20define%20NXPBUILD__PHHAL_HW_PN5190%0A%23endif%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23if%20defined(PHDRIVER_LPC1769PN5190_BOARD)%20%5C%0A%20%20%20%20%7C%7C%20defined(PHDRIVER_K82F_PNEV5190B_BOARD)%5C%0A%09%7C%7C%20defined(PHDRIVER_FRDMMCXN947_PN5190_BOARD)%0A%23%20%20%20define%20NXPBUILD__PHHAL_HW_PN5190%0A%23endif%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId-1356849427%22%20id%3D%22toc-hId-1357742280%22%3EphApp_Init.h%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EIn%20this%20header%20located%20at%20%E2%80%9Cintfs%E2%80%9D%20folder%20we%20will%20add%20the%20required%20include%20files%20for%20the%20initialization%20of%20our%20board%20and%20enable%20the%20correct%20debug%20interface.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1782507771262.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1782507771262.png%22%20style%3D%22width%3A%20490px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390451iCF9AFA11141273BA%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1782507771262.png%22%20alt%3D%22Habib_MS_2-1782507771262.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1782507771262.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%2F*Check%20for%20MCXN%20controller%20based%20boards*%2F%0A%23if%20defined%20(PHDRIVER_FRDMMCXN947_PN5190_BOARD)%0A%23define%20PHDRIVER_FRDM_MCXN947%0A%23endif%0A%0A%23ifdef%20PHDRIVER_FRDM_MCXN947%0A%23include%20%3CFSL_DEBUG_CONSOLE.H%3E%0A%23include%20%3CSTDIO.H%3E%0A%23include%20%3CFSL_GPIO.H%3E%0A%23include%20%3CFSL_CTIMER.H%3E%0A%23include%20%3CFSL_CLOCK.H%3E%0A%23include%20%3CFSL_LPSPI.H%3E%0A%23endif%0A%3C%2FFSL_LPSPI.H%3E%3C%2FFSL_CLOCK.H%3E%3C%2FFSL_CTIMER.H%3E%3C%2FFSL_GPIO.H%3E%3C%2FSTDIO.H%3E%3C%2FFSL_DEBUG_CONSOLE.H%3E%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%2F*Check%20for%20MCXN%20controller%20based%20boards*%2F%0A%23if%20defined%20(PHDRIVER_FRDMMCXN947_PN5190_BOARD)%0A%23define%20PHDRIVER_FRDM_MCXN947%0A%23endif%0A%0A%23ifdef%20PHDRIVER_FRDM_MCXN947%0A%23include%20%3CFSL_DEBUG_CONSOLE.H%3E%0A%23include%20%3CSTDIO.H%3E%0A%23include%20%3CFSL_GPIO.H%3E%0A%23include%20%3CFSL_CTIMER.H%3E%0A%23include%20%3CFSL_CLOCK.H%3E%0A%23include%20%3CFSL_LPSPI.H%3E%0A%23endif%0A%3C%2FFSL_LPSPI.H%3E%3C%2FFSL_CLOCK.H%3E%3C%2FFSL_CTIMER.H%3E%3C%2FFSL_GPIO.H%3E%3C%2FSTDIO.H%3E%3C%2FFSL_DEBUG_CONSOLE.H%3E%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23if%20defined(PHDRIVER_KINETIS_K82)%7C%7C%20defined(PHDRIVER_FRDM_MCXN947)%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23if%20defined(PHDRIVER_KINETIS_K82)%7C%7C%20defined(PHDRIVER_FRDM_MCXN947)%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId-247556905%22%20id%3D%22toc-hId-248449758%22%3EphApp_Init.c%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EFinally%2C%20in%20this%20source%20file%20we%20will%20add%20the%20initialization%20code%20for%20the%20MCXN947%20to%20complement%20the%20initialization%20macros%20defined%20in%20the%20previous%20phApp_Init.h%20file%20modification.%20Here%20we%20will%20call%20functions%20to%20initialize%20clocks%20and%20UART%20pins.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1782507864930.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1782507864930.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390452i5A9CFBC2FAA73342%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1782507864930.png%22%20alt%3D%22Habib_MS_3-1782507864930.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1782507864930.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23ifdef%20PHDRIVER_FRDM_MCXN947%0A%23include%20%22fsl_common.h%22%0A%23include%20%22pin_mux.h%22%0A%23include%20%22clock_config.h%22%0A%23include%20%22board.h%22%0Astatic%20void%20phApp_MCXN947_Init(void)%7B%0A%09BOARD_InitBootPins()%3B%0A%09BOARD_InitBootClocks()%3B%0A%09BOARD_InitDebugConsole()%3B%0A%7D%0A%23endif%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23ifdef%20PHDRIVER_FRDM_MCXN947%0A%23include%20%22fsl_common.h%22%0A%23include%20%22pin_mux.h%22%0A%23include%20%22clock_config.h%22%0A%23include%20%22board.h%22%0Astatic%20void%20phApp_MCXN947_Init(void)%7B%0A%09BOARD_InitBootPins()%3B%0A%09BOARD_InitBootClocks()%3B%0A%09BOARD_InitDebugConsole()%3B%0A%7D%0A%23endif%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23elif%20defined(PHDRIVER_FRDM_MCXN947)%0A%20%20%20%20phApp_MCXN947_Init()%3B%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23elif%20defined(PHDRIVER_FRDM_MCXN947)%0A%20%20%20%20phApp_MCXN947_Init()%3B%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EThese%20functions%20are%20used%20to%20initialize%20the%20correspondent%20clocks%20of%20each%20peripheral%20such%20as%20CTIMER%2C%20the%20input%20pins%20multiplexor%20for%20selecting%20GPIO%20functionality%20and%20FLEXCOMM%20for%20SPI.%20In%20here%20we%20also%20set%20the%20GPIO%20functionality%20for%20pins%20P0_31%20and%20P0_28%20(IRQ%20and%20RESET)%2C%20as%20well%20as%20UART3%20for%20printing%20the%20tag%20information%20on%20the%20serial%20port%20connected%20to%20the%20computer.%3C%2FP%3E%0A%3CP%3EAdditionally%2C%20we%20need%20to%20set%20the%20NVIC%20priority%20to%20ensure%20that%20interrupts%20can%20occur.%20Add%20the%20NVIC_SetPriority()%20function%20to%20phApp_Configure_IRQ().%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_5-1782507924509.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_5-1782507924509.png%22%20style%3D%22width%3A%20859px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390453iDC65906A4D4018AB%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_5-1782507924509.png%22%20alt%3D%22Habib_MS_5-1782507924509.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_5-1782507924509.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23ifdef%20PH_PLATFORM_HAS_ICFRONTEND%0A%23if%20!(defined(PH_OSAL_LINUX)%20%26amp%3B%26amp%3B%20defined(NXPBUILD__PHHAL_HW_PN5190))%0A%20%20%20%20phDriver_Pin_Config_t%20pinCfg%3B%0A%20%20%20%20NVIC_SetPriority(EINT_IRQn%2C%20EINT_PRIORITY)%3B%0A%20%20%20%20pinCfg.bOutputLogic%20%3D%20PH_DRIVER_SET_LOW%3B%0A%20%20%20%20pinCfg.bPullSelect%20%3D%20PHDRIVER_PIN_IRQ_PULL_CFG%3B%0A%0A%20%20%20%20pinCfg.eInterruptConfig%20%3D%20PIN_IRQ_TRIGGER_TYPE%3B%0A%20%20%20%20phDriver_PinConfig(PHDRIVER_PIN_IRQ%2C%20PH_DRIVER_PINFUNC_INTERRUPT%2C%20%26amp%3BpinCfg)%3B%0A%0A%23endif%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23ifdef%20PH_PLATFORM_HAS_ICFRONTEND%0A%23if%20!(defined(PH_OSAL_LINUX)%20%26amp%3B%26amp%3B%20defined(NXPBUILD__PHHAL_HW_PN5190))%0A%20%20%20%20phDriver_Pin_Config_t%20pinCfg%3B%0A%20%20%20%20NVIC_SetPriority(EINT_IRQn%2C%20EINT_PRIORITY)%3B%0A%20%20%20%20pinCfg.bOutputLogic%20%3D%20PH_DRIVER_SET_LOW%3B%0A%20%20%20%20pinCfg.bPullSelect%20%3D%20PHDRIVER_PIN_IRQ_PULL_CFG%3B%0A%0A%20%20%20%20pinCfg.eInterruptConfig%20%3D%20PIN_IRQ_TRIGGER_TYPE%3B%0A%20%20%20%20phDriver_PinConfig(PHDRIVER_PIN_IRQ%2C%20PH_DRIVER_PINFUNC_INTERRUPT%2C%20%26amp%3BpinCfg)%3B%0A%0A%23endif%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId--1559897558%22%20id%3D%22toc-hId--1559004705%22%3Epin_mux.c%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EInside%20the%20function%20%E2%80%9CBOARD_InitBootPins()%E2%80%9D%20which%20is%20defined%20in%20pin_mux.c%20file%2C%20the%20following%20initializations%20need%20to%20be%20added%2C%20you%20can%20find%20this%20file%20in%20the%20following%20path%3A%3C%2FP%3E%0A%3CP%3E%7BPrjRootDirPath%7D%5Cfrdmmcxn947_Discovery_Loop%5Cfrdmmcxn947_cm33_core0%5Ccm33_core0%3C%2FP%3E%0A%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_6-1782507961225.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_6-1782507961225.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390454i7BDAAC3C64F87CFD%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_6-1782507961225.png%22%20alt%3D%22Habib_MS_6-1782507961225.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_6-1782507961225.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Evoid%20BOARD_InitBootPins(void)%0A%7B%0A%20%20%20%20%2F*%20Use%20FRO%20HF%20clock%20for%20some%20of%20the%20Ctimers%20*%2F%0A%20%20%20%20CLOCK_SetClkDiv(kCLOCK_DivCtimer0Clk%2C%201u)%3B%0A%20%20%20%20CLOCK_AttachClk(kFRO_HF_to_CTIMER0)%3B%0A%0A%20%20%20%20CLOCK_EnableClock(kCLOCK_Gpio0)%3B%0A%20%20%20%20CLOCK_EnableClock(kCLOCK_Gpio1)%3B%0A%20%20%20%20BOARD_InitPins()%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Evoid%20BOARD_InitBootPins(void)%0A%7B%0A%20%20%20%20%2F*%20Use%20FRO%20HF%20clock%20for%20some%20of%20the%20Ctimers%20*%2F%0A%20%20%20%20CLOCK_SetClkDiv(kCLOCK_DivCtimer0Clk%2C%201u)%3B%0A%20%20%20%20CLOCK_AttachClk(kFRO_HF_to_CTIMER0)%3B%0A%0A%20%20%20%20CLOCK_EnableClock(kCLOCK_Gpio0)%3B%0A%20%20%20%20CLOCK_EnableClock(kCLOCK_Gpio1)%3B%0A%20%20%20%20BOARD_InitPins()%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EAdditionally%2C%20within%20the%20%E2%80%9CBOARD_InitPins()%E2%80%9D%20function%20available%20in%20the%20same%20file%2C%20we%20will%20replace%20the%20function%20to%20add%20initializations%20of%20the%20GPIO%20and%20UART%20pins.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_7-1782507998410.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_7-1782507998410.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390455iBD868CE6610D7ED8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_7-1782507998410.png%22%20alt%3D%22Habib_MS_7-1782507998410.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_7-1782507998410.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_8-1782508012260.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_8-1782508012260.png%22%20style%3D%22width%3A%20675px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390456iCC0907473269FF6D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_8-1782508012260.png%22%20alt%3D%22Habib_MS_8-1782508012260.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_8-1782508012260.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_9-1782508024569.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_9-1782508024569.png%22%20style%3D%22width%3A%20647px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390457i9BFD48BE51DD0022%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_9-1782508024569.png%22%20alt%3D%22Habib_MS_9-1782508024569.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_9-1782508024569.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Evoid%20BOARD_InitPins(void)%0A%7B%0A%20%20%20%20%2F*%20Enables%20the%20clock%20for%20PORT0%20controller%3A%20Enables%20clock%20*%2F%0A%20%20%20%20CLOCK_EnableClock(kCLOCK_Port0)%3B%0A%20%20%20%20%2F*%20Enables%20the%20clock%20for%20PORT1%3A%20Enables%20clock%20*%2F%0A%20%20%20%20CLOCK_EnableClock(kCLOCK_Port1)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_19_config%20%3D%20%7B%2F*%20Internal%20pull-up%2Fdown%20resistor%20is%20disabled%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Low%20internal%20pull%20resistor%20value%20is%20selected.%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Fast%20slew%20rate%20is%20configured%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Passive%20input%20filter%20is%20disabled%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Open%20drain%20output%20is%20disabled%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Low%20drive%20strength%20is%20configured%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Digital%20input%20enabled%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Digital%20input%20is%20not%20inverted%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20Control%20Register%20fields%20%5B15%3A0%5D%20are%20not%20locked%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_10%20(pin%20B12)%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2019U%2C%20%26amp%3Bport0_19_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port1_0_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_10%20(pin%20B12)%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT1%2C%200U%2C%20%26amp%3Bport1_0_config)%3B%0A%20%20%20%20const%20port_pin_config_t%20port1_1_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_10%20(pin%20B12)%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT1%2C%201U%2C%20%26amp%3Bport1_1_config)%3B%0A%20%20%20%20const%20port_pin_config_t%20port0_31_pinB12_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDown%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_10%20(pin%20B12)%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2031U%2C%20%26amp%3Bport0_31_pinB12_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_28_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_6%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_6%20(pin%20C14)%20is%20configured%20as%20PIO0_6%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2028U%2C%20%26amp%3Bport0_28_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_2_pinB16_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullSelect%20%3D%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullValueSelect%20%3D%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.slewRate%20%3D%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.passiveFilterEnable%20%3D%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.openDrainEnable%20%3D%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.driveStrength%20%3D%20kPORT_HighDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20SWO%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.mux%20%3D%20kPORT_MuxAlt1%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.inputBuffer%20%3D%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.invertInput%20%3D%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.lockRegister%20%3D%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_2%20(pin%20B16)%20is%20configured%20as%20SWO%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%202U%2C%20%26amp%3Bport0_2_pinB16_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port1_8_pinA1_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullSelect%20%3D%20kPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullValueSelect%20%3D%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.slewRate%20%3D%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.passiveFilterEnable%20%3D%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.openDrainEnable%20%3D%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.driveStrength%20%3D%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC4_P0%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.mux%20%3D%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.inputBuffer%20%3D%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.invertInput%20%3D%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.lockRegister%20%3D%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT1_8%20(pin%20A1)%20is%20configured%20as%20FC4_P0%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT1%2C%208U%2C%20%26amp%3Bport1_8_pinA1_config)%3B%0A%20%20%20const%20port_pin_config_t%20port1_9_pinB1_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullSelect%20%3D%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullValueSelect%20%3D%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.slewRate%20%3D%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.passiveFilterEnable%20%3D%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.openDrainEnable%20%3D%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.driveStrength%20%3D%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC4_P1%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.mux%20%3D%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.inputBuffer%20%3D%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.invertInput%20%3D%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.lockRegister%20%3D%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT1_9%20(pin%20B1)%20is%20configured%20as%20FC4_P1%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT1%2C%209U%2C%20%26amp%3Bport1_9_pinB1_config)%3B%0A%7D%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Evoid%20BOARD_InitPins(void)%0A%7B%0A%20%20%20%20%2F*%20Enables%20the%20clock%20for%20PORT0%20controller%3A%20Enables%20clock%20*%2F%0A%20%20%20%20CLOCK_EnableClock(kCLOCK_Port0)%3B%0A%20%20%20%20%2F*%20Enables%20the%20clock%20for%20PORT1%3A%20Enables%20clock%20*%2F%0A%20%20%20%20CLOCK_EnableClock(kCLOCK_Port1)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_19_config%20%3D%20%7B%2F*%20Internal%20pull-up%2Fdown%20resistor%20is%20disabled%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Low%20internal%20pull%20resistor%20value%20is%20selected.%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Fast%20slew%20rate%20is%20configured%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Passive%20input%20filter%20is%20disabled%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Open%20drain%20output%20is%20disabled%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Low%20drive%20strength%20is%20configured%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Digital%20input%20enabled%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Digital%20input%20is%20not%20inverted%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20Control%20Register%20fields%20%5B15%3A0%5D%20are%20not%20locked%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_10%20(pin%20B12)%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2019U%2C%20%26amp%3Bport0_19_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port1_0_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_10%20(pin%20B12)%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT1%2C%200U%2C%20%26amp%3Bport1_0_config)%3B%0A%20%20%20%20const%20port_pin_config_t%20port1_1_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_10%20(pin%20B12)%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT1%2C%201U%2C%20%26amp%3Bport1_1_config)%3B%0A%20%20%20%20const%20port_pin_config_t%20port0_31_pinB12_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDown%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_10%20(pin%20B12)%20is%20configured%20as%20PIO0_10%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2031U%2C%20%26amp%3Bport0_31_pinB12_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_28_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20PIO0_6%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_MuxAlt0%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_6%20(pin%20C14)%20is%20configured%20as%20PIO0_6%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%2028U%2C%20%26amp%3Bport0_28_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port0_2_pinB16_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullSelect%20%3D%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullValueSelect%20%3D%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.slewRate%20%3D%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.passiveFilterEnable%20%3D%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.openDrainEnable%20%3D%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.driveStrength%20%3D%20kPORT_HighDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20SWO%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.mux%20%3D%20kPORT_MuxAlt1%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.inputBuffer%20%3D%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.invertInput%20%3D%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.lockRegister%20%3D%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT0_2%20(pin%20B16)%20is%20configured%20as%20SWO%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT0%2C%202U%2C%20%26amp%3Bport0_2_pinB16_config)%3B%0A%0A%20%20%20%20const%20port_pin_config_t%20port1_8_pinA1_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullSelect%20%3D%20kPORT_PullUp%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullValueSelect%20%3D%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.slewRate%20%3D%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.passiveFilterEnable%20%3D%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.openDrainEnable%20%3D%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.driveStrength%20%3D%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC4_P0%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.mux%20%3D%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.inputBuffer%20%3D%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.invertInput%20%3D%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.lockRegister%20%3D%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT1_8%20(pin%20A1)%20is%20configured%20as%20FC4_P0%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT1%2C%208U%2C%20%26amp%3Bport1_8_pinA1_config)%3B%0A%20%20%20const%20port_pin_config_t%20port1_9_pinB1_config%20%3D%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullSelect%20%3D%20kPORT_PullDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.pullValueSelect%20%3D%20kPORT_LowPullResistor%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.slewRate%20%3D%20kPORT_FastSlewRate%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.passiveFilterEnable%20%3D%20kPORT_PassiveFilterDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.openDrainEnable%20%3D%20kPORT_OpenDrainDisable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.driveStrength%20%3D%20kPORT_LowDriveStrength%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pin%20is%20configured%20as%20FC4_P1%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.mux%20%3D%20kPORT_MuxAlt2%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.inputBuffer%20%3D%20kPORT_InputBufferEnable%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.invertInput%20%3D%20kPORT_InputNormal%2C%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20.lockRegister%20%3D%20kPORT_UnlockRegister%7D%3B%0A%20%20%20%20%2F*%20PORT1_9%20(pin%20B1)%20is%20configured%20as%20FC4_P1%20*%2F%0A%20%20%20%20PORT_SetPinConfig(PORT1%2C%209U%2C%20%26amp%3Bport1_9_pinB1_config)%3B%0A%7D%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3EAt%20the%20same%20time%2C%20add%20the%20following%20includes%20to%20the%20file%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1785878023889.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1785878023889.png%22%20style%3D%22width%3A%20574px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393736iDBFB699750A97A4E%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1785878023889.png%22%20alt%3D%22Habib_MS_0-1785878023889.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_0-1785878023889.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23include%20%22fsl_common.h%22%0A%23include%20%22fsl_port.h%22%0A%23include%20%22board.h%22%0A%23include%20%22clock_config.h%22%0A%23include%20%22pin_mux.h%22%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23include%20%22fsl_common.h%22%0A%23include%20%22fsl_port.h%22%0A%23include%20%22board.h%22%0A%23include%20%22clock_config.h%22%0A%23include%20%22pin_mux.h%22%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId-927615275%22%20id%3D%22toc-hId-928508128%22%3EDelete%20phOsal%20files%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EWe%20must%20delete%20from%20the%20path%20%E2%80%9CphOsal%20%26gt%3B%20src%20%26gt%3B%20NullOs%20%26gt%3B%20portable%E2%80%9D%20the%20files%3A%20%E2%80%9CphOsal_Port_CM3.c%E2%80%9D%2C%E2%80%9CphOsal_Port_PN76xx.c%E2%80%9D%20and%20%E2%80%9CphOsal_Port_PN74xxxx.c%E2%80%9D.%20This%20has%20the%20purpose%20of%20avoiding%20any%20multiple%20definition%20errors%20when%20compiling%20the%20final%20project.%3C%2FP%3E%0A%3CP%3EAlthough%20these%20files%20have%20been%20deleted%2C%20they%20are%20still%20referenced%20in%20the%20CMakeLists.txt%20file.%20Please%20remove%20those%20includes%20from%20this%20file.%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--879839188%22%20id%3D%22toc-hId--878946335%22%3EAdd%20all%20header%20files%20in%20CMakeList.txt%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAs%20mentioned%20previously%2C%20the%20CMakeList.txt%20is%20automatically%20updated%20when%20you%20copy%20a%20.c%20file.%20However%2C%20.h%20files%20are%20not%20automatically%20linked%2C%20so%20they%20must%20be%20added%20manually.%20Please%20copy%20and%20paste%20the%20following%20includes%20into%20the%20CMakeLists.txt%20file%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_0-1782508446885.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_0-1782508446885.png%22%20style%3D%22width%3A%20900px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390459iEE9914B80AC2A9B8%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_0-1782508446885.png%22%20alt%3D%22Habib_MS_0-1782508446885.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_0-1782508446885.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Emcux_add_include(%0A%20%20%20%20BASE_PATH%20%24%7BCMAKE_CURRENT_LIST_DIR%7D%0A%20%20%20%20INCLUDES%20%0A%20%20%20%20%20%20%20%20%20%20%20%20NxpNfcRdLib%2Fintfs%0A%20%20%20%20%20%20%20%20%20%20%20%20NxpNfcRdLib%2Ftypes%0A%09%09%09NxpNfcRdLib%2Fcomps%2FphacDiscLoop%2Fsrc%2FSw%0A%09%09%09intfs%0A%09%09%09DAL%2Fboards%0A%09%09%09DAL%2Fcfg%0A%09%09%09DAL%2Finc%0A%09%09%09phOsal%2Finc%0A%09%09%09.%20%0A%20%20%20%20)%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Emcux_add_include(%0A%20%20%20%20BASE_PATH%20%24%7BCMAKE_CURRENT_LIST_DIR%7D%0A%20%20%20%20INCLUDES%20%0A%20%20%20%20%20%20%20%20%20%20%20%20NxpNfcRdLib%2Fintfs%0A%20%20%20%20%20%20%20%20%20%20%20%20NxpNfcRdLib%2Ftypes%0A%09%09%09NxpNfcRdLib%2Fcomps%2FphacDiscLoop%2Fsrc%2FSw%0A%09%09%09intfs%0A%09%09%09DAL%2Fboards%0A%09%09%09DAL%2Fcfg%0A%09%09%09DAL%2Finc%0A%09%09%09phOsal%2Finc%0A%09%09%09.%20%0A%20%20%20%20)%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CH3%20id%3D%22toc-hId-1607673645%22%20id%3D%22toc-hId-1608566498%22%3EAdd%20_DSB%20and%20_ISB%20support%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAs%20final%20modification%20step%2C%20please%20include%20in%20%7BPrjRootDirPath%7D%5CNxpNfcRdLib%5Ccomps%5CphhalHw%5Csrc%5CPn5190%5CphhalHw_Pn5190_Int.c%20the%20%E2%80%9Ccmsis_gcc.h%E2%80%9D%20to%20support%20of%20_DSB%20and%20_ISB%20functions.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1782508515584.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1782508515584.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390460i9CA8454658D8870D%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1782508515584.png%22%20alt%3D%22Habib_MS_2-1782508515584.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1782508515584.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CH3%20id%3D%22toc-hId--199780818%22%20id%3D%22toc-hId--198887965%22%3ETesting%20Final%20Project%20with%20FreeRTOS%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EAfter%20making%20all%20the%20previous%20changes%20and%20modifications%2C%20the%20migration%20is%20now%20complete%2C%20and%20we%20can%20proceed%20to%20compile%20and%20flash%20the%20example%20to%20MCXN947.%3C%2FP%3E%0A%3CP%3EPlease%20%E2%80%9Cclean%E2%80%9D%20the%20project%20before%20building%20by%20right%20clicking%20on%20the%20project%20as%20follows%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1785878094753.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1785878094753.png%22%20style%3D%22width%3A%20587px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393737i5883249461320530%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1785878094753.png%22%20alt%3D%22Habib_MS_1-1785878094753.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1785878094753.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3ETo%20run%20the%20project%2C%20we%20will%20need%20a%20serial%20terminal%20like%20Tera%20Term%20with%20the%20following%20settings%3A%3C%2FP%3E%0A%3CP%3E-%20115200%20baud%20rate.%3C%2FP%3E%0A%3CP%3E-%208%20data%20bits.%3C%2FP%3E%0A%3CP%3E-%20No%20parity.%3C%2FP%3E%0A%3CP%3E-%20One%20stop%20bit%2C%3C%2FP%3E%0A%3CP%3E-%20No%20flow%20control.%3C%2FP%3E%0A%3CP%3EOnce%20the%20program%20is%20flashed%20and%20the%20serial%20terminal%20configured%2C%20we%20can%20reset%20the%20board%20and%20power%20the%20PNEV5190BP.%20You%20should%20see%20an%20output%20similar%20to%20the%20following%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_4-1782508585568.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_4-1782508585568.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390462i5FB9E072DCE4E5D9%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_4-1782508585568.png%22%20alt%3D%22Habib_MS_4-1782508585568.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_4-1782508585568.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3ENow%20if%20any%20NFC%20tag%20is%20close%20to%20the%20PNEV5190BP%E2%80%99s%20antenna%2C%20you%20should%20see%20the%20information%20displayed%20as%20shown%20in%20the%20image%20below%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_5-1782508604979.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_5-1782508604979.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390463i7A8472914E402281%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_5-1782508604979.png%22%20alt%3D%22Habib_MS_5-1782508604979.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_5-1782508604979.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CH3%20id%3D%22toc-hId--2007235281%22%20id%3D%22toc-hId--2006342428%22%3EChanging%20OS%20preprocessor%20macro%3C%2FH3%3E%0A%3CBR%20%2F%3E%0A%3CP%3EThis%20section%20presents%20the%20steps%20to%20follow%20to%20add%20the%20possibility%20of%20easily%20choosing%20whether%20to%20have%20OS%20support%20or%20not.%20%26nbsp%3BThis%20guide%20is%20based%20as%20default%20with%20FREERTOS%2C%20but%20the%20NFC%20reader%20library%20offers%20the%20possibility%20to%20run%20without%20OS%2C%20firstly%2C%20we%20need%20to%20change%20the%20preprocessor%20macro%20%3CSTRONG%3EPH_OSAL_FREERTOS%3C%2FSTRONG%3E%20to%20%3CSTRONG%3EPH_OSAL_NULLOS%3C%2FSTRONG%3E%20in%20the%20CMakeList.txt%2C%20as%20shown%20the%20following%20image%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_6-1782508642319.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_6-1782508642319.png%22%20style%3D%22width%3A%20975px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390464i75602039690F676A%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_6-1782508642319.png%22%20alt%3D%22Habib_MS_6-1782508642319.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_6-1782508642319.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3EFinally%2C%20to%20avoid%20multiple%20definition%20issues%20when%20we%20change%20between%20NULLOS%20and%20FREERTOS%2C%20we%20will%20discard%20the%20SysTickHandler%20for%20FREERTOS%20side%20located%20in%20port.c%20when%20the%20NULLOS%20macro%20is%20defined%2C%20to%20achieve%20this%20we%20need%20to%20add%20a%20replacement%20of%20the%20file%20port.c%20since%20the%20included%20FreeRTOS%20is%20shared%20with%20all%20projects%20of%20the%20repository%2C%20and%20if%20we%20modify%20this%20file%2C%20it%20will%20be%20modified%20in%20all%20projects.%3C%2FP%3E%0A%3CP%3E1.%20Go%20to%20the%20explorer%20window%2C%20right-click%20on%20the%20project%20and%20click%20on%20%E2%80%9CNew%20File%E2%80%A6%E2%80%9D.%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_5-1785877420766.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_5-1785877420766.png%22%20style%3D%22width%3A%20692px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393733i2147D474AA586EB0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_5-1785877420766.png%22%20alt%3D%22Habib_MS_5-1785877420766.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_5-1785877420766.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3E2.%26nbsp%3BWrite%20the%20file%E2%80%99s%20name%20as%20follows%20(port.c)%20and%20click%20enter%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_4-1785877388377.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_4-1785877388377.png%22%20style%3D%22width%3A%20520px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393731i68F8D6CB0016F9E0%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_4-1785877388377.png%22%20alt%3D%22Habib_MS_4-1785877388377.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_4-1785877388377.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%3CSPAN%3E3.%20Add%20this%20file%20into%20the%20CMakeList.txt%20file%20to%20include%20port.c%20into%20the%20compilation%20process%3A%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%3CBR%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_3-1785877308864.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_3-1785877308864.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393730i5B6E2BC6DC9A5F0F%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_3-1785877308864.png%22%20alt%3D%22Habib_MS_3-1785877308864.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_3-1785877308864.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CBR%20%2F%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Emcux_add_source(BASE_PATH%20%24%7BCMAKE_CURRENT_LIST_DIR%7D%0A%20%20%20%20SOURCES%20%22port.c%22)%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Emcux_add_source(BASE_PATH%20%24%7BCMAKE_CURRENT_LIST_DIR%7D%0A%20%20%20%20SOURCES%20%22port.c%22)%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3E4.%20Please%20copy%20and%20paste%20all%20the%20content%20form%20of%20the%20port.c%20located%20on%20the%20following%20path%20to%20the%20port.c%20we%20created%3A%3C%2FP%3E%0A%3CP%3E%7BSdkRootDirPath%7D%2Frtos%2Ffreertos%2Ffreertos-kernel-upstream%2Fportable%2FGCC%2FARM_CM33_NTZ%2Fnon_secure%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_1-1785877681949.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_1-1785877681949.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393735i536D49E48B27C661%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_1-1785877681949.png%22%20alt%3D%22Habib_MS_1-1785877681949.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_1-1785877681949.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CP%3E5.%20Replace%20the%20SysTick_Handler()%20of%20the%20port.c%20we%20created%20to%20the%20following%20function%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_11-1782508854714.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_11-1782508854714.png%22%20style%3D%22width%3A%20788px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F390470i33062862E3733B12%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_11-1782508854714.png%22%20alt%3D%22Habib_MS_11-1782508854714.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_11-1782508854714.png%3C%2FSPAN%3E%3C%2FSPAN%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3E%23ifndef%20PH_OSAL_NULLOS%0Avoid%20SysTick_Handler(%20void%20)%20%2F*%20PRIVILEGED_FUNCTION%20*%2F%0A%7B%0A%20%20%20%20uint32_t%20ulPreviousMask%3B%0A%0A%20%20%20%20ulPreviousMask%20%3D%20portSET_INTERRUPT_MASK_FROM_ISR()%3B%0A%20%20%20%20traceISR_ENTER()%3B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F*%20Increment%20the%20RTOS%20tick.%20*%2F%0A%20%20%20%20%20%20%20%20if(%20xTaskIncrementTick()%20!%3D%20pdFALSE%20)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20traceISR_EXIT_TO_SCHEDULER()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pend%20a%20context%20switch.%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20portNVIC_INT_CTRL_REG%20%3D%20portNVIC_PENDSVSET_BIT%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20traceISR_EXIT()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20portCLEAR_INTERRUPT_MASK_FROM_ISR(%20ulPreviousMask%20)%3B%0A%7D%0A%23endif%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3E%23ifndef%20PH_OSAL_NULLOS%0Avoid%20SysTick_Handler(%20void%20)%20%2F*%20PRIVILEGED_FUNCTION%20*%2F%0A%7B%0A%20%20%20%20uint32_t%20ulPreviousMask%3B%0A%0A%20%20%20%20ulPreviousMask%20%3D%20portSET_INTERRUPT_MASK_FROM_ISR()%3B%0A%20%20%20%20traceISR_ENTER()%3B%0A%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%2F*%20Increment%20the%20RTOS%20tick.%20*%2F%0A%20%20%20%20%20%20%20%20if(%20xTaskIncrementTick()%20!%3D%20pdFALSE%20)%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20traceISR_EXIT_TO_SCHEDULER()%3B%0A%20%20%20%20%20%20%20%20%20%20%20%20%2F*%20Pend%20a%20context%20switch.%20*%2F%0A%20%20%20%20%20%20%20%20%20%20%20%20portNVIC_INT_CTRL_REG%20%3D%20portNVIC_PENDSVSET_BIT%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%20%20%20%20else%0A%20%20%20%20%20%20%20%20%7B%0A%20%20%20%20%20%20%20%20%20%20%20%20traceISR_EXIT()%3B%0A%20%20%20%20%20%20%20%20%7D%0A%20%20%20%20%7D%0A%20%20%20%20portCLEAR_INTERRUPT_MASK_FROM_ISR(%20ulPreviousMask%20)%3B%0A%7D%0A%23endif%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3CP%3E6.%20Finally%2C%20we%20will%20ignore%20the%20port.c%20of%20the%20FreeRTOS%20folder%2C%20please%20add%20the%20following%20code%20to%20the%20CMakeList.txt%3A%3C%2FP%3E%0A%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Habib_MS_2-1785878166328.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22Habib_MS_2-1785878166328.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F393738iFE7CFA01863EE7C4%2Fimage-size%2Flarge%3Fv%3Dv2%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22Habib_MS_2-1785878166328.png%22%20alt%3D%22Habib_MS_2-1785878166328.png%22%20%2F%3E%3C%2Fspan%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EHabib_MS_2-1785878166328.png%3C%2FSPAN%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3E%0A%3CDIV%20class%3D%22lia-spoiler-container%22%3E%3CA%20class%3D%22lia-spoiler-link%22%20href%3D%22%23%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%20target%3D%22_blank%22%3ESpoiler%3C%2FA%3E%3CNOSCRIPT%3E%20(Highlight%20to%20read)%3C%2FNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-border%22%3E%3CDIV%20class%3D%22lia-spoiler-content%22%3E%3CPRE%20class%3D%22lia-code-sample%20language-c%22%3E%3CCODE%3Emcux_project_remove_source(%0A%20%20%20%20BASE_PATH%20%24%7BSdkRootDirPath%7D%2Frtos%2Ffreertos%2Ffreertos-kernel-upstream%2Fportable%2FGCC%2FARM_CM33_NTZ%2Fnon_secure%0A%20%20%20%20SOURCES%20port.c%0A)%0A%3C%2FCODE%3E%3C%2FPRE%3E%3C%2FDIV%3E%3CNOSCRIPT%3E%3CDIV%20class%3D%22lia-spoiler-noscript-container%22%3E%3CDIV%20class%3D%22lia-spoiler-noscript-content%22%3Emcux_project_remove_source(%0A%20%20%20%20BASE_PATH%20%24%7BSdkRootDirPath%7D%2Frtos%2Ffreertos%2Ffreertos-kernel-upstream%2Fportable%2FGCC%2FARM_CM33_NTZ%2Fnon_secure%0A%20%20%20%20SOURCES%20port.c%0A)%0A%3C%2FDIV%3E%3C%2FDIV%3E%3C%2FNOSCRIPT%3E%3C%2FDIV%3E%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CDIV%20class%3D%22lia-message-template-content-zone%22%3EPlease%20rebuild%20and%20test%20as%20the%20steps%20mentioned%20in%20the%20section%26nbsp%3BTesting%20Final%20Project%20with%20FreeRTOS.%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2387149%22%20slang%3D%22en-US%22%20mode%3D%22UPDATE%22%3E%3CLINGO-LABEL%3ENFC%20Reader%20Library%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
No ratings
Version history
Last update:
2 weeks ago
Updated by: