mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/touch_dev: add a function to get the maximum number of touches
This commit is contained in:
parent
09f07262f4
commit
a5a08f0d63
@ -76,6 +76,18 @@ typedef struct {
|
|||||||
*/
|
*/
|
||||||
uint16_t (*width)(const touch_dev_t *dev);
|
uint16_t (*width)(const touch_dev_t *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the maximum number of touches the touch device supports
|
||||||
|
*
|
||||||
|
* This function pointer can be NULL. In this case, the maximum number of
|
||||||
|
* touches is assumed to be 1.
|
||||||
|
*
|
||||||
|
* @param[in] dev Pointer to the touch device
|
||||||
|
*
|
||||||
|
* @return number of touches
|
||||||
|
*/
|
||||||
|
uint8_t (*max_numof)(const touch_dev_t *dev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the current touches on the touch device
|
* @brief Get the current touches on the touch device
|
||||||
*
|
*
|
||||||
@ -157,6 +169,19 @@ uint16_t touch_dev_height(const touch_dev_t *dev);
|
|||||||
*/
|
*/
|
||||||
uint16_t touch_dev_width(const touch_dev_t *dev);
|
uint16_t touch_dev_width(const touch_dev_t *dev);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get the maximum number of touches the touch device supports
|
||||||
|
*
|
||||||
|
* @param[in] dev Pointer to the touch device
|
||||||
|
*
|
||||||
|
* @return number of touches
|
||||||
|
*/
|
||||||
|
static inline uint8_t touch_dev_max_numof(const touch_dev_t *dev)
|
||||||
|
{
|
||||||
|
assert(dev);
|
||||||
|
return (dev->driver->max_numof) ? dev->driver->max_numof(dev) : 1;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get the current touches on the touch device
|
* @brief Get the current touches on the touch device
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user