Hello @qingyunliu,
Demo 2 is using MCUXpresso IDE's ConfigTools, to use and routing the pin INPUTCAPTURE0; updating the code trough ConfigTools gives the following code:
if (Chip_GetVersion()==1)
{
IOCON->PIO[1][9] = ((IOCON->PIO[1][9] &
/* Mask bits to zero which are setting */
(~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))
/* Selects pin function.
* : PORT19 (pin 10) is configured as CT_INP4. */
| IOCON_PIO_FUNC(PIO1_9_FUNC_ALT3)
/* Select Digital mode.
* : Enable Digital mode.
* Digital input is enabled. */
| IOCON_PIO_DIGIMODE(PIO1_9_DIGIMODE_DIGITAL));
}
else
{
IOCON->PIO[1][9] = ((IOCON->PIO[1][9] &
/* Mask bits to zero which are setting */
(~(IOCON_PIO_FUNC_MASK | IOCON_PIO_DIGIMODE_MASK)))
/* Selects pin function.
* : PORT19 (pin 10) is configured as CT_INP4. */
| IOCON_PIO_FUNC(PIO1_9_FUNC_ALT3)
/* Select Digital mode.
* : Enable Digital mode.
* Digital input is enabled. */
| IOCON_PIO_DIGIMODE(PIO1_9_DIGIMODE_DIGITAL));
}
Could you please try out modifying your pin_mux.c with the previous code?
Do not forget to modify the pin_mux.h with:
#define PIO1_9_DIGIMODE_DIGITAL 0x01u
#define PIO1_9_FUNC_ALT3 0x03u
If you are using MCUXpresso IDE, you could try using ConfigTools to do the same routing scheme than Demo 2, as follows:

- Search for the pin you are looking for

- Check the box and select the functionality you need.

- Update the Code (it will update pin_mux.c and pin_mux.h)

Best regards, Raul.