Muteki
EABI code execution on Besta® RTOS devices.
Toggle main menu visibility
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
10
11
#ifndef __MUTEKI_SYSTEM_H__
12
#define __MUTEKI_SYSTEM_H__
13
14
#include "
common.h
"
15
16
#ifdef __cplusplus
17
extern
"C"
{
18
#endif
19
23
enum
power_source_type_e
{
28
POWER_SOURCE_BATTERY
= 1,
32
POWER_SOURCE_AC
= 4,
33
};
34
38
typedef
struct
{
42
float
voltage
;
47
short
param_1_value
;
51
short
query_result
;
55
unsigned
short
unk_0x8
;
60
unsigned
short
level
;
65
unsigned
char
unk_0xc
;
66
}
power_battery_status_t
;
67
71
typedef
void (*
timer1_callback_t
)(void);
72
81
extern
bool
Buzzer
(
int
frequency,
short
duration);
82
96
extern
void
SetTimer1IntHandler
(
timer1_callback_t
callback,
short
interval);
97
104
extern
timer1_callback_t
GetTimer1IntHandler
(
short
*interval);
105
112
extern
void
SysPowerOff
(
void
);
113
121
extern
int
GetBatteryType
(
void
);
122
132
extern
char
*
_GetSystemDirectory
(
char
*buffer,
size_t
size);
133
144
extern
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.h
Common include file for all muteki-shims headers.
power_battery_status_t
Current battery status.
Definition
system.h:38
power_battery_status_t::query_result
short query_result
GetBatteryValue() query result.
Definition
system.h:51
power_battery_status_t::voltage
float voltage
Current battery voltage.
Definition
system.h:42
power_battery_status_t::unk_0xc
unsigned char unk_0xc
Unknown.
Definition
system.h:65
power_battery_status_t::unk_0x8
unsigned short unk_0x8
Unknown.
Definition
system.h:55
power_battery_status_t::param_1_value
short param_1_value
Unknown.
Definition
system.h:47
power_battery_status_t::level
unsigned short level
Battery level.
Definition
system.h:60
SysPowerOff
void SysPowerOff(void)
Power off the system immediately.
SetTimer1IntHandler
void SetTimer1IntHandler(timer1_callback_t callback, short interval)
Set Timer1 interrupt handler.
GetBatteryType
int GetBatteryType(void)
Get the system power source type.
_GetSystemDirectory
char * _GetSystemDirectory(char *buffer, size_t size)
Get the DOS 8.3 path to the system configuration directory on user data partition.
GetTimer1IntHandler
timer1_callback_t GetTimer1IntHandler(short *interval)
Get the Timer1 interrupt handler and custom interval.
power_source_type_e
power_source_type_e
Power status.
Definition
system.h:23
POWER_SOURCE_AC
@ POWER_SOURCE_AC
System on AC power.
Definition
system.h:32
POWER_SOURCE_BATTERY
@ POWER_SOURCE_BATTERY
System on battery power.
Definition
system.h:28
timer1_callback_t
void(*) timer1_callback_t(void)
Callback type for Timer1 interrupt.
Definition
system.h:71
Buzzer
bool Buzzer(int frequency, short duration)
Play a tone using the built in piezo speaker.
GetBatteryValue
short GetBatteryValue(short sbz, power_battery_status_t *output)
Read the battery voltage and level.
include
muteki
system.h
Generated by
1.18.0