本文整理汇总了C++中writeRMI函数的典型用法代码示例。如果您正苦于以下问题:C++ writeRMI函数的具体用法?C++ writeRMI怎么用?C++ writeRMI使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了writeRMI函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SynaProgramConfiguration
/* SynaProgramConfiguration writes the configuration section of the image block by block
*/
static void SynaProgramConfiguration(void)
{
unsigned char uData[2];
const unsigned char *puData = SynaconfigImgData; //ConfigBlockData
unsigned short blockNum;
// int i;
printk("\nProgram Configuration Section...\n");
for (blockNum = 0; blockNum < SynaConfigBlockCount; blockNum++) {
uData[0] = blockNum & 0xff;
uData[1] = (blockNum & 0xff00) >> 8;
printk("--Writing config-- block: %d/%d \n", blockNum+1, SynaConfigBlockCount);
//Block by blcok, write the block number and data to the corresponding F34 data registers
writeRMI(SynaF34Reflash_BlockNum, &uData[0], 2);
writeRMI(SynaF34Reflash_BlockData, puData, SynaConfigBlockSize);
puData += SynaConfigBlockSize;
// Issue the "Write Configuration Block" command
uData[0] = 0x06;
writeRMI(SynaF34_FlashControl, &uData[0], 1);
SynaWaitATTN();
//printk(".");
}
}
示例2: SynaFlashFirmwareWrite
/* SynaFlashFirmwareWrite writes the firmware section of the image block by
* block
*/
static void SynaFlashFirmwareWrite(void)
{
u8 *puFirmwareData;
u8 uData[2];
unsigned short blockNum;
pr_info("tsp fw. : SynaFlashFirmwareWrite\n");
puFirmwareData = (u8 *) &SynaFirmwareData[0x100];
for (blockNum = 0; blockNum < SynaFirmwareBlockCount; ++blockNum) {
/* Block by blcok, write the block number and data to
the corresponding F34 data registers */
uData[0] = blockNum & 0xff;
uData[1] = (blockNum & 0xff00) >> 8;
writeRMI(SynaF34Reflash_BlockNum, uData, 2);
writeRMI(SynaF34Reflash_BlockData, puFirmwareData,
SynaFirmwareBlockSize);
puFirmwareData += SynaFirmwareBlockSize;
/* Issue the "Write Firmware Block" command */
uData[0] = 2;
writeRMI(SynaF34_FlashControl, uData, 1);
SynaWaitATTN();
}
}
示例3: SynaProgramConfiguration
/* SynaProgramConfiguration writes the configuration section of the image block
* by block
*/
static void SynaProgramConfiguration(void)
{
u8 uData[2];
u8 *puData;
unsigned short blockNum;
puData = (u8 *) &SynaFirmwareData[0xb100];
pr_info("tsp fw. : Program Configuration Section...\n");
for (blockNum = 0; blockNum < SynaConfigBlockCount; blockNum++) {
uData[0] = blockNum & 0xff;
uData[1] = (blockNum & 0xff00) >> 8;
/* Block by blcok, write the block number and data to
the corresponding F34 data registers */
writeRMI(SynaF34Reflash_BlockNum, uData, 2);
writeRMI(SynaF34Reflash_BlockData, puData, SynaConfigBlockSize);
puData += SynaConfigBlockSize;
/* Issue the "Write Configuration Block" command */
uData[0] = 0x06;
writeRMI(SynaF34_FlashControl, uData, 1);
SynaWaitATTN();
pr_info(".");
}
}
示例4: SynaFlashFirmwareWrite
/* SynaFlashFirmwareWrite writes the firmware section of the image block by block
*/
void SynaFlashFirmwareWrite(struct i2c_client *client)
{
unsigned char *puFirmwareData = SynafirmwareImgData;
unsigned char uData[2];
unsigned short blockNum;
enum FlashCommand cmd;
TPD_LOG("%s\n", __func__);
for (blockNum = 0; blockNum < SynaFirmwareBlockCount; ++blockNum) {
if (blockNum == 0) {
/* Block by blcok, write the block number and data to the corresponding F34 data registers */
uData[0] = blockNum & 0xff;
uData[1] = (blockNum & 0xff00) >> 8;
writeRMI(client, SynaF34Reflash_BlockNum, &uData[0], 2);
}
writeRMI(client, SynaF34Reflash_BlockData, puFirmwareData, SynaFirmwareBlockSize);
puFirmwareData += SynaFirmwareBlockSize;
/* Issue the "Write Firmware Block" command */
cmd = m_uF34ReflashCmd_FirmwareWrite;
writeRMI(client, SynaF34_FlashControl, (unsigned char *)&cmd, 1);
SynaWaitForATTN(1000, client);
CheckFlashStatus(cmd, client);
/* #ifdef SHOW_PROGRESS */
#if 1 /* APK_TEST */
if (blockNum % 100 == 0)
TPD_LOG("blk %d / %d\n", blockNum, SynaFirmwareBlockCount);
#endif
}
示例5: SynaBootloaderLock
/* SynaBootloaderLock locks down the bootloader
*/
static void SynaBootloaderLock(void)
{
unsigned short lockBlockCount;
unsigned char *puFirmwareData = SynalockImgData;
unsigned char uData[2];
unsigned short uBlockNum;
// Check if device is in unlocked state
readRMI((SynaF34QueryBase+ 2), &uData[0], 1);
//Device is unlocked
if (uData[0] & 0x02) {
printk("Device unlocked. Lock it first...\n");
// Different bootloader version has different block count for the lockdown data
// Need to check the bootloader version from the image file being reflashed
switch (SynafirmwareImgVersion) {
case 2:
lockBlockCount = 3;
break;
case 3:
lockBlockCount = 4;
break;
default:
lockBlockCount = 0;
break;
}
// Write the lockdown info block by block
// This reference code of lockdown process does not check for bootloader version
// currently programmed on the ASIC against the bootloader version of the image to
// be reflashed. Such case should not happen in practice. Reflashing cross different
// bootloader versions is not supported.
for (uBlockNum = 0; uBlockNum < lockBlockCount; ++uBlockNum) {
uData[0] = uBlockNum & 0xff;
uData[1] = (uBlockNum & 0xff00) >> 8;
/* Write Block Number */
readRMI(SynaF34Reflash_BlockNum, &uData[0], 2);
/* Write Data Block */
writeRMI(SynaF34Reflash_BlockData, puFirmwareData, SynaFirmwareBlockSize);
/* Move to next data block */
puFirmwareData += SynaFirmwareBlockSize;
/* Issue Write Lockdown Block command */
uData[0] = 4;
writeRMI(SynaF34_FlashControl, &uData[0], 1);
/* Wait ATTN until device is done writing the block and is ready for the next. */
SynaWaitATTN();
}
printk("Device locking done.\n");
// Enable reflash again to finish the lockdown process.
// Since this lockdown process is part of the reflash process, we are enabling
// reflash instead, rather than resetting the device to finish the unlock procedure.
SynaEnableFlashing();
} else printk("Device already locked.\n");
示例6: 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);
}
示例7: 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;
}
示例8: 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);
}
}
示例9: SynaWriteBootloadID
/* SynaWriteBootloadID writes the bootloader ID to the F34 data register to unlock the reflash process
*/
static void SynaWriteBootloadID(void)
{
unsigned char uData[2];
uData[0] = SynaBootloadID % 0x100;
uData[1] = SynaBootloadID / 0x100;
writeRMI(SynaF34Reflash_BlockData, &uData[0], 2);
}
示例10: SynaWriteBootloadID
/* SynaWriteBootloadID writes the bootloader ID to the F34 data register to
* unlock the reflash process
*/
static void SynaWriteBootloadID(void)
{
u8 uData[2];
pr_info("tsp fw. : SynaWriteBootloadID\n");
uData[0] = SynaBootloadID % 0x100;
uData[1] = SynaBootloadID / 0x100;
writeRMI(SynaF34Reflash_BlockData, uData, 2);
}
示例11: SynaWriteBootloadID
/* SynaWriteBootloadID writes the bootloader ID to the F34 data register to unlock the reflash process
*/
void SynaWriteBootloadID(struct i2c_client *client)
{
unsigned char uData[2];
TPD_LOG("%s\n", __func__);
uData[0] = SynaBootloadID % 0x100;
uData[1] = SynaBootloadID / 0x100;
writeRMI(client, SynaF34Reflash_BlockData, &uData[0], 2);
}
示例12: SynaEnableFlashing
/* SynaEnableFlashing kicks off the reflash process
*/
static int SynaEnableFlashing(void)
{
unsigned char uData;
unsigned char uStatus;
int retry = 3;
printk("\nEnable Reflash...\n");
// 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);
printk("----Read reflash enable ---uData=0x%x--\n",uData);
} while (uData == 0x0f);//while (((uData & 0x0f) != 0x00));
// Clear ATTN
readRMI (SynaF01DataBase, &uStatus, 1);
printk("----Read status ---uStatus=0x%x--\n",uStatus);
if ((uStatus &0x40) == 0) {
// Write the "Enable Flash Programming command to F34 Control register
// Wait for ATTN and then clear the ATTN.
//uData = 0x0f; //lemon
readRMI(SynaF34_FlashControl, &uData, 1);
uData = uData | 0x0f;
writeRMI(SynaF34_FlashControl, &uData, 1);
SynaWaitForATTN();
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);
printk("----read--enable ---uData=0x%x--\n",uData);
while (uData != 0x80) {
// In practice, if uData!=0x80 happens for multiple counts, it indicates reflash
// is failed to be enabled, and program should quit
printk("%s Can NOT enable reflash !!!\n",__func__);
if (!retry--)
return -1;
readRMI(SynaF34_FlashControl, &uData, 1);
printk("----read--enable ---uData=0x%x--\n",uData);
}
}
return 0;
}
示例13: SynaInitialize
/* SynaInitialize sets up the reflahs process
*/
void SynaInitialize(struct i2c_client *client)
{
u8 data;
TPD_LOG("%s\n", __func__);
TPD_LOG("\nInitializing Reflash Process...\n");
data = 0x00;
writeRMI(client, 0xff, &data, 1);
SynaImageParser(client);
SynaScanPDT(client);
}
示例14: SynaProgramFirmware
/* SynaProgramFirmware prepares the firmware writing process
*/
static void SynaProgramFirmware(void)
{
u8 uData;
pr_info("tsp fw. : Program Firmware Section...");
SynaReadBootloadID();
SynaWriteBootloadID();
uData = 3;
writeRMI(SynaF34_FlashControl, &uData, 1);
SynaWaitATTN();
SynaFlashFirmwareWrite();
}
示例15: SynaFlashFirmwareWrite
/* SynaFlashFirmwareWrite writes the firmware section of the image block by block
*/
static void SynaFlashFirmwareWrite(void)
{
const unsigned char *puFirmwareData = SynafirmwareImgData;
unsigned char uData[2];
unsigned short blockNum;
printk("----SynaFlashFirmwareWrite----\n");
for (blockNum = 0; blockNum < SynaFirmwareBlockCount; ++blockNum) {
//Block by blcok, write the block number and data to the corresponding F34 data registers
uData[0] = blockNum & 0xff;
uData[1] = (blockNum & 0xff00) >> 8;
printk("--Writing data-- block: %d/%d \n", blockNum+1, SynaFirmwareBlockCount);
writeRMI(SynaF34Reflash_BlockNum, &uData[0], 2);
//printk("--SynaFlashFirmwareWrite----2\n");
writeRMI(SynaF34Reflash_BlockData, puFirmwareData, SynaFirmwareBlockSize);
puFirmwareData += SynaFirmwareBlockSize;
//printk("--SynaFlashFirmwareWrite----3\n");
// Issue the "Write Firmware Block" command
uData[0] = 2;
writeRMI(SynaF34_FlashControl, &uData[0], 1);
//printk("--SynaFlashFirmwareWrite----4\n");
SynaWaitATTN1();
}
}