Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisxhe committed Jan 29, 2024
1 parent f8ba819 commit 0610aac
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 82 deletions.
28 changes: 14 additions & 14 deletions src/REG/FT6X36Constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,12 @@
#define FT5206_SLAVE_ADDRESS (0x38)
#define FT6X36_SLAVE_ADDRESS (0x38)

#define FT6X36_VENDID (0x11)
#define FT3267_CHIPID (0x33)
#define FT6206_CHIPID (0x06)
#define FT6236_CHIPID (0x36)
#define FT6236U_CHIPID (0x64)
#define FT5206U_CHIPID (0x64)
#define FT6X36_VEND_ID (0x11)
#define FT3267_CHIP_ID (0x33)
#define FT6206_CHIP_ID (0x06)
#define FT6236_CHIP_ID (0x36)
#define FT6236U_CHIP_ID (0x64)
#define FT5206U_CHIP_ID (0x64)

#define FT6X36_REG_MODE (0x00)
#define FT6X36_REG_GEST (0x01)
Expand All @@ -48,18 +48,18 @@
#define FT6X36_REG_TOUCH1_XL (0x04)
#define FT6X36_REG_TOUCH1_YH (0x05)
#define FT6X36_REG_TOUCH1_YL (0x06)
#define FT6X36_REG_THRESHHOLD (0x80)
#define FT6X36_REG_MONITORTIME (0x87)
#define FT6X36_REG_PERIODACTIVE (0x88)
#define FT6X36_REG_PERIODMONITOR (0x89)
#define FT6X36_REG_THRESHOLD (0x80)
#define FT6X36_REG_MONITOR_TIME (0x87)
#define FT6X36_REG_PERIOD_ACTIVE (0x88)
#define FT6X36_REG_PERIOD_MONITOR (0x89)


#define FT6X36_REG_AUTO_CLB_MODE (0xA0)
#define FT6X36_REG_LIB_VERSIONH (0xA1)
#define FT6X36_REG_LIB_VERSIONL (0xA2)
#define FT6X36_REG_LIB_VERSION_H (0xA1)
#define FT6X36_REG_LIB_VERSION_L (0xA2)
#define FT6X36_REG_INT_STATUS (0xA4)
#define FT6X36_REG_POWER_MODE (0xA5)
#define FT6X36_REG_FIRMVERS (0xA6)
#define FT6X36_REG_CHIPID (0xA3)
#define FT6X36_REG_FIRM_VERS (0xA6)
#define FT6X36_REG_CHIP_ID (0xA3)
#define FT6X36_REG_VENDOR1_ID (0xA8)
#define FT6X36_REG_ERROR_STATUS (0xA9)
20 changes: 10 additions & 10 deletions src/SensorCommon.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ typedef union {
} RegData_t;

typedef int (*iic_fptr_t)(uint8_t devAddr, uint8_t regAddr, uint8_t *data, uint8_t len);
typedef void (*gpio_write_fprt_t)(uint32_t gpio, uint8_t value);
typedef int (*gpio_read_fprt_t)(uint32_t gpio);
typedef void (*gpio_mode_fprt_t)(uint32_t gpio, uint8_t mode);
typedef void (*gpio_write_fptr_t)(uint32_t gpio, uint8_t value);
typedef int (*gpio_read_fptr_t)(uint32_t gpio);
typedef void (*gpio_mode_fptr_t)(uint32_t gpio, uint8_t mode);
typedef void (*delay_ms_fprt_t)(uint32_t ms);

template <class chipType>
Expand Down Expand Up @@ -232,17 +232,17 @@ public:
return __has_init;
}

void setGpioWriteCallback(gpio_write_fprt_t cb)
void setGpioWriteCallback(gpio_write_fptr_t cb)
{
__set_gpio_level = cb;
}

void setGpioReadCallback(gpio_read_fprt_t cb)
void setGpioReadCallback(gpio_read_fptr_t cb)
{
__get_gpio_level = cb;
}

void setGpioModeCallback(gpio_mode_fprt_t cb)
void setGpioModeCallback(gpio_mode_fptr_t cb)
{
__set_gpio_mode = cb;
}
Expand Down Expand Up @@ -589,7 +589,7 @@ protected:
return ((h5 & 0x1F) << 8) | l8;
}

void setRegAddressLenght(uint8_t len)
void setRegAddressLength(uint8_t len)
{
__reg_addr_len = len;
}
Expand Down Expand Up @@ -691,9 +691,9 @@ protected:
uint8_t __reg_addr_len = 1;
iic_fptr_t __i2c_master_read = NULL;
iic_fptr_t __i2c_master_write = NULL;
gpio_write_fprt_t __set_gpio_level = NULL;
gpio_read_fprt_t __get_gpio_level = NULL;
gpio_mode_fprt_t __set_gpio_mode = NULL;
gpio_write_fptr_t __set_gpio_level = NULL;
gpio_read_fptr_t __get_gpio_level = NULL;
gpio_mode_fptr_t __set_gpio_mode = NULL;
delay_ms_fprt_t __delay_ms = NULL;

};
6 changes: 3 additions & 3 deletions src/TouchDrvCHSC5816.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ class TouchDrvCHSC5816 :
return false;
}

void setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb)
void setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb)
{
SensorCommon::setGpioModeCallback(mode_cb);
SensorCommon::setGpioWriteCallback(write_cb);
Expand Down
12 changes: 6 additions & 6 deletions src/TouchDrvCSTXXX.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ class TouchDrvCSTXXX : public TouchDrvInterface
#endif//ARDUINO


void setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb)
void setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb)
{
__set_gpio_level = write_cb;
__get_gpio_level = read_cb;
Expand Down Expand Up @@ -283,9 +283,9 @@ class TouchDrvCSTXXX : public TouchDrvInterface
}

private:
gpio_write_fprt_t __set_gpio_level = NULL;
gpio_read_fprt_t __get_gpio_level = NULL;
gpio_mode_fprt_t __set_gpio_mode = NULL;
gpio_write_fptr_t __set_gpio_level = NULL;
gpio_read_fptr_t __get_gpio_level = NULL;
gpio_mode_fptr_t __set_gpio_mode = NULL;
TouchDrvInterface *drv = NULL;
};

Expand Down
62 changes: 31 additions & 31 deletions src/TouchDrvFT6X36.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class TouchDrvFT6X36 :


enum GesTrue {
NO_GESTRUE,
NO_GESTURE,
MOVE_UP,
MOVE_LEFT,
MOVE_DOWN,
Expand Down Expand Up @@ -153,27 +153,27 @@ class TouchDrvFT6X36 :
default:
break;
}
return NO_GESTRUE;
return NO_GESTURE;
}

void setTheshold(uint8_t value)
void setThreshold(uint8_t value)
{
writeRegister(FT6X36_REG_THRESHHOLD, value);
writeRegister(FT6X36_REG_THRESHOLD, value);
}

uint8_t getThreshold(void)
{
return readRegister(FT6X36_REG_THRESHHOLD);
return readRegister(FT6X36_REG_THRESHOLD);
}

uint8_t getMonitorTime(void)
{
return readRegister(FT6X36_REG_MONITORTIME);
return readRegister(FT6X36_REG_MONITOR_TIME);
}

void setMonitorTime(uint8_t sec)
{
writeRegister(FT6X36_REG_MONITORTIME, sec);
writeRegister(FT6X36_REG_MONITOR_TIME, sec);
}

// Calibration useless actually,
Expand All @@ -194,7 +194,7 @@ class TouchDrvFT6X36 :
uint16_t getLibraryVersion()
{
uint8_t buffer[2];
readRegister(FT6X36_REG_LIB_VERSIONH, buffer, 2);
readRegister(FT6X36_REG_LIB_VERSION_H, buffer, 2);
return (buffer[0] << 8) | buffer[1];
}

Expand Down Expand Up @@ -225,7 +225,7 @@ class TouchDrvFT6X36 :

// uint8_t mode = buffer[0];
//REG 0x01
// uint8_t gestrue = buffer[1];
// uint8_t gesture = buffer[1];
//REG 0x02
uint8_t point = buffer[2] & 0x0F;

Expand All @@ -247,7 +247,7 @@ class TouchDrvFT6X36 :
LOG_PORT.println("----------------------------------------------------------------------------");
LOG_PORT.println("Touched Gesture EvenFlag [0]PosX [0]PosY [1]PosX [1]PosY");
LOG_PORT.print(point); LOG_PORT.print("\t");
// LOG_PORT.print(gestrue); LOG_PORT.print("\t");
// LOG_PORT.print(gesture); LOG_PORT.print("\t");
// LOG_PORT.print(eventFlag); LOG_PORT.print("\t");
LOG_PORT.print(posX); LOG_PORT.print("\t");
LOG_PORT.print(posY); LOG_PORT.print("\t");
Expand Down Expand Up @@ -312,7 +312,7 @@ class TouchDrvFT6X36 :

uint32_t getChipID(void)
{
return readRegister(FT6X36_REG_CHIPID);
return readRegister(FT6X36_REG_CHIP_ID);
}

uint8_t getVendorID(void)
Expand All @@ -328,11 +328,11 @@ class TouchDrvFT6X36 :
const char *getModelName()
{
switch (__chipID) {
case FT6206_CHIPID: return "FT6206";
case FT6236_CHIPID: return "FT6236";
case FT6236U_CHIPID: return "FT6236U";
case FT3267_CHIPID: return "FT3267";
default: return "UNKOWN";
case FT6206_CHIP_ID: return "FT6206";
case FT6236_CHIP_ID: return "FT6236";
case FT6236U_CHIP_ID: return "FT6236U";
case FT3267_CHIP_ID: return "FT3267";
default: return "UNKNOWN";
}
}

Expand All @@ -356,9 +356,9 @@ class TouchDrvFT6X36 :
}


void setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb)
void setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb)
{
SensorCommon::setGpioModeCallback(mode_cb);
SensorCommon::setGpioWriteCallback(write_cb);
Expand All @@ -377,17 +377,17 @@ class TouchDrvFT6X36 :
uint8_t vendId = readRegister(FT6X36_REG_VENDOR1_ID);


if (vendId != FT6X36_VENDID) {
if (vendId != FT6X36_VEND_ID) {
log_e("Vendor id is 0x%X not match!\n", vendId);
return false;
}

__chipID = readRegister(FT6X36_REG_CHIPID);
__chipID = readRegister(FT6X36_REG_CHIP_ID);

if ((__chipID != FT6206_CHIPID) &&
(__chipID != FT6236_CHIPID) &&
(__chipID != FT6236U_CHIPID) &&
(__chipID != FT3267_CHIPID)
if ((__chipID != FT6206_CHIP_ID) &&
(__chipID != FT6236_CHIP_ID) &&
(__chipID != FT6236U_CHIP_ID) &&
(__chipID != FT3267_CHIP_ID)
) {
log_e("Vendor id is not match!\n");
log_e("ChipID:0x%lx should be 0x06 or 0x36 or 0x64\n", __chipID);
Expand All @@ -396,17 +396,17 @@ class TouchDrvFT6X36 :

log_i("Vend ID: 0x%X\n", vendId);
log_i("Chip ID: 0x%lx\n", __chipID);
log_i("Firm Version: 0x%X\n", readRegister(FT6X36_REG_FIRMVERS));
log_i("Point Rate Hz: %u\n", readRegister(FT6X36_REG_PERIODACTIVE));
log_i("Thresh : %u\n", readRegister(FT6X36_REG_THRESHHOLD));
log_i("Firm Version: 0x%X\n", readRegister(FT6X36_REG_FIRM_VERS));
log_i("Point Rate Hz: %u\n", readRegister(FT6X36_REG_PERIOD_ACTIVE));
log_i("Thresh : %u\n", readRegister(FT6X36_REG_THRESHOLD));

// change threshhold to be higher/lower
writeRegister(FT6X36_REG_THRESHHOLD, 60);
// change threshold to be higher/lower
writeRegister(FT6X36_REG_THRESHOLD, 60);

log_i("Chip library version : 0x%x\n", getLibraryVersion());

// This register describes period of monitor status, it should not less than 30.
log_i("Chip period of monitor status : 0x%x\n", readRegister(FT6X36_REG_PERIODMONITOR));
log_i("Chip period of monitor status : 0x%x\n", readRegister(FT6X36_REG_PERIOD_MONITOR));

// This register describes the period of active status, it should not less than 12

Expand Down
6 changes: 3 additions & 3 deletions src/TouchDrvGT911.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -305,9 +305,9 @@ class TouchDrvGT911 :
return "GT911";
}

void setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb)
void setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb)
{
SensorCommon::setGpioModeCallback(mode_cb);
SensorCommon::setGpioWriteCallback(write_cb);
Expand Down
6 changes: 3 additions & 3 deletions src/TouchDrvInterface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ class TouchDrvInterface

virtual bool getResolution(int16_t *x, int16_t *y) = 0;

virtual void setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb) = 0;
virtual void setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb) = 0;

uint32_t getChipID();

Expand Down
6 changes: 3 additions & 3 deletions src/touch/TouchClassCST226.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ void TouchClassCST226::setHomeButtonCallback(home_button_callback_t cb, void *us
__userData = user_data;
}

void TouchClassCST226::setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb)
void TouchClassCST226::setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb)
{
SensorCommon::setGpioModeCallback(mode_cb);
SensorCommon::setGpioWriteCallback(write_cb);
Expand Down
6 changes: 3 additions & 3 deletions src/touch/TouchClassCST226.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ class TouchClassCST226 : public TouchDrvInterface,

void setHomeButtonCallback(home_button_callback_t cb, void *user_data);

void setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb);
void setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb);

private:
bool initImpl();
Expand Down
6 changes: 3 additions & 3 deletions src/touch/TouchClassCST816.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,9 @@ void TouchClassCST816::enableAutoSleep()
}
}

void TouchClassCST816::setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb)
void TouchClassCST816::setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb)
{
SensorCommon::setGpioModeCallback(mode_cb);
SensorCommon::setGpioWriteCallback(write_cb);
Expand Down
6 changes: 3 additions & 3 deletions src/touch/TouchClassCST816.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ class TouchClassCST816 : public TouchDrvInterface,

void enableAutoSleep();

void setGpioCallback(gpio_mode_fprt_t mode_cb,
gpio_write_fprt_t write_cb,
gpio_read_fprt_t read_cb);
void setGpioCallback(gpio_mode_fptr_t mode_cb,
gpio_write_fptr_t write_cb,
gpio_read_fptr_t read_cb);

private:
bool initImpl();
Expand Down

0 comments on commit 0610aac

Please sign in to comment.