libnx v4.9.0
|
Wrapper for using the Ring-Con attached to a Joy-Con, with hidbus. More...
Go to the source code of this file.
Data Structures | |
struct | RingConFwVersion |
Ring-Con firmware version. More... | |
struct | RingConManuCal |
Ring-Con manufacturer calibration. More... | |
struct | RingConUserCal |
Ring-Con user calibration. More... | |
struct | RingConPollingData |
Polling data extracted from HidbusJoyPollingReceivedData. More... | |
struct | RingCon |
Ring-Con state object. More... | |
Macros | |
#define | RINGCON_CAL_MAGIC -0x3502 |
Enumerations | |
enum | RingConDataValid { RingConDataValid_Ok = 0 , RingConDataValid_CRC = 1 , RingConDataValid_Cal = 2 } |
Whether the output data is valid. More... | |
enum | RingConErrorFlag { RingConErrorFlag_BadUserCalUpdate = 0 , RingConErrorFlag_BadFlag = 4 , RingConErrorFlag_BadUserCal = 5 , RingConErrorFlag_BadManuCal = 6 } |
Wrapper for using the Ring-Con attached to a Joy-Con, with hidbus.
See also: https://switchbrew.org/wiki/Ring-Con
enum RingConDataValid |
Whether the output data is valid.
Enumerator | |
---|---|
RingConDataValid_Ok | Valid. |
RingConDataValid_CRC | Bad CRC. |
RingConDataValid_Cal | Only used with ringconReadUserCal. Calibration is needed via ringconUpdateUserCal. |
enum RingConErrorFlag |
Enumerator | |
---|---|
RingConErrorFlag_BadUserCalUpdate | The output from ringconReadUserCal doesn't match the input used with ringconWriteUserCal, or the RingConDataValid is not RingConDataValid_Ok. |
RingConErrorFlag_BadFlag | The output flag from ringconCmdx00020105 when successful is invalid. |
RingConErrorFlag_BadUserCal | BadUserCal. |
RingConErrorFlag_BadManuCal | BadManuCal. |
Uses cmd 0x00020105.
c | RingCon | |
[out] | out | Output value. |
Result ringconCreate | ( | RingCon * | c, |
HidNpadIdType | id | ||
) |
Creates a RingCon object, and handles the various initialization for it.
c | RingCon | |
[in] | id | HidNpadIdType. A Ring-Con must be attached to this controller. |
|
inlinestatic |
Gets the value of an error flag, set by ringconSetErrorFlag.
c | RingCon | |
[in] | flag | RingConErrorFlag |
Gets the error flags field.
c | RingCon |
|
inlinestatic |
Gets the RingConFwVersion previously loaded by ringconCreate.
c | RingCon | |
[out] | out | RingConFwVersion |
Gets the Id previously loaded by ringconCreate.
c | RingCon | |
[out] | id_l | Id low. |
[out] | id_h | Id high. |
|
inlinestatic |
Gets the RingConManuCal previously loaded by ringconCreate.
c | RingCon | |
[out] | out | RingConManuCal |
Result ringconGetPollingData | ( | RingCon * | c, |
RingConPollingData * | out, | ||
s32 | count, | ||
s32 * | total_out | ||
) |
Gets the RingConPollingData.
Only returns entries which are new since the last time this was called (or if not previously called, all available entries up to count).
c | RingCon | |
[out] | out | Output array of RingConPollingData. Entry order is newest -> oldest. |
[in] | count | Total size of the out array in entries, max value is 0x9. |
[out] | total_out | Total output entries. |
Gets the total-push-count previously loaded by ringconCreate.
c | RingCon | |
[out] | out | total_push_count |
Gets the unk_cal previously loaded by ringconCreate with ringconReadUnkCal.
Only valid when the output flag from ringconCmdx00020105 is valid.
c | RingCon |
|
inlinestatic |
Gets the RingConUserCal previously loaded by ringconCreate.
c | RingCon | |
[out] | out | RingConUserCal |
Result ringconReadFwVersion | ( | RingCon * | c, |
RingConFwVersion * | out | ||
) |
Reads the RingConFwVersion.
c | RingCon | |
[out] | out | RingConFwVersion |
Reads the Id.
c | RingCon | |
[out] | id_l | Id low. |
[out] | id_h | Id high. |
Result ringconReadManuCal | ( | RingCon * | c, |
RingConManuCal * | out | ||
) |
Reads the RingConManuCal.
c | RingCon | |
[out] | out | RingConManuCal |
Result ringconReadRepCount | ( | RingCon * | c, |
s32 * | out, | ||
RingConDataValid * | data_valid | ||
) |
Reads the rep-count for Multitask Mode.
c | RingCon | |
[out] | out | Output value. Official sw using this clamps the output to range 0-500. |
[out] | data_valid | RingConDataValid |
Result ringconReadTotalPushCount | ( | RingCon * | c, |
s32 * | out, | ||
RingConDataValid * | data_valid | ||
) |
Reads the total-push-count, for Multitask Mode.
c | RingCon | |
[out] | out | Output value. |
[out] | data_valid | RingConDataValid |
Gets the unknown value derived from the output of cmd 0x00020504 and ringconReadManuCal.
c | RingCon | |
[out] | out | Output value. |
Result ringconReadUserCal | ( | RingCon * | c, |
RingConUserCal * | out | ||
) |
Reads the RingConUserCal.
c | RingCon | |
[out] | out | RingConUserCal |
This resets the value returned by ringconReadRepCount to 0.
c | RingCon |
Result ringconUpdateUserCal | ( | RingCon * | c, |
RingConUserCal | cal | ||
) |
Updates the RingConUserCal.
c | RingCon | |
[in] | cal | RingConUserCal |
Result ringconWriteUserCal | ( | RingCon * | c, |
RingConUserCal | cal | ||
) |
Writes the RingConUserCal.
c | RingCon | |
[in] | cal | RingConUserCal |