feat: add lab-rv32i-freertos-semaphore-notify card

This commit is contained in:
user
2026-07-21 19:14:20 +02:00
commit 3ae96a0d06
67 changed files with 37159 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
#ifndef K12_HOST_FREERTOS_H
#define K12_HOST_FREERTOS_H
#include <stdint.h>
typedef int32_t BaseType_t;
typedef uint32_t UBaseType_t;
typedef uint32_t TickType_t;
typedef void * TaskHandle_t;
struct MockSemaphore
{
UBaseType_t count;
UBaseType_t maximum;
};
typedef struct MockSemaphore * SemaphoreHandle_t;
typedef struct MockSemaphore StaticSemaphore_t;
#define pdFALSE ( ( BaseType_t ) 0 )
#define pdTRUE ( ( BaseType_t ) 1 )
#define pdFAIL ( ( BaseType_t ) 0 )
#define pdPASS ( ( BaseType_t ) 1 )
#endif
+16
View File
@@ -0,0 +1,16 @@
#ifndef K12_HOST_SEMPHR_H
#define K12_HOST_SEMPHR_H
#include "FreeRTOS.h"
#ifdef __cplusplus
extern "C" {
#endif
SemaphoreHandle_t xSemaphoreCreateBinaryStatic( StaticSemaphore_t * );
SemaphoreHandle_t xSemaphoreCreateCountingStatic( UBaseType_t, UBaseType_t, StaticSemaphore_t * );
BaseType_t xSemaphoreTake( SemaphoreHandle_t, TickType_t );
BaseType_t xSemaphoreGive( SemaphoreHandle_t );
UBaseType_t uxSemaphoreGetCount( SemaphoreHandle_t );
void vSemaphoreDelete( SemaphoreHandle_t );
#ifdef __cplusplus
}
#endif
#endif
+22
View File
@@ -0,0 +1,22 @@
#ifndef K12_HOST_TASK_H
#define K12_HOST_TASK_H
#include "FreeRTOS.h"
typedef enum eNotifyAction
{
eNoAction = 0,
eSetBits,
eIncrement,
eSetValueWithOverwrite,
eSetValueWithoutOverwrite
} eNotifyAction;
#ifdef __cplusplus
extern "C" {
#endif
BaseType_t xTaskNotifyGive( TaskHandle_t );
BaseType_t xTaskNotify( TaskHandle_t, uint32_t, eNotifyAction );
uint32_t ulTaskNotifyTake( BaseType_t, TickType_t );
BaseType_t xTaskNotifyWait( uint32_t, uint32_t, uint32_t *, TickType_t );
#ifdef __cplusplus
}
#endif
#endif