diff --git a/boards/nxp/ucans32k146/nuttx-config/Kconfig b/boards/nxp/ucans32k146/nuttx-config/Kconfig index 57cceef9e0..ba1be92cff 100644 --- a/boards/nxp/ucans32k146/nuttx-config/Kconfig +++ b/boards/nxp/ucans32k146/nuttx-config/Kconfig @@ -6,12 +6,14 @@ config BOARD_HAS_PROBES bool "Board provides GPIO or other Hardware for signaling to timing analyze." default y ---help--- - This board provides GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers. + This board provides GPIO 6-wr-SPI_INT_N, 6-wr-SPI_CS_N, 6-wr-SPI_RDY_N as + PROBE_1-3 to provide timing signals from selected drivers. config BOARD_USE_PROBES - bool "Enable the use the board provided GPIO FMU-CH1-6 as PROBE_1-6 to provide timing signals from selected drivers" + bool "Enable the use of the board provided GPIO Probes" default n depends on BOARD_HAS_PROBES ---help--- - Select to use GPIO FMU-CH1-6 to provide timing signals from selected drivers. + Select to use GPIO GPIO 6-wr-SPI_INT_N, 6-wr-SPI_CS_N, 6-wr-SPI_RDY_N as PROBE_1-3 + to provide timing signals from selected drivers. diff --git a/boards/nxp/ucans32k146/nuttx-config/include/board.h b/boards/nxp/ucans32k146/nuttx-config/include/board.h index a4a74e1f02..f8990c2b47 100644 --- a/boards/nxp/ucans32k146/nuttx-config/include/board.h +++ b/boards/nxp/ucans32k146/nuttx-config/include/board.h @@ -167,4 +167,29 @@ #define PIN_CAN1_ERRN (GPIO_PULLDOWN | PIN_PORTE | PIN6 ) #define PIN_CAN1_EN (GPIO_OUTPUT | PIN_PORTE | PIN2 ) +/* Board provides GPIO or other Hardware for signaling to timing analyzer */ + +#if defined(CONFIG_BOARD_USE_PROBES) +# include "s32k1xx_pin.h" +# include "hardware/s32k1xx_pinmux.h" +# define PROBE_N(n) (1<<((n)-1)) +# define PROBE_1 (PIN_PTE0 | GPIO_OUTPUT) /* 6-wr-SPI_RDY_N */ +# define PROBE_2 (PIN_PTE9 | GPIO_OUTPUT) /* 6-wr-SPI_INT_N */ +# define PROBE_3 (PIN_PTB5 | GPIO_OUTPUT) /* 6-wr-SPI_CS_N */ + +# define PROBE_INIT(mask) \ + do { \ + if ((mask)& PROBE_N(1)) { s32k1xx_pinconfig(PROBE_1); } \ + if ((mask)& PROBE_N(2)) { s32k1xx_pinconfig(PROBE_2); } \ + if ((mask)& PROBE_N(3)) { s32k1xx_pinconfig(PROBE_3); } \ + } while(0) + +# define PROBE(n,s) do {s32k1xx_gpiowrite(PROBE_##n,(s));}while(0) +# define PROBE_MARK(n) PROBE(n,false);PROBE(n,true) +#else +# define PROBE_INIT(mask) +# define PROBE(n,s) +# define PROBE_MARK(n) +#endif + #endif /* __BOARDS_ARM_RDDRONE_UAVCAN146_INCLUDE_BOARD_H */