VLCB SDK
An opinionated SDK for VLCB protocol
Loading...
Searching...
No Matches
switch.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
vlcb/platform/time.h
"
4
#include <stdbool.h>
5
#include <stdint.h>
6
7
typedef
enum
{
8
VLCB_PLATFORM_SWITCH_RELEASED
,
9
VLCB_PLATFORM_SWITCH_PRESSED
,
10
}
VlcbPlatformSwitchState
;
11
12
typedef
VlcbPlatformSwitchState
(*
VlcbPlatformSwitchStatusResolver
)(void);
13
14
typedef
struct
{
15
VlcbPlatformSwitchState
state
;
16
bool
hasChanged
;
17
VlcbPlatformSwitchStatusResolver
resolver
;
18
clock_t
lastChangeAt
;
19
uint32_t
prevChangeLastedForMs
;
20
}
VlcbPlatformSwitchDriver
;
21
22
VlcbPlatformSwitchDriver
vlcb_platform_switch_New
(
VlcbPlatformSwitchStatusResolver
resolver);
VlcbPlatformSwitchDriver
Definition
switch.h:14
VlcbPlatformSwitchDriver::state
VlcbPlatformSwitchState state
Definition
switch.h:15
VlcbPlatformSwitchDriver::resolver
VlcbPlatformSwitchStatusResolver resolver
Definition
switch.h:17
VlcbPlatformSwitchDriver::hasChanged
bool hasChanged
Definition
switch.h:16
VlcbPlatformSwitchDriver::lastChangeAt
clock_t lastChangeAt
Definition
switch.h:18
VlcbPlatformSwitchDriver::prevChangeLastedForMs
uint32_t prevChangeLastedForMs
Definition
switch.h:19
VlcbPlatformSwitchStatusResolver
VlcbPlatformSwitchState(* VlcbPlatformSwitchStatusResolver)(void)
Definition
switch.h:12
vlcb_platform_switch_New
VlcbPlatformSwitchDriver vlcb_platform_switch_New(VlcbPlatformSwitchStatusResolver resolver)
VlcbPlatformSwitchState
VlcbPlatformSwitchState
Definition
switch.h:7
VLCB_PLATFORM_SWITCH_PRESSED
@ VLCB_PLATFORM_SWITCH_PRESSED
Definition
switch.h:9
VLCB_PLATFORM_SWITCH_RELEASED
@ VLCB_PLATFORM_SWITCH_RELEASED
Definition
switch.h:8
time.h
platform
inc
vlcb
platform
driver
switch.h
Generated on Mon Nov 4 2024 09:13:33 for VLCB SDK by
1.12.0