-
-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a8ae667
commit c77e6f6
Showing
4 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#pragma once | ||
|
||
/** | ||
* \defgroup nn_ccr nn_ccr | ||
* | ||
*/ | ||
|
||
#include <nn/ccr/sys.h> | ||
#include <nn/ccr/sys_caffeine.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
#pragma once | ||
#include <wut.h> | ||
|
||
/** | ||
* \defgroup nn_ccr_sys | ||
* \ingroup nn_ccr | ||
* (see nn::ccr) | ||
* @{ | ||
*/ | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
typedef enum CCRSysPairingState | ||
{ | ||
//! Pairing is complete / hasn't started yet | ||
CCR_SYS_PAIRING_FINISHED = 0, | ||
//! Pairing is in progress | ||
CCR_SYS_PAIRING_IN_PROGRESS = 1, | ||
//! Pairing timed out | ||
CCR_SYS_PAIRING_TIMED_OUT = 2, | ||
} CCRSysPairingState; | ||
|
||
void | ||
CCRSysInit(void); | ||
|
||
void | ||
CCRSysExit(void); | ||
|
||
/** | ||
* Shutdown the DRC in slot 0. | ||
* | ||
* \return | ||
* 0 on success. | ||
*/ | ||
int32_t | ||
CCRSysDRCShutdown(void); | ||
|
||
/** | ||
* Invalidate the DRC pairing in slot 0. | ||
* | ||
* \return | ||
* 0 on success. | ||
*/ | ||
int32_t | ||
CCRSysInvalidatePairing(void); | ||
|
||
/** | ||
* Check if the DRC in the specified slot is attached. | ||
* | ||
* \param drcSlot | ||
* Slot from 0 to 1. | ||
* | ||
* \return | ||
* \c TRUE if attached. | ||
*/ | ||
BOOL | ||
__CCRSysDRCIsAttached(uint32_t drcSlot); | ||
|
||
/** | ||
* Starts the pairing process for the specified slot. | ||
* | ||
* \param drcSlot | ||
* Slot from 0 to 1. | ||
* | ||
* \param timeout | ||
* Timeout in seconds. | ||
* | ||
* \return | ||
* 0 on success. | ||
*/ | ||
int32_t | ||
CCRSysStartPairing(uint32_t drcSlot, | ||
uint32_t timeout); | ||
|
||
/** | ||
* Stops the pairing process. | ||
* | ||
* \return | ||
* 0 on success. | ||
*/ | ||
int32_t | ||
CCRSysStopPairing(void); | ||
|
||
/** | ||
* Gets the current pairing state. | ||
* | ||
* \return | ||
* The pairing state. | ||
*/ | ||
CCRSysPairingState | ||
CCRSysGetPairingState(void); | ||
|
||
/** | ||
* Gets the pin code used for pairing in decimal representation. | ||
* ♠ = 0, ♥ = 1, ♦ = 2, ♣ = 3 | ||
* | ||
* \param pin | ||
* Pointer to write the pin code to. | ||
* | ||
* \return | ||
* 0 on success. | ||
*/ | ||
int32_t | ||
CCRSysGetPincode(uint32_t *pin); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
|
||
/** @} */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters