|
muteki
|
System management functions. More...
#include <muteki/common.h>Go to the source code of this file.
Data Structures | |
| struct | power_battery_status_t |
| Current battery status. More... | |
Typedefs | |
| typedef void(* | timer1_callback_t) (void) |
| Callback type for Timer1 interrupt. | |
Enumerations | |
| enum | power_source_type_e { POWER_SOURCE_BATTERY = 1 , POWER_SOURCE_AC = 4 } |
| Power status. More... | |
Functions | |
| bool | Buzzer (int frequency, short duration) |
| Play a tone using the built in piezo speaker. | |
| void | SetTimer1IntHandler (timer1_callback_t callback, short interval) |
| Set Timer1 interrupt handler. | |
| timer1_callback_t | GetTimer1IntHandler (short *interval) |
| Get the Timer1 interrupt handler and custom interval. | |
| void | SysPowerOff (void) |
| Power off the system immediately. | |
| 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. | |
| short | GetBatteryValue (short sbz, power_battery_status_t *output) |
| Read the battery voltage and level. | |
System management functions.
| enum power_source_type_e |
|
extern |
Get the DOS 8.3 path to the system configuration directory on user data partition.
This function will also ensure that the path exists before returning it. Although if the function fails, no directory will be created.
0x1010e | buffer | The buffer to hold the path. |
| size | The size of the buffer. |
NULL if the function fails.
|
extern |
Play a tone using the built in piezo speaker.
This will block the execution.
0x1002c | frequency | Frequency of the tone in Hz. |
| duration | Duration of the tone in milliseconds. |
| true | The operation was completed successfully. |
|
extern |
Get the system power source type.
0x10035
|
extern |
Read the battery voltage and level.
Requires -lkrnllib when dynamically linking with the shims.
output points to is not zero filled. 0x2001a | sbz | Unknown. Should be set to 0. |
| output | Pointer to a battery status info struct that will contain the returned values. |
| 0 | The operation was completed successfully. |
|
extern |
Get the Timer1 interrupt handler and custom interval.
0x10030 | [out] | interval | A pointer to a variable that will hold the timer interval. Must not be NULL. |
|
extern |
Set Timer1 interrupt handler.
The callback function passed to this will be called once every time the timer fires. The exact interval can be manually specified.
0x1002e | callback | The callback function called when timer fires, or NULL to unset a previously set callback. |
| interval | An interval value in 10 milliseconds increments (1 means 10ms, 2 means 20, etc.), or defaulting to 1 when set to 0. |
|
extern |
Power off the system immediately.
0x10032