Browse Source

nxp_fmuk66:Add Serial RX DMA on Console

master
David Sidrane 4 years ago committed by Daniel Agar
parent
commit
d6ee418cdf
  1. 1
      boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig
  2. 1
      boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig
  3. 27
      boards/nxp/fmuk66-e/src/init.c
  4. 1
      boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig
  5. 1
      boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig
  6. 27
      boards/nxp/fmuk66-v3/src/init.c

1
boards/nxp/fmuk66-e/nuttx-config/nsh/defconfig

@ -80,6 +80,7 @@ CONFIG_KINETIS_I2C0=y @@ -80,6 +80,7 @@ CONFIG_KINETIS_I2C0=y
CONFIG_KINETIS_I2C1=y
CONFIG_KINETIS_LPTMR0=y
CONFIG_KINETIS_LPUART0=y
CONFIG_KINETIS_LPUART0_RXDMA=y
CONFIG_KINETIS_MERGE_TTY=y
CONFIG_KINETIS_PDB=y
CONFIG_KINETIS_PIT=y

1
boards/nxp/fmuk66-e/nuttx-config/socketcan/defconfig

@ -81,6 +81,7 @@ CONFIG_KINETIS_I2C0=y @@ -81,6 +81,7 @@ CONFIG_KINETIS_I2C0=y
CONFIG_KINETIS_I2C1=y
CONFIG_KINETIS_LPTMR0=y
CONFIG_KINETIS_LPUART0=y
CONFIG_KINETIS_LPUART0_RXDMA=y
CONFIG_KINETIS_MERGE_TTY=y
CONFIG_KINETIS_PDB=y
CONFIG_KINETIS_PIT=y

27
boards/nxp/fmuk66-e/src/init.c

@ -64,8 +64,7 @@ @@ -64,8 +64,7 @@
#include <kinetis.h>
#include <kinetis_uart.h>
#include <hardware/kinetis_uart.h>
#include <hardware/kinetis_sim.h>
#include <kinetis_lpuart.h>
#include "board_config.h"
#include "arm_arch.h"
@ -189,6 +188,26 @@ kinetis_boardinitialize(void) @@ -189,6 +188,26 @@ kinetis_boardinitialize(void)
VDD_3V3_SPEKTRUM_POWER_EN(true);
}
/****************************************************************************
* Name: kinetis_serial_dma_poll_all
*
* Description:
* Checks receive DMA buffers for received bytes that have not accumulated
* to the point where the DMA half/full interrupt has triggered.
*
* This function should be called from a timer or other periodic context.
*
****************************************************************************/
void kinetis_lpserial_dma_poll_all(void)
{
#if defined(LPSERIAL_HAVE_DMA)
kinetis_lpserial_dma_poll();
#endif
#if defined(SERIAL_HAVE_DMA)
kinetis_serial_dma_poll();
#endif
}
/****************************************************************************
* Name: board_app_initialize
@ -236,7 +255,7 @@ __EXPORT int board_app_initialize(uintptr_t arg) @@ -236,7 +255,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
}
/* set up the serial DMA polling */
#ifdef SERIAL_HAVE_DMA
#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA)
static struct hrt_call serial_dma_call;
struct timespec ts;
@ -250,7 +269,7 @@ __EXPORT int board_app_initialize(uintptr_t arg) @@ -250,7 +269,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
hrt_call_every(&serial_dma_call,
ts_to_abstime(&ts),
ts_to_abstime(&ts),
(hrt_callout)kinetis_serial_dma_poll,
(hrt_callout)kinetis_lpserial_dma_poll_all,
NULL);
#endif

1
boards/nxp/fmuk66-v3/nuttx-config/nsh/defconfig

@ -81,6 +81,7 @@ CONFIG_KINETIS_I2C0=y @@ -81,6 +81,7 @@ CONFIG_KINETIS_I2C0=y
CONFIG_KINETIS_I2C1=y
CONFIG_KINETIS_LPTMR0=y
CONFIG_KINETIS_LPUART0=y
CONFIG_KINETIS_LPUART0_RXDMA=y
CONFIG_KINETIS_MERGE_TTY=y
CONFIG_KINETIS_PDB=y
CONFIG_KINETIS_PIT=y

1
boards/nxp/fmuk66-v3/nuttx-config/socketcan/defconfig

@ -82,6 +82,7 @@ CONFIG_KINETIS_I2C0=y @@ -82,6 +82,7 @@ CONFIG_KINETIS_I2C0=y
CONFIG_KINETIS_I2C1=y
CONFIG_KINETIS_LPTMR0=y
CONFIG_KINETIS_LPUART0=y
CONFIG_KINETIS_LPUART0_RXDMA=y
CONFIG_KINETIS_MERGE_TTY=y
CONFIG_KINETIS_PDB=y
CONFIG_KINETIS_PIT=y

27
boards/nxp/fmuk66-v3/src/init.c

@ -64,8 +64,7 @@ @@ -64,8 +64,7 @@
#include <kinetis.h>
#include <kinetis_uart.h>
#include <hardware/kinetis_uart.h>
#include <hardware/kinetis_sim.h>
#include <kinetis_lpuart.h>
#include "board_config.h"
#include "arm_arch.h"
@ -189,6 +188,26 @@ kinetis_boardinitialize(void) @@ -189,6 +188,26 @@ kinetis_boardinitialize(void)
VDD_3V3_SPEKTRUM_POWER_EN(true);
}
/****************************************************************************
* Name: kinetis_serial_dma_poll_all
*
* Description:
* Checks receive DMA buffers for received bytes that have not accumulated
* to the point where the DMA half/full interrupt has triggered.
*
* This function should be called from a timer or other periodic context.
*
****************************************************************************/
void kinetis_lpserial_dma_poll_all(void)
{
#if defined(LPSERIAL_HAVE_DMA)
kinetis_lpserial_dma_poll();
#endif
#if defined(SERIAL_HAVE_DMA)
kinetis_serial_dma_poll();
#endif
}
/****************************************************************************
* Name: board_app_initialize
@ -236,7 +255,7 @@ __EXPORT int board_app_initialize(uintptr_t arg) @@ -236,7 +255,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
}
/* set up the serial DMA polling */
#ifdef SERIAL_HAVE_DMA
#if defined(SERIAL_HAVE_DMA) || defined(LPSERIAL_HAVE_DMA)
static struct hrt_call serial_dma_call;
struct timespec ts;
@ -250,7 +269,7 @@ __EXPORT int board_app_initialize(uintptr_t arg) @@ -250,7 +269,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
hrt_call_every(&serial_dma_call,
ts_to_abstime(&ts),
ts_to_abstime(&ts),
(hrt_callout)kinetis_serial_dma_poll,
(hrt_callout)kinetis_lpserial_dma_poll_all,
NULL);
#endif

Loading…
Cancel
Save