summaryrefslogtreecommitdiff
path: root/arm9/lib/NitroSDK/include/tp.h
diff options
context:
space:
mode:
authorRevo <projectrevotpp@hotmail.com>2021-07-22 20:46:10 -0400
committerGitHub <noreply@github.com>2021-07-22 20:46:10 -0400
commitb5b9e57dcb55ee1a69ca86c30e90475bb80e3c28 (patch)
tree2e91e60bdb7a9174b16d8ca1b532809d4ae2e5b6 /arm9/lib/NitroSDK/include/tp.h
parentc2d91a2d997afd01fa4f40e1e16d5ee85557c9a8 (diff)
parent5bf13c7f48fe91c7902ce50250bc1a5a2398a2ae (diff)
Merge pull request #435 from red031000/master
separate out libs to libc, libnns and NitroSDK
Diffstat (limited to 'arm9/lib/NitroSDK/include/tp.h')
-rw-r--r--arm9/lib/NitroSDK/include/tp.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/arm9/lib/NitroSDK/include/tp.h b/arm9/lib/NitroSDK/include/tp.h
new file mode 100644
index 00000000..dc762f10
--- /dev/null
+++ b/arm9/lib/NitroSDK/include/tp.h
@@ -0,0 +1,45 @@
+#ifndef NITRO_TP_H_
+#define NITRO_TP_H_
+
+#define TP_TOUCH_OFF 0 // Not being touched
+#define TP_TOUCH_ON 1 // Being touched
+
+#define TP_VALIDITY_VALID 0 // Valid
+#define TP_VALIDITY_INVALID_X 1 // Data with invalid X coordinate
+#define TP_VALIDITY_INVALID_Y 2 // Data with invalid Y coordinate
+#define TP_VALIDITY_INVALID_XY (TP_VALIDITY_INVALID_X | TP_VALIDITY_INVALID_Y) // Data with invalid X and Y coordinates
+
+// Touch panel input structure
+typedef struct
+{
+ u16 x; // x coordinate ( 0 - 4095 )
+ u16 y; // y coordinate ( 0 - 4095 )
+ u16 touch; // Touch yes/no
+ u16 validity; // Valid yes/no
+}
+TPData;
+
+typedef struct NvTpData
+{
+ s16 x0; // X origin coordinate
+ s16 y0; // Y origin coordinate
+ s16 xDotSize; // X dot size
+ s16 yDotSize; // Y dot size
+}
+TPCalibrateParam;
+
+void TP_Init(void);
+void TP_SetCalibrateParam(const TPCalibrateParam *param);
+BOOL TP_GetUserInfo(TPCalibrateParam *calibrate);
+void TP_RequestSamplingAsync(void);
+u32 TP_WaitRawResult(TPData *result);
+void TP_GetLatestRawPointInAuto(TPData *result);
+void TP_GetCalibratedPoint(TPData *disp, const TPData *raw);
+
+static inline u32 TP_RequestRawSampling(TPData *result)
+{
+ TP_RequestSamplingAsync();
+ return TP_WaitRawResult(result);
+}
+
+#endif //NITRO_TP_H_