libctru
v2.4.1
|
PTMSYSM service. More...
#include <3ds/types.h>
Go to the source code of this file.
Data Structures | |
struct | PtmWakeEvents |
PDN wake events and MCU interrupts to select, combined with those of other processes. More... | |
struct | PtmSleepConfig |
Enumerations | |
enum | { PTMNOTIFID_SLEEP_REQUESTED = 0x101 , PTMNOTIFID_SLEEP_DENIED = 0x102 , PTMNOTIFID_SLEEP_ALLOWED = 0x103 , PTMNOTIFID_GOING_TO_SLEEP = 0x104 , PTMNOTIFID_FULLY_WAKING_UP = 0x105 , PTMNOTIFID_FULLY_AWAKE = 0x106 , PTMNOTIFID_HALF_AWAKE = 0x107 , PTMNOTIFID_SHUTDOWN = 0x108 , PTMNOTIFID_BATTERY_VERY_LOW = 0x211 , PTMNOTIFID_BATTERY_LOW = 0x212 } |
Functions | |
static s32 | ptmSysmGetNotificationAckValue (u32 id) |
See PTMSYSM_NotifySleepPreparationComplete. Corresponds to the number of potentially remaning notifs. until sleep/wakeup. | |
Result | ptmSysmInit (void) |
Initializes ptm:sysm. | |
void | ptmSysmExit (void) |
Exits ptm:sysm. | |
Handle * | ptmSysmGetSessionHandle (void) |
Gets a pointer to the current ptm:sysm session handle. More... | |
Result | PTMSYSM_RequestSleep (void) |
Requests to enter sleep mode. | |
Result | PTMSYSM_ReplyToSleepQuery (bool deny) |
Accepts or denies the incoming sleep mode request. More... | |
Result | PTMSYSM_NotifySleepPreparationComplete (s32 ackValue) |
Acknowledges the current sleep notification and advance the internal sleep mode FSM. More... | |
Result | PTMSYSM_SetWakeEvents (const PtmSleepConfig *sleepConfig) |
Sets the wake events (two sets: when to fully wake up and when to return to sleep). More... | |
Result | PTMSYSM_GetWakeReason (PtmSleepConfig *outSleepConfig) |
Gets the wake reason (only the first applicable wake event is taken into account). More... | |
Result | PTMSYSM_Awaken (void) |
Cancels the "half-awake" state and fully wakes up the 3DS after some delay. | |
Result | PTMSYSM_SetUserTime (s64 msY2k) |
Sets the user time by updating the user time offset. More... | |
Result | PTMSYSM_InvalidateSystemTime (void) |
Invalidates the "system time" (cfg block 0x30002) | |
Result | PTMSYSM_GetRtcTime (s64 *outMsY2k) |
Reads the time and date coming from the RTC and converts the result. More... | |
Result | PTMSYSM_SetRtcTime (s64 msY2k) |
Writes the time and date coming to the RTC, after conversion. More... | |
Result | PTMSYSM_CheckNew3DS (bool *out) |
Checks whether the system is a New 3DS. More... | |
Result | PTMSYSM_ConfigureNew3DSCPU (u8 value) |
Configures the New 3DS' CPU clock speed and L2 cache. More... | |
Result | PTMSYSM_ShutdownAsync (u64 timeout) |
Trigger a hardware system shutdown via the MCU. More... | |
Result | PTMSYSM_RebootAsync (u64 timeout) |
Trigger a hardware system reboot via the MCU. More... | |
PTMSYSM service.
anonymous enum |
Enumerator | |
---|---|
PTMNOTIFID_SLEEP_REQUESTED | PTMSYSM_RequestSleep has been called (ack = 3) |
PTMNOTIFID_SLEEP_DENIED | The sleep request has been denied by PTMSYSM_ReplyToSleepQuery(true) (no ack required). |
PTMNOTIFID_SLEEP_ALLOWED | The sleep request has been allowed by PTMSYSM_ReplyToSleepQuery(false) (ack = 1). |
PTMNOTIFID_GOING_TO_SLEEP | All processes not having "RunnableOnSleep" have been paused & the system is about to go to sleep (ack = 0). |
PTMNOTIFID_FULLY_WAKING_UP | The system has been woken up, and the paused processes are about to be unpaused (ack = 1). |
PTMNOTIFID_FULLY_AWAKE | The system is fully awake (no ack required). |
PTMNOTIFID_HALF_AWAKE | The system has been woken up but is about to go to sleep again (ack = 2). |
PTMNOTIFID_SHUTDOWN | The system is about to power off or reboot. |
PTMNOTIFID_BATTERY_VERY_LOW | The battery level has reached 5% or below. |
PTMNOTIFID_BATTERY_LOW | The battery level has reached 10% or below. |
Result PTMSYSM_CheckNew3DS | ( | bool * | out | ) |
Checks whether the system is a New 3DS.
[out] | out | Pointer to write the New 3DS flag to. |
Configures the New 3DS' CPU clock speed and L2 cache.
value | Bit0: enable higher clock, Bit1: enable L2 cache. |
Reads the time and date coming from the RTC and converts the result.
[out] | outMsY2k | The pointer to write the number of milliseconds since 01/01/2000 to. |
Result PTMSYSM_GetWakeReason | ( | PtmSleepConfig * | outSleepConfig | ) |
Gets the wake reason (only the first applicable wake event is taken into account).
sleepConfig | Pointer to the two sets of wake events. Only the relevant set will be filled. |
Acknowledges the current sleep notification and advance the internal sleep mode FSM.
All subscribers must reply.
ackValue | Use ptmSysmGetNotificationAckValue |
Trigger a hardware system reboot via the MCU.
timeout | timeout passed to PMApp:ShutdownAsync (PrepareForReboot). |
Result PTMSYSM_ReplyToSleepQuery | ( | bool | deny | ) |
Accepts or denies the incoming sleep mode request.
deny | Whether or not to deny the sleep request. |
Writes the time and date coming to the RTC, after conversion.
msY2k | The number of milliseconds since 01/01/2000. |
Sets the user time by updating the user time offset.
msY2k | The number of milliseconds since 01/01/2000. |
Result PTMSYSM_SetWakeEvents | ( | const PtmSleepConfig * | sleepConfig | ) |
Sets the wake events (two sets: when to fully wake up and when to return to sleep).
sleepConfig | Pointer to the two sets of wake events. |
Trigger a hardware system shutdown via the MCU.
timeout | timeout passed to PMApp:ShutdownAsync (PrepareForReboot). |
Handle* ptmSysmGetSessionHandle | ( | void | ) |
Gets a pointer to the current ptm:sysm session handle.