ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
ra8_fs_seams.h
Go to the documentation of this file.
1
34
35#pragma once
36
37#ifdef __cplusplus
38extern "C" {
39#endif
40
41#include <stdint.h>
42
43#include "ra8_err.h"
44#include "ra8_fs_types.h"
45
46/* =============================================================================
47 * Optional lock seam
48 * =============================================================================
49 */
50
89typedef struct {
94 void (*acquire)(void* ctx);
95
100 void (*release)(void* ctx);
101
103 void* ctx;
105
155[[nodiscard]] ra8_err_t ra8_fs_set_lock(const ra8_fs_lock_t* lock);
156
157/* =============================================================================
158 * Wall-clock seam (dependency injection)
159 * =============================================================================
160 */
161
194typedef struct {
203
205 void* ctx;
207
248[[nodiscard]] ra8_err_t ra8_fs_set_clock(const ra8_fs_clock_t* clock);
249
250#ifdef __cplusplus
251}
252#endif
Error Code Definitions for ra8-firmware.
ra8_err_codes_t ra8_err_t
Canonical error-return type used by every ra8-firmware API.
Definition ra8_err.h:546
ra8_err_t ra8_fs_set_lock(const ra8_fs_lock_t *lock)
Install (or remove) the lock taken around every public ra8_fs call.
ra8_err_t ra8_fs_set_clock(const ra8_fs_clock_t *clock)
Install (or remove) the calendar source used to stamp files.
On-disk and handle data types shared by the ra8_fs public API.
Caller-supplied calendar source used to stamp files.
void * ctx
Caller-owned context passed back into now.
ra8_err_t(* now)(void *ctx, ra8_fs_datetime_t *out)
Report the current civil time.
Broken-down civil date and time used at the filesystem boundary.
Dependency-injection seam for mutual exclusion around the public API.
void(* release)(void *ctx)
Release the lock taken by the matching acquire call.
void * ctx
Caller-owned cookie handed back to both callbacks.
void(* acquire)(void *ctx)
Take the lock; must block until it is held.