mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
nxp_fmuk66:Add Serial RX DMA on Console
This commit is contained in:
committed by
Daniel Agar
parent
0709a9bb1c
commit
d6ee418cdf
@@ -80,6 +80,7 @@ CONFIG_KINETIS_I2C0=y
|
|||||||
CONFIG_KINETIS_I2C1=y
|
CONFIG_KINETIS_I2C1=y
|
||||||
CONFIG_KINETIS_LPTMR0=y
|
CONFIG_KINETIS_LPTMR0=y
|
||||||
CONFIG_KINETIS_LPUART0=y
|
CONFIG_KINETIS_LPUART0=y
|
||||||
|
CONFIG_KINETIS_LPUART0_RXDMA=y
|
||||||
CONFIG_KINETIS_MERGE_TTY=y
|
CONFIG_KINETIS_MERGE_TTY=y
|
||||||
CONFIG_KINETIS_PDB=y
|
CONFIG_KINETIS_PDB=y
|
||||||
CONFIG_KINETIS_PIT=y
|
CONFIG_KINETIS_PIT=y
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ CONFIG_KINETIS_I2C0=y
|
|||||||
CONFIG_KINETIS_I2C1=y
|
CONFIG_KINETIS_I2C1=y
|
||||||
CONFIG_KINETIS_LPTMR0=y
|
CONFIG_KINETIS_LPTMR0=y
|
||||||
CONFIG_KINETIS_LPUART0=y
|
CONFIG_KINETIS_LPUART0=y
|
||||||
|
CONFIG_KINETIS_LPUART0_RXDMA=y
|
||||||
CONFIG_KINETIS_MERGE_TTY=y
|
CONFIG_KINETIS_MERGE_TTY=y
|
||||||
CONFIG_KINETIS_PDB=y
|
CONFIG_KINETIS_PDB=y
|
||||||
CONFIG_KINETIS_PIT=y
|
CONFIG_KINETIS_PIT=y
|
||||||
|
|||||||
@@ -64,8 +64,7 @@
|
|||||||
|
|
||||||
#include <kinetis.h>
|
#include <kinetis.h>
|
||||||
#include <kinetis_uart.h>
|
#include <kinetis_uart.h>
|
||||||
#include <hardware/kinetis_uart.h>
|
#include <kinetis_lpuart.h>
|
||||||
#include <hardware/kinetis_sim.h>
|
|
||||||
#include "board_config.h"
|
#include "board_config.h"
|
||||||
|
|
||||||
#include "arm_arch.h"
|
#include "arm_arch.h"
|
||||||
@@ -189,6 +188,26 @@ kinetis_boardinitialize(void)
|
|||||||
|
|
||||||
VDD_3V3_SPEKTRUM_POWER_EN(true);
|
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
|
* Name: board_app_initialize
|
||||||
@@ -236,7 +255,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set up the serial DMA polling */
|
/* 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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
@@ -250,7 +269,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
hrt_call_every(&serial_dma_call,
|
hrt_call_every(&serial_dma_call,
|
||||||
ts_to_abstime(&ts),
|
ts_to_abstime(&ts),
|
||||||
ts_to_abstime(&ts),
|
ts_to_abstime(&ts),
|
||||||
(hrt_callout)kinetis_serial_dma_poll,
|
(hrt_callout)kinetis_lpserial_dma_poll_all,
|
||||||
NULL);
|
NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ CONFIG_KINETIS_I2C0=y
|
|||||||
CONFIG_KINETIS_I2C1=y
|
CONFIG_KINETIS_I2C1=y
|
||||||
CONFIG_KINETIS_LPTMR0=y
|
CONFIG_KINETIS_LPTMR0=y
|
||||||
CONFIG_KINETIS_LPUART0=y
|
CONFIG_KINETIS_LPUART0=y
|
||||||
|
CONFIG_KINETIS_LPUART0_RXDMA=y
|
||||||
CONFIG_KINETIS_MERGE_TTY=y
|
CONFIG_KINETIS_MERGE_TTY=y
|
||||||
CONFIG_KINETIS_PDB=y
|
CONFIG_KINETIS_PDB=y
|
||||||
CONFIG_KINETIS_PIT=y
|
CONFIG_KINETIS_PIT=y
|
||||||
|
|||||||
@@ -82,6 +82,7 @@ CONFIG_KINETIS_I2C0=y
|
|||||||
CONFIG_KINETIS_I2C1=y
|
CONFIG_KINETIS_I2C1=y
|
||||||
CONFIG_KINETIS_LPTMR0=y
|
CONFIG_KINETIS_LPTMR0=y
|
||||||
CONFIG_KINETIS_LPUART0=y
|
CONFIG_KINETIS_LPUART0=y
|
||||||
|
CONFIG_KINETIS_LPUART0_RXDMA=y
|
||||||
CONFIG_KINETIS_MERGE_TTY=y
|
CONFIG_KINETIS_MERGE_TTY=y
|
||||||
CONFIG_KINETIS_PDB=y
|
CONFIG_KINETIS_PDB=y
|
||||||
CONFIG_KINETIS_PIT=y
|
CONFIG_KINETIS_PIT=y
|
||||||
|
|||||||
@@ -64,8 +64,7 @@
|
|||||||
|
|
||||||
#include <kinetis.h>
|
#include <kinetis.h>
|
||||||
#include <kinetis_uart.h>
|
#include <kinetis_uart.h>
|
||||||
#include <hardware/kinetis_uart.h>
|
#include <kinetis_lpuart.h>
|
||||||
#include <hardware/kinetis_sim.h>
|
|
||||||
#include "board_config.h"
|
#include "board_config.h"
|
||||||
|
|
||||||
#include "arm_arch.h"
|
#include "arm_arch.h"
|
||||||
@@ -189,6 +188,26 @@ kinetis_boardinitialize(void)
|
|||||||
|
|
||||||
VDD_3V3_SPEKTRUM_POWER_EN(true);
|
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
|
* Name: board_app_initialize
|
||||||
@@ -236,7 +255,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* set up the serial DMA polling */
|
/* 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;
|
static struct hrt_call serial_dma_call;
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
@@ -250,7 +269,7 @@ __EXPORT int board_app_initialize(uintptr_t arg)
|
|||||||
hrt_call_every(&serial_dma_call,
|
hrt_call_every(&serial_dma_call,
|
||||||
ts_to_abstime(&ts),
|
ts_to_abstime(&ts),
|
||||||
ts_to_abstime(&ts),
|
ts_to_abstime(&ts),
|
||||||
(hrt_callout)kinetis_serial_dma_poll,
|
(hrt_callout)kinetis_lpserial_dma_poll_all,
|
||||||
NULL);
|
NULL);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user