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
|
* implemented in dma_stm32_v*.c
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "dma_stm32.h"
|
#include <soc.h>
|
||||||
|
#include <init.h>
|
||||||
#define LOG_LEVEL CONFIG_DMA_LOG_LEVEL
|
#include <drivers/dma.h>
|
||||||
#include <logging/log.h>
|
#include <drivers/clock_control.h>
|
||||||
LOG_MODULE_REGISTER(dma_stm32);
|
|
||||||
|
|
||||||
#include <drivers/clock_control/stm32_clock_control.h>
|
#include <drivers/clock_control/stm32_clock_control.h>
|
||||||
|
|
||||||
static u32_t table_m_size[] = {
|
#include "dma_stm32.h"
|
||||||
LL_DMA_MDATAALIGN_BYTE,
|
|
||||||
LL_DMA_MDATAALIGN_HALFWORD,
|
|
||||||
LL_DMA_MDATAALIGN_WORD,
|
|
||||||
};
|
|
||||||
|
|
||||||
static u32_t table_p_size[] = {
|
#include <logging/log.h>
|
||||||
LL_DMA_PDATAALIGN_BYTE,
|
LOG_MODULE_REGISTER(dma_stm32, CONFIG_DMA_LOG_LEVEL);
|
||||||
LL_DMA_PDATAALIGN_HALFWORD,
|
|
||||||
LL_DMA_PDATAALIGN_WORD,
|
|
||||||
};
|
|
||||||
|
|
||||||
struct dma_stm32_stream {
|
#include <drivers/clock_control/stm32_clock_control.h>
|
||||||
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
|
|
||||||
|
|
||||||
static void dma_stm32_dump_stream_irq(struct device *dev, u32_t id)
|
static void dma_stm32_dump_stream_irq(struct device *dev, u32_t id)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,8 +4,46 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <drivers/dma.h>
|
#ifndef DMA_STM32_H_
|
||||||
#include <soc.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 table_ll_stream[];
|
||||||
extern u32_t (*func_ll_is_active_tc[])(DMA_TypeDef *DMAx);
|
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_mburst(struct dma_config *config, bool source_periph);
|
||||||
u32_t stm32_dma_get_pburst(struct dma_config *config, bool source_periph);
|
u32_t stm32_dma_get_pburst(struct dma_config *config, bool source_periph);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif /* DMA_STM32_H_*/
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue