37#ifndef __ALT_DMA_PROGRAM_H__
38#define __ALT_DMA_PROGRAM_H__
78#define ALT_DMA_PROGRAM_CACHE_LINE_SIZE (32)
86#define ALT_DMA_PROGRAM_CACHE_LINE_COUNT (16)
101#ifndef ALT_DMA_PROGRAM_PROVISION_BUFFER_SIZE
102#define ALT_DMA_PROGRAM_PROVISION_BUFFER_SIZE (ALT_DMA_PROGRAM_CACHE_LINE_SIZE * ALT_DMA_PROGRAM_CACHE_LINE_COUNT)
114 uint16_t buffer_start;
286 uint32_t current, uint32_t * progress);
491 uint32_t iterations);
765#define ALT_DMA_CCR_OPT_SAF (0 << 0)
767#define ALT_DMA_CCR_OPT_SAI (1 << 0)
769#define ALT_DMA_CCR_OPT_SA_DEFAULT ALT_DMA_CCR_OPT_SAI
775#define ALT_DMA_CCR_OPT_SS8 (0 << 1)
777#define ALT_DMA_CCR_OPT_SS16 (1 << 1)
779#define ALT_DMA_CCR_OPT_SS32 (2 << 1)
781#define ALT_DMA_CCR_OPT_SS64 (3 << 1)
783#define ALT_DMA_CCR_OPT_SS128 (4 << 1)
785#define ALT_DMA_CCR_OPT_SS_DEFAULT ALT_DMA_CCR_OPT_SS8
791#define ALT_DMA_CCR_OPT_SB1 (0x0 << 4)
793#define ALT_DMA_CCR_OPT_SB2 (0x1 << 4)
795#define ALT_DMA_CCR_OPT_SB3 (0x2 << 4)
797#define ALT_DMA_CCR_OPT_SB4 (0x3 << 4)
799#define ALT_DMA_CCR_OPT_SB5 (0x4 << 4)
801#define ALT_DMA_CCR_OPT_SB6 (0x5 << 4)
803#define ALT_DMA_CCR_OPT_SB7 (0x6 << 4)
805#define ALT_DMA_CCR_OPT_SB8 (0x7 << 4)
807#define ALT_DMA_CCR_OPT_SB9 (0x8 << 4)
809#define ALT_DMA_CCR_OPT_SB10 (0x9 << 4)
811#define ALT_DMA_CCR_OPT_SB11 (0xa << 4)
813#define ALT_DMA_CCR_OPT_SB12 (0xb << 4)
815#define ALT_DMA_CCR_OPT_SB13 (0xc << 4)
817#define ALT_DMA_CCR_OPT_SB14 (0xd << 4)
819#define ALT_DMA_CCR_OPT_SB15 (0xe << 4)
821#define ALT_DMA_CCR_OPT_SB16 (0xf << 4)
823#define ALT_DMA_CCR_OPT_SB_DEFAULT ALT_DMA_CCR_OPT_SB1
829#define ALT_DMA_CCR_OPT_SP(imm3) ((imm3) << 8)
831#define ALT_DMA_CCR_OPT_SP_DEFAULT ALT_DMA_CCR_OPT_SP(0)
837#define ALT_DMA_CCR_OPT_SC(imm4) ((imm4) << 11)
839#define ALT_DMA_CCR_OPT_SC_DEFAULT ALT_DMA_CCR_OPT_SC(0)
845#define ALT_DMA_CCR_OPT_DAF (0 << 14)
847#define ALT_DMA_CCR_OPT_DAI (1 << 14)
849#define ALT_DMA_CCR_OPT_DA_DEFAULT ALT_DMA_CCR_OPT_DAI
855#define ALT_DMA_CCR_OPT_DS8 (0 << 15)
857#define ALT_DMA_CCR_OPT_DS16 (1 << 15)
859#define ALT_DMA_CCR_OPT_DS32 (2 << 15)
861#define ALT_DMA_CCR_OPT_DS64 (3 << 15)
863#define ALT_DMA_CCR_OPT_DS128 (4 << 15)
865#define ALT_DMA_CCR_OPT_DS_DEFAULT ALT_DMA_CCR_OPT_DS8
871#define ALT_DMA_CCR_OPT_DB1 (0x0 << 18)
873#define ALT_DMA_CCR_OPT_DB2 (0x1 << 18)
875#define ALT_DMA_CCR_OPT_DB3 (0x2 << 18)
877#define ALT_DMA_CCR_OPT_DB4 (0x3 << 18)
879#define ALT_DMA_CCR_OPT_DB5 (0x4 << 18)
881#define ALT_DMA_CCR_OPT_DB6 (0x5 << 18)
883#define ALT_DMA_CCR_OPT_DB7 (0x6 << 18)
885#define ALT_DMA_CCR_OPT_DB8 (0x7 << 18)
887#define ALT_DMA_CCR_OPT_DB9 (0x8 << 18)
889#define ALT_DMA_CCR_OPT_DB10 (0x9 << 18)
891#define ALT_DMA_CCR_OPT_DB11 (0xa << 18)
893#define ALT_DMA_CCR_OPT_DB12 (0xb << 18)
895#define ALT_DMA_CCR_OPT_DB13 (0xc << 18)
897#define ALT_DMA_CCR_OPT_DB14 (0xd << 18)
899#define ALT_DMA_CCR_OPT_DB15 (0xe << 18)
901#define ALT_DMA_CCR_OPT_DB16 (0xf << 18)
903#define ALT_DMA_CCR_OPT_DB_DEFAULT ALT_DMA_CCR_OPT_DB1
909#define ALT_DMA_CCR_OPT_DP(imm3) ((imm3) << 22)
911#define ALT_DMA_CCR_OPT_DP_DEFAULT ALT_DMA_CCR_OPT_DP(0)
917#define ALT_DMA_CCR_OPT_DC(imm4) ((imm4) << 25)
919#define ALT_DMA_CCR_OPT_DC_DEFAULT ALT_DMA_CCR_OPT_DC(0)
925#define ALT_DMA_CCR_OPT_ES8 (0 << 28)
927#define ALT_DMA_CCR_OPT_ES16 (1 << 28)
929#define ALT_DMA_CCR_OPT_ES32 (2 << 28)
931#define ALT_DMA_CCR_OPT_ES64 (3 << 28)
933#define ALT_DMA_CCR_OPT_ES128 (4 << 28)
935#define ALT_DMA_CCR_OPT_ES_DEFAULT ALT_DMA_CCR_OPT_ES8
938#define ALT_DMA_CCR_OPT_DEFAULT \
939 (ALT_DMA_CCR_OPT_SB1 | ALT_DMA_CCR_OPT_SS8 | ALT_DMA_CCR_OPT_SAI | \
940 ALT_DMA_CCR_OPT_SP(0) | ALT_DMA_CCR_OPT_SC(0) | \
941 ALT_DMA_CCR_OPT_DB1 | ALT_DMA_CCR_OPT_DS8 | ALT_DMA_CCR_OPT_DAI | \
942 ALT_DMA_CCR_OPT_DP(0) | ALT_DMA_CCR_OPT_DC(0) | \
enum ALT_DMA_PERIPH_e ALT_DMA_PERIPH_t
enum ALT_DMA_CHANNEL_e ALT_DMA_CHANNEL_t
enum ALT_DMA_EVENT_e ALT_DMA_EVENT_t
enum ALT_DMA_SECURITY_e ALT_DMA_SECURITY_t
ALT_STATUS_CODE alt_dma_program_update_reg(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_REG_t reg, uint32_t val)
Definition: alt_dma_program.c:187
ALT_STATUS_CODE alt_dma_program_DMANOP(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:764
enum ALT_DMA_PROGRAM_INST_MOD_e ALT_DMA_PROGRAM_INST_MOD_t
ALT_STATUS_CODE alt_dma_program_DMAGO(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_CHANNEL_t channel, uint32_t val, ALT_DMA_SECURITY_t sec)
Definition: alt_dma_program.c:355
ALT_STATUS_CODE alt_dma_program_validate(const ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:117
ALT_STATUS_CODE alt_dma_program_DMALPEND(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_INST_MOD_t mod)
Definition: alt_dma_program.c:574
ALT_STATUS_CODE alt_dma_program_DMASTZ(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:933
ALT_STATUS_CODE alt_dma_program_DMAFLUSHP(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PERIPH_t periph)
Definition: alt_dma_program.c:325
ALT_STATUS_CODE alt_dma_program_DMAWFP(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PERIPH_t periph, ALT_DMA_PROGRAM_INST_MOD_t mod)
Definition: alt_dma_program.c:1003
ALT_STATUS_CODE alt_dma_program_DMAEND(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:300
ALT_STATUS_CODE alt_dma_program_DMAKILL(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:415
ALT_STATUS_CODE alt_dma_program_DMAADDH(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_REG_t addr_reg, uint16_t val)
Definition: alt_dma_program.c:222
ALT_STATUS_CODE alt_dma_program_DMALD(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_INST_MOD_t mod)
Definition: alt_dma_program.c:437
ALT_DMA_PROGRAM_REG_e
Definition: alt_dma_program.h:138
ALT_STATUS_CODE alt_dma_program_DMAST(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_INST_MOD_t mod)
Definition: alt_dma_program.c:849
ALT_STATUS_CODE alt_dma_program_DMASEV(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_EVENT_t evt)
Definition: alt_dma_program.c:808
ALT_DMA_PROGRAM_INST_MOD_e
Definition: alt_dma_program.h:171
ALT_STATUS_CODE alt_dma_program_init(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:80
ALT_STATUS_CODE alt_dma_program_DMAADNH(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_REG_t addr_reg, uint16_t val)
Definition: alt_dma_program.c:261
ALT_STATUS_CODE alt_dma_program_DMAMOV(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_REG_t chan_reg, uint32_t val)
Definition: alt_dma_program.c:703
ALT_STATUS_CODE alt_dma_program_progress_reg(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_REG_t reg, uint32_t current, uint32_t *progress)
Definition: alt_dma_program.c:147
struct ALT_DMA_PROGRAM_s ALT_DMA_PROGRAM_t
ALT_STATUS_CODE alt_dma_program_DMASTP(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_INST_MOD_t mod, ALT_DMA_PERIPH_t periph)
Definition: alt_dma_program.c:889
ALT_STATUS_CODE alt_dma_program_DMALDP(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_PROGRAM_INST_MOD_t mod, ALT_DMA_PERIPH_t periph)
Definition: alt_dma_program.c:477
ALT_STATUS_CODE alt_dma_program_uninit(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:98
ALT_STATUS_CODE alt_dma_program_DMALP(ALT_DMA_PROGRAM_t *pgm, uint32_t iterations)
Definition: alt_dma_program.c:521
ALT_STATUS_CODE alt_dma_program_DMALPFE(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:672
ALT_STATUS_CODE alt_dma_program_DMARMB(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:786
ALT_STATUS_CODE alt_dma_program_DMAWMB(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:1050
enum ALT_DMA_PROGRAM_REG_e ALT_DMA_PROGRAM_REG_t
#define ALT_DMA_PROGRAM_PROVISION_BUFFER_SIZE
Definition: alt_dma_program.h:102
ALT_STATUS_CODE alt_dma_program_DMAWFE(ALT_DMA_PROGRAM_t *pgm, ALT_DMA_EVENT_t evt, bool invalid)
Definition: alt_dma_program.c:955
#define ALT_DMA_PROGRAM_CACHE_LINE_SIZE
Definition: alt_dma_program.h:78
ALT_STATUS_CODE alt_dma_program_clear(ALT_DMA_PROGRAM_t *pgm)
Definition: alt_dma_program.c:103
@ ALT_DMA_PROGRAM_REG_SAR
Definition: alt_dma_program.h:140
@ ALT_DMA_PROGRAM_REG_CCR
Definition: alt_dma_program.h:146
@ ALT_DMA_PROGRAM_REG_DAR
Definition: alt_dma_program.h:143
@ ALT_DMA_PROGRAM_INST_MOD_BURST
Definition: alt_dma_program.h:190
@ ALT_DMA_PROGRAM_INST_MOD_SINGLE
Definition: alt_dma_program.h:183
@ ALT_DMA_PROGRAM_INST_MOD_PERIPH
Definition: alt_dma_program.h:196
@ ALT_DMA_PROGRAM_INST_MOD_NONE
Definition: alt_dma_program.h:176
int32_t ALT_STATUS_CODE
Definition: hwlib.h:60
Definition: alt_dma_program.h:111