muteki
Loading...
Searching...
No Matches
system.h
Go to the documentation of this file.
1/*
2 * Copyright 2024-present dogtopus
3 * SPDX-License-Identifier: MIT
4 */
5
11#ifndef __MUTEKI_SYSTEM_H__
12#define __MUTEKI_SYSTEM_H__
13
14#include <muteki/common.h>
15
16#ifdef __cplusplus
17extern "C" {
18#endif
19
34
38typedef struct {
42 float voltage;
55 unsigned short unk_0x8;
60 unsigned short level;
65 unsigned char unk_0xc;
67
71typedef void (*timer1_callback_t)(void);
72
81extern bool Buzzer(int frequency, short duration);
82
96extern void SetTimer1IntHandler(timer1_callback_t callback, short interval);
97
105
112extern void SysPowerOff(void);
113
121extern int GetBatteryType(void);
122
132extern char *_GetSystemDirectory(char *buffer, size_t size);
133
144extern short GetBatteryValue(short sbz, power_battery_status_t *output);
145
146#ifdef __cplusplus
147} // extern "C"
148#endif
149
150#endif // __MUTEKI_SYSTEM_H__
Common include file for all muteki-shims headers.
Current battery status.
Definition system.h:38
short query_result
GetBatteryValue() query result.
Definition system.h:51
float voltage
Current battery voltage.
Definition system.h:42
unsigned char unk_0xc
Unknown.
Definition system.h:65
unsigned short unk_0x8
Unknown.
Definition system.h:55
short param_1_value
Unknown.
Definition system.h:47
unsigned short level
Battery level.
Definition system.h:60
void SysPowerOff(void)
Power off the system immediately.
void SetTimer1IntHandler(timer1_callback_t callback, short interval)
Set Timer1 interrupt handler.
int GetBatteryType(void)
Get the system power source type.
char * _GetSystemDirectory(char *buffer, size_t size)
Get the DOS 8.3 path to the system configuration directory on user data partition.
timer1_callback_t GetTimer1IntHandler(short *interval)
Get the Timer1 interrupt handler and custom interval.
power_source_type_e
Power status.
Definition system.h:23
@ POWER_SOURCE_AC
System on AC power.
Definition system.h:32
@ POWER_SOURCE_BATTERY
System on battery power.
Definition system.h:28
void(* timer1_callback_t)(void)
Callback type for Timer1 interrupt.
Definition system.h:71
bool Buzzer(int frequency, short duration)
Play a tone using the built in piezo speaker.
short GetBatteryValue(short sbz, power_battery_status_t *output)
Read the battery voltage and level.