Forked para SNOCC
Fork of RA8875 by
Diff: RA8875.h
- Revision:
- 85:022bba13c5c4
- Parent:
- 84:e102021864b5
- Child:
- 86:e86b355940f4
--- a/RA8875.h Mon Jan 12 01:10:35 2015 +0000 +++ b/RA8875.h Tue Jan 13 12:31:44 2015 +0000 @@ -518,12 +518,12 @@ /// do { /// point_t point = {0, 0}; /// if (display.TouchPanelReadable(&point)) { - /// display.pixel(point.x, point.y, Red); + /// display.pixel(point, Red); /// } /// } while (t.read_ms() < 30000); /// @endcode /// - /// @param[out] touch is the touch point, if a touch is registered. + /// @param[out] TouchPoint is the touch point, if a touch is registered. /// @returns a value indicating the state of the touch, /// - no_cal: no calibration matrix is available, touch coordinates are not returned. /// - no_touch: no touch is detected, touch coordinates are not returned. @@ -531,7 +531,37 @@ /// - held: held after touch, touch coordinates are returned. /// - release: indicates a release, touch coordinates are returned. /// - TouchCode_t TouchPanelReadable(point_t * touch = NULL); + TouchCode_t TouchPanelReadable(point_t * TouchPoint = NULL); + + + /// Wait for a touch panel touch and return it. + /// + /// This method is similar to Serial.getc() in that it will wait for a touch + /// and then return. In order to extract the coordinates of the touch, a + /// valid pointer to a point_t must be provided. + /// + /// @note There is no timeout on this function, so its use is not recommended. + /// + /// @code + /// Timer t; + /// t.start(); + /// do { + /// point_t point = {0, 0}; + /// display.TouchPanelGet(&point); // hangs here until touch + /// display.pixel(point, Red); + /// } while (t.read_ms() < 30000); + /// @endcode + /// + /// @param[out] TouchPoint is the touch point, if a touch is registered. + /// @returns a value indicating the state of the touch, + /// - no_cal: no calibration matrix is available, touch coordinates are not returned. + /// - no_touch: no touch is detected, touch coordinates are not returned. + /// - touch: touch is detected, touch coordinates are returned. + /// - held: held after touch, touch coordinates are returned. + /// - release: indicates a release, touch coordinates are returned. + /// + TouchCode_t TouchPanelGet(point_t * TouchPoint); + /// Calibrate the touch panel. /// @@ -593,7 +623,7 @@ /// non-volatile memory to recover the calibration after a power fail. /// @returns success/failure code. @see RetCode_t. /// - RetCode_t TouchPanelCalibrate(tpMatrix_t * matrix); + RetCode_t TouchPanelCalibrate(tpMatrix_t * matrix = NULL); /// Perform the touch panel calibration process. /// @@ -612,30 +642,6 @@ /// RetCode_t TouchPanelCalibrate(const char * msg, tpMatrix_t * matrix = NULL); - /// Wait for a touch panel touch and return it. - /// - /// This method is similar to Serial.getc() in that it will wait for a touch - /// and then return. In order to extract the coordinates of the touch, a - /// valid pointer to a point_t must be provided. - /// - /// @note There is no timeout on this function, so its use is not recommended. - /// - /// @code - /// Timer t; - /// t.start(); - /// do { - /// point_t point = {0, 0}; - /// display.TouchPanelGet(&point); - /// display.pixel(point.x, point.y, Red); - /// } while (t.read_ms() < 30000); - /// @endcode - /// - /// @param[out] touch is the touch point, if a touch is registered. - /// @returns true if a touch was registered, and touch is updated. - /// @returns false if no touch was detected, or if the calibration matrix is not defined. - /// - bool TouchPanelGet(point_t * touch); - /// Set the calibration matrix for the touch panel. /// /// This method is used to set the calibration matrix for the touch panel. After