git subrepo pull components/f4ll_c
subrepo: subdir: "components/f4ll_c" merged: "4754b65" upstream: origin: "git@git.pcmuhely.hu:compi/f4ll_c.git" branch: "master" commit: "4754b65" git-subrepo: version: "0.4.0" origin: "https://github.com/ingydotnet/git-subrepo" commit: "5d6aba9"
This commit is contained in:
parent
6f89e70a2a
commit
357b30b344
11 changed files with 140 additions and 72 deletions
|
@ -17,6 +17,10 @@
|
|||
#include <platform/crc_ll.h>
|
||||
#include <f4ll_c/dmahelper.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct crcslottask_t {
|
||||
void * volatile address;
|
||||
uint16_t wordCount;
|
||||
|
@ -35,30 +39,38 @@ struct crcstatus_t {
|
|||
struct dmainfo_t dmaInfo;
|
||||
struct crcslotlistitem_t *activeSlot;
|
||||
uint8_t activeTask;
|
||||
struct crcslotlistitem_t *first;
|
||||
struct crcslotlistitem_t *firstSlot;
|
||||
};
|
||||
|
||||
void Crc_InitStatus(struct crcstatus_t *status, CRC_TypeDef *crcUnit, DMA_TypeDef *dma, uint32_t stream);
|
||||
|
||||
uint8_t Crc_GetActiveTask(struct crcslotlistitem_t **slot_out, struct crcstatus_t volatile *status);
|
||||
|
||||
static inline uint8_t Crc_IsSlotQueued(struct crcslotlistitem_t volatile *slot, uint8_t task) {
|
||||
return slot->tasks[task].address != NULL;
|
||||
static inline uint8_t Crc_IsSlotQueued(struct crcslotlistitem_t *slot, uint8_t task) {
|
||||
return ((struct crcslottask_t volatile)slot->tasks[task]).address != NULL;
|
||||
}
|
||||
|
||||
static inline uint8_t Crc_IsSlotActive(struct crcslotlistitem_t volatile *slot, uint8_t task) {
|
||||
return slot->tasks[task].callback != NULL || slot->tasks[task].callbackParam != NULL;
|
||||
static inline uint8_t Crc_IsSlotBusy(struct crcslotlistitem_t *slot, uint8_t task) {
|
||||
struct crcslottask_t volatile *taskPtr = &slot->tasks[task];
|
||||
return taskPtr->callback != NULL || taskPtr->callbackParam != NULL;
|
||||
}
|
||||
|
||||
static inline void Crc_WaitResults(struct crcstatus_t *status, struct crcslotlistitem_t *slot, uint8_t task) {
|
||||
while(Crc_IsSlotBusy(slot, task));
|
||||
}
|
||||
|
||||
void Crc_AttachTask(struct crcstatus_t *status, struct crcslotlistitem_t *slot, struct crcslottask_t *tasks, uint8_t taskCount);
|
||||
|
||||
uint8_t Crc_Enqueue(struct crcstatus_t *status, struct crcslotlistitem_t *slot, uint8_t task,
|
||||
uint8_t *address, uint16_t len, void (*callback)(void*, uint32_t, uint8_t), void* callbackParam);
|
||||
void Crc_WaitResults(struct crcstatus_t *status, struct crcslotlistitem_t *slot, uint8_t task);
|
||||
uint32_t Crc_Compute(struct crcstatus_t *status, struct crcslotlistitem_t *slot, uint8_t task, uint8_t *address, uint16_t len);
|
||||
void Crc_ComputeAsync(struct crcstatus_t *status, uint8_t slot,
|
||||
uint8_t *address, uint16_t len,
|
||||
void (*callback)(void*, uint32_t, uint8_t), void* callbackParam);
|
||||
void Crc_HandleDmaIrq(struct crcstatus_t *status);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CRC_HANDLER_H_ */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue