driver: dma: split header file differently
This patches just changes the header file organisation Signed-off-by: Francois Ramu <francois.ramu@st.com>
This commit is contained in:
parent
53dec09037
commit
3553d4fa69
2 changed files with 50 additions and 43 deletions
|
@ -11,51 +11,18 @@
|
|||
* implemented in dma_stm32_v*.c
|
||||
*/
|
||||
|
||||
#include "dma_stm32.h"
|
||||
|
||||
#define LOG_LEVEL CONFIG_DMA_LOG_LEVEL
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(dma_stm32);
|
||||
|
||||
#include <soc.h>
|
||||
#include <init.h>
|
||||
#include <drivers/dma.h>
|
||||
#include <drivers/clock_control.h>
|
||||
#include <drivers/clock_control/stm32_clock_control.h>
|
||||
|
||||
static u32_t table_m_size[] = {
|
||||
LL_DMA_MDATAALIGN_BYTE,
|
||||
LL_DMA_MDATAALIGN_HALFWORD,
|
||||
LL_DMA_MDATAALIGN_WORD,
|
||||
};
|
||||
#include "dma_stm32.h"
|
||||
|
||||
static u32_t table_p_size[] = {
|
||||
LL_DMA_PDATAALIGN_BYTE,
|
||||
LL_DMA_PDATAALIGN_HALFWORD,
|
||||
LL_DMA_PDATAALIGN_WORD,
|
||||
};
|
||||
#include <logging/log.h>
|
||||
LOG_MODULE_REGISTER(dma_stm32, CONFIG_DMA_LOG_LEVEL);
|
||||
|
||||
struct dma_stm32_stream {
|
||||
u32_t direction;
|
||||
bool source_periph;
|
||||
bool busy;
|
||||
u32_t src_size;
|
||||
u32_t dst_size;
|
||||
void *callback_arg;
|
||||
void (*dma_callback)(void *arg, u32_t id,
|
||||
int error_code);
|
||||
};
|
||||
|
||||
struct dma_stm32_data {
|
||||
int max_streams;
|
||||
struct dma_stm32_stream *streams;
|
||||
};
|
||||
|
||||
struct dma_stm32_config {
|
||||
struct stm32_pclken pclken;
|
||||
void (*config_irq)(struct device *dev);
|
||||
bool support_m2m;
|
||||
u32_t base;
|
||||
};
|
||||
|
||||
/* Maximum data sent in single transfer (Bytes) */
|
||||
#define DMA_STM32_MAX_DATA_ITEMS 0xffff
|
||||
#include <drivers/clock_control/stm32_clock_control.h>
|
||||
|
||||
static void dma_stm32_dump_stream_irq(struct device *dev, u32_t id)
|
||||
{
|
||||
|
|
|
@ -4,8 +4,46 @@
|
|||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <drivers/dma.h>
|
||||
#include <soc.h>
|
||||
#ifndef DMA_STM32_H_
|
||||
#define DMA_STM32_H_
|
||||
|
||||
static u32_t table_m_size[] = {
|
||||
LL_DMA_MDATAALIGN_BYTE,
|
||||
LL_DMA_MDATAALIGN_HALFWORD,
|
||||
LL_DMA_MDATAALIGN_WORD,
|
||||
};
|
||||
|
||||
static u32_t table_p_size[] = {
|
||||
LL_DMA_PDATAALIGN_BYTE,
|
||||
LL_DMA_PDATAALIGN_HALFWORD,
|
||||
LL_DMA_PDATAALIGN_WORD,
|
||||
};
|
||||
|
||||
/* Maximum data sent in single transfer (Bytes) */
|
||||
#define DMA_STM32_MAX_DATA_ITEMS 0xffff
|
||||
|
||||
struct dma_stm32_stream {
|
||||
u32_t direction;
|
||||
bool source_periph;
|
||||
bool busy;
|
||||
u32_t src_size;
|
||||
u32_t dst_size;
|
||||
void *callback_arg;
|
||||
void (*dma_callback)(void *arg, u32_t id,
|
||||
int error_code);
|
||||
};
|
||||
|
||||
struct dma_stm32_data {
|
||||
int max_streams;
|
||||
struct dma_stm32_stream *streams;
|
||||
};
|
||||
|
||||
struct dma_stm32_config {
|
||||
struct stm32_pclken pclken;
|
||||
void (*config_irq)(struct device *dev);
|
||||
bool support_m2m;
|
||||
u32_t base;
|
||||
};
|
||||
|
||||
extern u32_t table_ll_stream[];
|
||||
extern u32_t (*func_ll_is_active_tc[])(DMA_TypeDef *DMAx);
|
||||
|
@ -30,3 +68,5 @@ u32_t stm32_dma_get_fifo_threshold(u16_t fifo_mode_control);
|
|||
u32_t stm32_dma_get_mburst(struct dma_config *config, bool source_periph);
|
||||
u32_t stm32_dma_get_pburst(struct dma_config *config, bool source_periph);
|
||||
#endif
|
||||
|
||||
#endif /* DMA_STM32_H_*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue