2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _DOLPHIN_ARQ
|
|
|
|
#define _DOLPHIN_ARQ
|
2022-09-13 04:26:54 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
#include "dolphin/ar.h"
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-01-16 05:20:58 +00:00
|
|
|
#include "dolphin/ar.h"
|
|
|
|
|
|
|
|
#define ARQ_DMA_ALIGNMENT 32
|
|
|
|
#define ARQ_CHUNK_SIZE_DEFAULT 4096
|
|
|
|
|
|
|
|
#define ARQ_TYPE_MRAM_TO_ARAM ARAM_DIR_MRAM_TO_ARAM
|
|
|
|
#define ARQ_TYPE_ARAM_TO_MRAM ARAM_DIR_ARAM_TO_MRAM
|
|
|
|
|
|
|
|
#define ARQ_PRIORITY_LOW 0
|
|
|
|
#define ARQ_PRIORITY_HIGH 1
|
|
|
|
|
2023-01-14 09:26:24 +00:00
|
|
|
typedef void (*ARQCallback)(u32 pointerToARQRequest);
|
|
|
|
|
2023-01-16 05:20:58 +00:00
|
|
|
typedef struct ARQRequest {
|
|
|
|
|
|
|
|
struct ARQRequest* next;
|
2023-01-14 09:26:24 +00:00
|
|
|
u32 owner;
|
|
|
|
u32 type;
|
|
|
|
u32 priority;
|
|
|
|
u32 source;
|
|
|
|
u32 dest;
|
|
|
|
u32 length;
|
|
|
|
ARQCallback callback;
|
2023-01-16 05:20:58 +00:00
|
|
|
|
|
|
|
} ARQRequest;
|
2023-01-14 09:26:24 +00:00
|
|
|
|
2022-09-13 04:26:54 +00:00
|
|
|
void ARQInit(void);
|
2023-01-16 05:20:58 +00:00
|
|
|
void ARQReset(void);
|
|
|
|
void ARQPostRequest(ARQRequest* task, u32 owner, u32 type, u32 priority, u32 source, u32 dest,
|
|
|
|
u32 length, ARQCallback callback);
|
2023-02-28 07:28:33 +00:00
|
|
|
void ARQRemoveRequest(ARQRequest* task);
|
|
|
|
void ARQRemoveOwnerRequest(u32 owner);
|
|
|
|
void ARQFlushQueue(void);
|
|
|
|
void ARQSetChunkSize(u32 size);
|
2023-01-16 05:20:58 +00:00
|
|
|
u32 ARQGetChunkSize(void);
|
2023-02-28 07:28:33 +00:00
|
|
|
BOOL ARQCheckInit(void);
|
2022-09-13 04:26:54 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _DOLPHIN_ARQ
|