Files
ss/include/rvl/OS/OSAlarm.h
T
Elijah Thomas 26af4db82d update from dtk-template - clangd :) (#66)
* update from dtk-template and start work towards using clangd

* include <a> -> "a"

* Update build.yml

* remove/add non-trivial class in union warning
2024-10-16 15:36:02 -04:00

43 lines
1.1 KiB
C

#ifndef RVL_SDK_OS_ALARM_H
#define RVL_SDK_OS_ALARM_H
#include "common.h"
#ifdef __cplusplus
extern "C" {
#endif
// Forward declarations
typedef struct OSAlarm;
typedef struct OSContext;
typedef void (*OSAlarmHandler)(struct OSAlarm *alarm, struct OSContext *ctx);
typedef struct OSAlarm {
OSAlarmHandler handler; // at 0x0
u32 tag; // at 0x4
s64 end;
struct OSAlarm *prev; // at 0x10
struct OSAlarm *next; // at 0x14
s64 period; // at 0x18
s64 start; // at 0x20
void *userData; // at 0x28
} OSAlarm;
typedef struct OSAlarmQueue {
OSAlarm *head; // at 0x0
OSAlarm *tail; // at 0x4
} OSAlarmQueue;
void __OSInitAlarm(void);
void OSCreateAlarm(OSAlarm *alarm);
void OSSetAlarm(OSAlarm *alarm, s64 tick, OSAlarmHandler handler);
void OSSetPeriodicAlarm(OSAlarm *alarm, s64 tick, s64 period, OSAlarmHandler handler);
void OSCancelAlarm(OSAlarm *alarm);
void OSSetAlarmTag(OSAlarm *alarm, u32 tag);
void OSSetAlarmUserData(OSAlarm *alarm, void *userData);
void *OSGetAlarmUserData(const OSAlarm *alarm);
#ifdef __cplusplus
}
#endif
#endif