libnds
Loading...
Searching...
No Matches
Functions
touch.h File Reference

High-level touchscreen functions for ARM7. More...

#include <nds/arm7/serial.h>
#include <nds/touch.h>

Functions

void touchApplyCalibration (u16 rawx, u16 rawy, u16 *px, u16 *py)
 Apply calibration to raw X/Y touch screen measurements.
 
void touchInit (void)
 Initialize the touch subsystem (NDS/DSi).
 
bool touchPenDown (void)
 Checks if the screen is currently being touched.
 
bool touchReadData (touchRawArray *data)
 Read a complete, raw touch measurement into the provided buffer.
 
void touchReadXY (touchPosition *touchPos)
 Read a touch X/Y position into the provided buffer.
 

Detailed Description

High-level touchscreen functions for ARM7.

Function Documentation

◆ touchApplyCalibration()

void touchApplyCalibration ( u16  rawx,
u16  rawy,
u16 px,
u16 py 
)

Apply calibration to raw X/Y touch screen measurements.

Parameters
rawxRaw X value
rawyRaw Y value
pxCalibrated X value
pyCalibrated Y value

◆ touchPenDown()

bool touchPenDown ( void  )

Checks if the screen is currently being touched.

Returns
If the pen is down it returns true.

◆ touchReadData()

bool touchReadData ( touchRawArray *  data)

Read a complete, raw touch measurement into the provided buffer.

Parameters
dataStruct to hold the read data.
Returns
True if the read is successful, false otherwise.

◆ touchReadXY()

void touchReadXY ( touchPosition touchPos)

Read a touch X/Y position into the provided buffer.

Parameters
touchPosStruct to hold the read data.