feat: add lab-rv32i-freertos-queue card
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
#ifndef K10_HOST_FREERTOS_H
|
||||
#define K10_HOST_FREERTOS_H
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
typedef int32_t BaseType_t;
|
||||
typedef uint32_t UBaseType_t;
|
||||
typedef uint32_t TickType_t;
|
||||
struct QueueDefinition
|
||||
{
|
||||
UBaseType_t capacity;
|
||||
UBaseType_t item_size;
|
||||
uint8_t * storage;
|
||||
UBaseType_t head;
|
||||
UBaseType_t tail;
|
||||
UBaseType_t count;
|
||||
BaseType_t dynamic_control;
|
||||
};
|
||||
typedef struct QueueDefinition * QueueHandle_t;
|
||||
typedef struct QueueDefinition StaticQueue_t;
|
||||
#define pdFALSE ( ( BaseType_t ) 0 )
|
||||
#define pdTRUE ( ( BaseType_t ) 1 )
|
||||
#define pdFAIL ( ( BaseType_t ) 0 )
|
||||
#define pdPASS ( ( BaseType_t ) 1 )
|
||||
#endif
|
||||
@@ -0,0 +1,24 @@
|
||||
#ifndef K10_HOST_QUEUE_H
|
||||
#define K10_HOST_QUEUE_H
|
||||
#include "FreeRTOS.h"
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
QueueHandle_t k10_create_dynamic( UBaseType_t, UBaseType_t );
|
||||
QueueHandle_t k10_create_static( UBaseType_t, UBaseType_t, uint8_t *, StaticQueue_t * );
|
||||
BaseType_t k10_send( QueueHandle_t, const void *, TickType_t );
|
||||
BaseType_t k10_receive( QueueHandle_t, void *, TickType_t );
|
||||
UBaseType_t uxQueueMessagesWaiting( QueueHandle_t );
|
||||
void vQueueDelete( QueueHandle_t );
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#define xQueueCreate( capacity, item_size ) \
|
||||
k10_create_dynamic( ( capacity ), ( item_size ) )
|
||||
#define xQueueCreateStatic( capacity, item_size, bytes, control ) \
|
||||
k10_create_static( ( capacity ), ( item_size ), ( bytes ), ( control ) )
|
||||
#define xQueueSend( queue, item, timeout ) \
|
||||
k10_send( ( queue ), ( item ), ( timeout ) )
|
||||
#define xQueueReceive( queue, item, timeout ) \
|
||||
k10_receive( ( queue ), ( item ), ( timeout ) )
|
||||
#endif
|
||||
Reference in New Issue
Block a user