Skip to content

Commit

Permalink
grlib-multi: add DMA support to UART driver
Browse files Browse the repository at this point in the history
JIRA: RTOS-748
  • Loading branch information
lukileczo committed Feb 19, 2024
1 parent 951f229 commit 997a4cf
Show file tree
Hide file tree
Showing 3 changed files with 239 additions and 30 deletions.
12 changes: 6 additions & 6 deletions dma/grdmac2/grdmac2.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,27 +50,27 @@

void grdma_setup(grdma_ctx_t *ctx, void *first)
{
ctx->base[GRDMAC2_CTRL] = CTRL_RST;
ctx->base[GRDMAC2_TIMER] = 0xffffffff;
ctx->base[GRDMAC2_FIRST] = (uintptr_t)first;
*(ctx->base + GRDMAC2_CTRL) = CTRL_RST;
*(ctx->base + GRDMAC2_TIMER) = 0xffffffff;
*(ctx->base + GRDMAC2_FIRST) = (uintptr_t)first;
}


void grdma_start(grdma_ctx_t *ctx)
{
ctx->base[GRDMAC2_CTRL] = CTRL_EN | CTRL_IE;
*(ctx->base + GRDMAC2_CTRL) = CTRL_EN | CTRL_IE;
}


void grdma_restart(grdma_ctx_t *ctx)
{
ctx->base[GRDMAC2_CTRL] |= CTRL_RT;
*(ctx->base + GRDMAC2_CTRL) |= CTRL_RT;
}


bool grdma_finished(grdma_ctx_t *ctx)
{
return (ctx->base[GRDMAC2_STS] & 0x1) != 0;
return (*(ctx->base + GRDMAC2_STS) & 0x1) != 0;
}


Expand Down
2 changes: 1 addition & 1 deletion multi/grlib-multi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
NAME := grlib-multi
LOCAL_SRCS := adc.c gpio.c spacewire.c spi.c uart.c grlib-multi.c
LOCAL_HEADERS := grlib-multi.h
DEP_LIBS := libtty libklog libpseudodev
DEP_LIBS := libtty libklog libpseudodev libgrdmac2

include $(binary.mk)
Loading

0 comments on commit 997a4cf

Please sign in to comment.