本文整理汇总了C++中readRMI函数的典型用法代码示例。如果您正苦于以下问题:C++ readRMI函数的具体用法?C++ readRMI怎么用?C++ readRMI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了readRMI函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SynaReadConfigInfo
/* SynaReadConfigInfo reads the F34 query registers and retrieves the block size
* and count of the configuration section of the image to be reflashed
*/
static void SynaReadConfigInfo(void)
{
u8 uData[2];
pr_info("tsp fw. : Read Config Info\n");
readRMI(SynaF34ReflashQuery_ConfigBlockSize, uData, 2);
SynaConfigBlockSize = uData[0] | (uData[1] << 8);
readRMI(SynaF34ReflashQuery_ConfigBlockCount, uData, 2);
SynaConfigBlockCount = uData[0] | (uData[1] << 8);
SynaConfigImageSize = SynaConfigBlockCount * SynaConfigBlockSize;
}
示例2: SynaWaitATTN1
static void SynaWaitATTN1(void)
{
unsigned char uData;
unsigned char uStatus;
//waitATTN(ASSERT, 300);
msleep(5);
do {
readRMI(SynaF34_FlashControl, &uData, 1);
//printk("----SynaWaitATTN1-1-1\n");
readRMI((SynaF01DataBase + 1), &uStatus, 1);
//printk("----SynaWaitATTN1-1-2\n");
} while (uData!= 0x80);
}
示例3: SynaWaitATTN
/* SynaWaitATTN waits for ATTN to be asserted within a certain time threshold.
* The function also checks for the F34 "Program Enabled" bit and clear ATTN
* accordingly.
*/
static void SynaWaitATTN(void)
{
u8 uData;
u8 uStatus;
int cnt = 1;
while (gpio_get_value(91) && cnt < 30) {
//msleep(20);
cnt++;
}
do {
readRMI(SynaF34_FlashControl, &uData, 1);
readRMI((SynaF01DataBase + 1), &uStatus, 1);
} while (uData != 0x80);
}
示例4: SynaInitialize
/* SynaInitialize sets up the reflahs process
*/
static void SynaInitialize(void)
{
unsigned char uData[1]; // uData[2]
unsigned char uStatus;
printk("\nInitializing Reflash Process...");
#define PAGE_SELECT_REG 0xff
uData[0] = 0x00;
writeRMI(PAGE_SELECT_REG, uData, 1); //select page 0
SynafirmwareImgData = 0;
SynaconfigImgData = 0 ;
do {
readRMI(0, &uStatus, 1);
if (uStatus & 0x80) {
break;
}
} while (uStatus & 0x40);
SynaSetup();
//readRMI(SynaF34ReflashQuery_FirmwareBlockSize, &uData[0], 2);
//SynaFirmwareBlockSize = uData[0] | (uData[1] << 8);
}
示例5: SynaWaitATTN
/* SynaWaitATTN waits for ATTN to be asserted within a certain time threshold.
* The function also checks for the F34 "Program Enabled" bit and clear ATTN
* accordingly.
*/
static void SynaWaitATTN(void)
{
u8 uData;
u8 uStatus;
int cnt = 0;
while (gpio_get_value(gpio_irq) && cnt++ < 300)
usleep_range(500, 1000);
do {
readRMI(SynaF34_FlashControl, &uData, 1);
usleep_range(500, 1000);
} while ((uData != 0x80) && (cnt++ < 300));
readRMI((SynaF01DataBase + 1), &uStatus, 1);
}
示例6: SynaReadBootloadID
/* SynaReadBootloadID reads the F34 query registers and retrieves the bootloader ID of the firmware
*/
static void SynaReadBootloadID(void)
{
unsigned char uData[2];
readRMI(SynaF34ReflashQuery_BootID, &uData[0], 2);
SynaBootloadID = uData[0] + uData[1] * 0x100;
}
示例7: SynaEnableFlashing
/* SynaEnableFlashing kicks off the reflash process
*/
void SynaEnableFlashing(struct i2c_client *client)
{
unsigned char uStatus = 0;
enum FlashCommand cmd;
TPD_LOG("%s\n", __func__);
TPD_LOG("Enable Reflash...\n");
readRMI(client, SynaF01DataBase, &uStatus, 1);
/* APK_TEST */
TPD_LOG("APK_TEST uStatus= 0x%02x\n", uStatus);
if ((uStatus & 0x40) == 0 /*|| force */) {
/* Reflash is enabled by first reading the bootloader ID from the firmware and write it back */
SynaReadBootloadID(client);
SynaWriteBootloadID(client);
/* Write the "Enable Flash Programming command to F34 Control register */
/* Wait for ATTN and then clear the ATTN. */
cmd = m_uF34ReflashCmd_Enable;
writeRMI(client, SynaF34_FlashControl, (unsigned char *)&cmd, 1);
SynaWaitForATTN(1000, client);
/* I2C addrss may change */
/* ConfigCommunication();//APK_TEST */
/* Scan the PDT again to ensure all register offsets are correct */
SynaScanPDT(client);
/* Read the "Program Enabled" bit of the F34 Control register, and proceed only if the */
/* bit is set. */
CheckFlashStatus(cmd, client);
}
}
示例8: SynaReadConfigInfo
/* SynaReadConfigInfo reads the F34 query registers and retrieves the block size and count
* of the configuration section of the image to be reflashed
*/
static void SynaReadConfigInfo(void)
{
unsigned char uData[2];
printk("\nRead Config Info");
readRMI(SynaF34ReflashQuery_ConfigBlockSize, &uData[0], 2);
SynaConfigBlockSize = uData[0] | (uData[1] << 8);
readRMI(SynaF34ReflashQuery_ConfigBlockCount, &uData[0], 2);
SynaConfigBlockCount = uData[0] | (uData[1] << 8);
SynaConfigImageSize = SynaConfigBlockCount * SynaConfigBlockSize;
printk("\nConfig block:%d count:%d total_size:%lu",
SynaConfigBlockSize, SynaConfigBlockCount, SynaConfigImageSize);
}
示例9: readTouchKeyThreshold
bool readTouchKeyThreshold(struct i2c_client *ts_client, u8 *command)
{
#if 0
u8 resetCmd;
client = ts_client;
SetPage(0x02);
F54_PDTscan(); /* scan for page 0x02 */
readRMI(F1A_Button_Threshold, command, 2);;
// printk("hunny2 : %d 0x%x\n", *command, *command);
/* reset TSP IC */
SetPage(0x00);
resetCmd = 0x01;
writeRMI(F01_Command_Base, &resetCmd, 1);
#else
*command = 50; // guide by synaptics.
#endif
return true;
}
示例10: SynaReadBootloadID
/* SynaReadBootloadID reads the F34 query registers and retrieves the bootloader
* ID of the firmware
*/
static void SynaReadBootloadID(void)
{
u8 uData[2];
pr_info("tsp fw. : SynaReadBootloadID\n");
readRMI(SynaF34ReflashQuery_BootID, uData, 2);
SynaBootloadID = uData[0] + uData[1] * 0x100;
}
示例11: SynaReadBootloadID
/* SynaReadBootloadID reads the F34 query registers and retrieves the bootloader ID of the firmware
*/
void SynaReadBootloadID(struct i2c_client *client)
{
unsigned char uData[2] = { 0, };
TPD_LOG("%s\n", __func__);
readRMI(client, SynaF34ReflashQuery_BootID, &uData[0], 2);
SynaBootloadID = uData[0] | (uData[1] << 8);
}
示例12: SynaReadFirmwareInfo
/* SynaReadFirmwareInfo reads the F34 query registers and retrieves the block size and count
* of the firmware section of the image to be reflashed
*/
void SynaReadFirmwareInfo(struct i2c_client *client)
{
unsigned char uData[3] = { 0, };
unsigned char product_id[11] = { 0, };
int firmware_version = 0;
TPD_LOG("%s\n", __func__);
readRMI(client, SynaF01QueryBase + 11, product_id, 10);
product_id[10] = '\0';
TPD_LOG("Read Product ID %s\n", product_id);
readRMI(client, SynaF01QueryBase + 18, uData, 3);
firmware_version = uData[2] << 16 | uData[1] << 8 | uData[0];
TPD_LOG("Read Firmware Info %d\n", firmware_version);
CheckTouchControllerType(client);
/* CheckFimrwareRevision();//APK_TEST */
}
示例13: SynaEnableFlashing
/* SynaEnableFlashing kicks off the reflash process
*/
static void SynaEnableFlashing(void)
{
u8 uData;
u8 uStatus;
pr_info("\nEnable Reflash...");
/* Reflash is enabled by first reading the bootloader ID from
the firmware and write it back */
SynaReadBootloadID();
SynaWriteBootloadID();
/* Make sure Reflash is not already enabled */
do {
readRMI(SynaF34_FlashControl, &uData, 1);
} while (((uData & 0x0f) != 0x00));
readRMI(SynaF01DataBase, &uStatus, 1);
if ((uStatus & 0x40) == 0) {
/* Write the "Enable Flash Programming command to
F34 Control register Wait for ATTN and then clear the ATTN. */
uData = 0x0f;
writeRMI(SynaF34_FlashControl, &uData, 1);
mdelay(300);
readRMI((SynaF01DataBase + 1), &uStatus, 1);
/* Scan the PDT again to ensure all register offsets are
correct */
SynaSetup();
/* Read the "Program Enabled" bit of the F34 Control register,
and proceed only if the bit is set.*/
readRMI(SynaF34_FlashControl, &uData, 1);
while (uData != 0x80) {
/* In practice, if uData!=0x80 happens for multiple
counts, it indicates reflash is failed to be enabled,
and program should quit */
;
}
}
}
示例14: SynaScanPDT
/* SynaScanPDT scans the Page Description Table (PDT) and sets up the necessary variables
* for the reflash process. This function is a "slim" version of the PDT scan function in
* in PDT.c, since only F34 and F01 are needed for reflash.
*/
void SynaScanPDT(struct i2c_client *client)
{
unsigned char address = 0;
unsigned char uData[2] = { 0, };
unsigned char buffer[6] = { 0, };
TPD_LOG("%s\n", __func__);
for (address = 0xe9; address > 0xc0; address = address - 6) {
readRMI(client, address, buffer, 6);
switch (buffer[5]) {
case 0x34:
SynaF34DataBase = buffer[3];
SynaF34QueryBase = buffer[0];
break;
case 0x01:
SynaF01DataBase = buffer[3];
SynaF01CommandBase = buffer[1];
SynaF01QueryBase = buffer[0];
break;
}
}
SynaF34Reflash_BlockNum = SynaF34DataBase;
SynaF34Reflash_BlockData = SynaF34DataBase + 1;
SynaF34ReflashQuery_BootID = SynaF34QueryBase;
SynaF34ReflashQuery_FlashPropertyQuery = SynaF34QueryBase + 1;
SynaF34ReflashQuery_BlockSize = SynaF34QueryBase + 2;
SynaF34ReflashQuery_FirmwareBlockCount = SynaF34QueryBase + 3;
SynaF34_FlashControl = SynaF34DataBase + 2;
SynaF34_FlashStatus = SynaF34DataBase + 3;
readRMI(client, SynaF34ReflashQuery_FirmwareBlockCount, buffer, 4);
SynaFirmwareBlockCount = buffer[0] | (buffer[1] << 8);
SynaConfigBlockCount = buffer[2] | (buffer[3] << 8);
readRMI(client, SynaF34ReflashQuery_BlockSize, &uData[0], 2);
SynaConfigBlockSize = SynaFirmwareBlockSize = uData[0] | (uData[1] << 8);
/* cleat ATTN */
readRMI(client, (SynaF01DataBase + 1), buffer, 1);
}
示例15: CheckFlashStatus
bool CheckFlashStatus(enum FlashCommand command, struct i2c_client *client)
{
unsigned char uData = 0;
/* Read the "Program Enabled" bit of the F34 Control register, and proceed only if the */
/* bit is set. */
readRMI(client, SynaF34_FlashStatus, &uData, 1);
/* if ((uData & 0x3F) != 0) */
/* printf("Command %s failed.\n\tFlash status : 0x%X\n", SynaFlashCommandStr[command], uData & 0x3F); */
return !(uData & 0x3F);
}