1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

drivers/ft5x06: fix register addresses

This commit is contained in:
Gunar Schorcht 2023-08-15 00:06:02 +02:00
parent 0df9480126
commit a9f3ce121a
2 changed files with 22 additions and 17 deletions

View File

@ -54,17 +54,17 @@ int ft5x06_init(ft5x06_t *dev, const ft5x06_params_t *params, ft5x06_event_cb_t
return -EPROTO;
}
uint8_t expected_id;
if (dev->params.type == FT5X06_TYPE_FT6X06 || dev->params.type == FT5X06_TYPE_FT6X36) {
expected_id = FT6XX6_VENDOR_ID;
if ((vendor_id != FT5X06_VENDOR_ID_2) && (vendor_id != FT5X06_VENDOR_ID_3)) {
DEBUG("[ft5x06] init: invalid vendor ID: '0x%02x' (expected: 0x%02x or 0x%02x)\n",
vendor_id, FT5X06_VENDOR_ID_2, FT5X06_VENDOR_ID_3);
i2c_release(FT5X06_BUS);
return -ENODEV;
}
}
else {
expected_id = FT5X06_VENDOR_ID;
}
if (expected_id != vendor_id) {
else if (vendor_id != FT5X06_VENDOR_ID_1) {
DEBUG("[ft5x06] init: invalid vendor ID: '0x%02x' (expected: 0x%02x)\n",
vendor_id, expected_id);
vendor_id, FT5X06_VENDOR_ID_1);
i2c_release(FT5X06_BUS);
return -ENODEV;
}

View File

@ -31,15 +31,20 @@ extern "C" {
*/
#define FT5X06_I2C_DEFAULT_ADDRESS (0x38)
/**
* @brief Vendor ID for FT6X06 and FT6X36 models.
*/
#define FT6XX6_VENDOR_ID (0x11)
/**
* @brief Vendor ID for FT5606, FT5X16, FT5X06I, FT5336, FT3316, FT5436I, FT5336I, FT5X46 models.
*/
#define FT5X06_VENDOR_ID (0x51)
#define FT5X06_VENDOR_ID_1 (0x51)
/**
* @brief Vendor ID used for most FT6X06 and FT6X36 as well as FT3X67 models.
*/
#define FT5X06_VENDOR_ID_2 (0x11)
/**
* @brief Vendor ID used for some FT6X06 and FT6X36 models.
*/
#define FT5X06_VENDOR_ID_3 (0xcd)
/**
* @brief Maximum touches count for FT6X06 and FT6X36 models.
@ -81,9 +86,9 @@ extern "C" {
#define FT5X06_TOUCH5_YH_REG (0x1D)
#define FT5X06_TOUCH5_YL_REG (0x1E)
#define FT5X06_G_AUTO_CLB_MODE_REG (0xA0)
#define FT5X06_G_CIPHER_REG (0xA1)
#define FT5X06_G_LIB_VERSION_H_REG (0xA2)
#define FT5X06_G_LIB_VERSION_L_REG (0xA3)
#define FT5X06_G_LIB_VERSION_H_REG (0xA1)
#define FT5X06_G_LIB_VERSION_L_REG (0xA2)
#define FT5X06_G_CIPHER_REG (0xA3)
#define FT5X06_G_MODE_REG (0xA4)
#define FT5X06_G_PMODE_REG (0xA5)
#define FT5X06_G_FIRMID_REG (0xA6)