Mario Hüttel
8bbc2e60f8
* Shellmatta implemented using UART * Version string implemented * Increased heap size * Add shellmatta printf support
25 lines
666 B
C
25 lines
666 B
C
#ifndef __DMA_RING_BUFFER_H__
|
|
#define __DMA_RING_BUFFER_H__
|
|
|
|
#include <stdbool.h>
|
|
#include <stm32f4xx.h>
|
|
#include <stddef.h>
|
|
|
|
struct dma_ring_buffer {
|
|
char *data_ptr;
|
|
size_t buffer_count;
|
|
DMA_Stream_TypeDef *dma;
|
|
size_t get_idx;
|
|
uint8_t base_dma_id;
|
|
};
|
|
|
|
int dma_ring_buffer_initialize(struct dma_ring_buffer *dma_buffer, uint8_t base_dma_id, DMA_Stream_TypeDef *dma_stream, size_t buffer_element_count, char *data_buffer, void *src_reg, uint8_t dma_trigger_channel);
|
|
int dma_ring_buffer_get_data(struct dma_ring_buffer *buff, const char **data_buff, size_t *len);
|
|
|
|
void dma_ring_buffer_stop(struct dma_ring_buffer *buff);
|
|
|
|
#endif /* __DMA_RING_BUFFER_H__ */
|
|
|
|
|
|
|