libctru v2.5.0
Loading...
Searching...
No Matches
ptmu.h
Go to the documentation of this file.
1/**
2 * @file ptmu.h
3 * @brief PTMU service.
4 */
5#pragma once
6
7/// Initializes PTMU.
9
10/// Exits PTMU.
11void ptmuExit(void);
12
13/**
14 * @brief Gets a pointer to the current ptm:u session handle.
15 * @return A pointer to the current ptm:u session handle.
16 */
18
19/**
20 * @brief Gets the system's current shell state.
21 * @param out Pointer to write the current shell state to. (0 = closed, 1 = open)
22 */
24
25/**
26 * @brief Gets the system's current battery level.
27 * @param out Pointer to write the current battery level to. (0-5)
28 */
30
31/**
32 * @brief Gets the system's current battery charge state.
33 * @param out Pointer to write the current battery charge state to. (0 = not charging, 1 = charging)
34 */
36
37/**
38 * @brief Gets the system's current pedometer state.
39 * @param out Pointer to write the current pedometer state to. (0 = not counting, 1 = counting)
40 */
42
43/**
44 * @brief Gets the system's step count history.
45 * @param hours Number of hours to get the step count history for.
46 * @param stepValue Pointer to output the step count history to. (The buffer size must be at least `hours` in length)
47 */
48Result PTMU_GetStepHistory(u32 hours, u16 *stepValue);
49
50/**
51 * @brief Gets the pedometer's total step count.
52 * @param steps Pointer to write the total step count to.
53 */
55
56/**
57 * @brief Gets whether the adapter is plugged in or not
58 * @param out Pointer to write the adapter state to.
59 */
Result PTMU_GetAdapterState(bool *out)
Gets whether the adapter is plugged in or not.
Result PTMU_GetBatteryChargeState(u8 *out)
Gets the system's current battery charge state.
Result PTMU_GetStepHistory(u32 hours, u16 *stepValue)
Gets the system's step count history.
Handle * ptmuGetSessionHandle(void)
Gets a pointer to the current ptm:u session handle.
void ptmuExit(void)
Exits PTMU.
Result ptmuInit(void)
Initializes PTMU.
Result PTMU_GetTotalStepCount(u32 *steps)
Gets the pedometer's total step count.
Result PTMU_GetBatteryLevel(u8 *out)
Gets the system's current battery level.
Result PTMU_GetPedometerState(u8 *out)
Gets the system's current pedometer state.
Result PTMU_GetShellState(u8 *out)
Gets the system's current shell state.
uint8_t u8
would be nice if newlib had this already
Definition types.h:21
u32 Handle
Resource handle.
Definition types.h:41
s32 Result
Function result.
Definition types.h:42
uint16_t u16
16-bit unsigned integer
Definition types.h:22
uint32_t u32
32-bit unsigned integer
Definition types.h:23