• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ readRMI函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中readRMI函数的典型用法代码示例。如果您正苦于以下问题:C++ readRMI函数的具体用法?C++ readRMI怎么用?C++ readRMI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了readRMI函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:ItsAnilSingh,项目名称:android_kernel_samsung_logan2g,代码行数:16,代码来源:synaptics_fw_updater.c


示例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);
}
开发者ID:El-Nath,项目名称:bidji-find5,代码行数:15,代码来源:synaptics_update_firmware.c


示例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);
}
开发者ID:ItsAnilSingh,项目名称:android_kernel_samsung_logan2g,代码行数:19,代码来源:synaptics_fw_updater.c


示例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);
}
开发者ID:El-Nath,项目名称:bidji-find5,代码行数:30,代码来源:synaptics_update_firmware.c


示例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);
}
开发者ID:andi34,项目名称:Dhollmen_Kernel,代码行数:20,代码来源:synaptics.c


示例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;
}
开发者ID:El-Nath,项目名称:bidji-find5,代码行数:9,代码来源:synaptics_update_firmware.c


示例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);
	}
}
开发者ID:vitek999,项目名称:android_kernel_lg_mm,代码行数:36,代码来源:s3320_fw_update.c


示例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);
}
开发者ID:El-Nath,项目名称:bidji-find5,代码行数:19,代码来源:synaptics_update_firmware.c


示例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;
}
开发者ID:PsychoGame,项目名称:android_kernel_samsung_royss_old,代码行数:25,代码来源:synaptics_fw_updater.c


示例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;
}
开发者ID:ItsAnilSingh,项目名称:android_kernel_samsung_logan2g,代码行数:11,代码来源:synaptics_fw_updater.c


示例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);
}
开发者ID:vitek999,项目名称:android_kernel_lg_mm,代码行数:10,代码来源:s3320_fw_update.c


示例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 */
}
开发者ID:vitek999,项目名称:android_kernel_lg_mm,代码行数:21,代码来源:s3320_fw_update.c


示例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 */
			;
		}
	}
}
开发者ID:ItsAnilSingh,项目名称:android_kernel_samsung_logan2g,代码行数:45,代码来源:synaptics_fw_updater.c


示例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);
}
开发者ID:vitek999,项目名称:android_kernel_lg_mm,代码行数:46,代码来源:s3320_fw_update.c


示例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);
}
开发者ID:vitek999,项目名称:android_kernel_lg_mm,代码行数:12,代码来源:s3320_fw_update.c


示例16: CheckFlashStatus

bool CheckFlashStatus(struct synaptics_ts_data *ts, enum FlashCommand command)//no ds4
{
	unsigned char uData = 0;
	// Read the "Program Enabled" bit of the F34 Control register, and proceed only if the
	// bit is set.
	readRMI(ts->client, SynaF34_FlashStatus, &uData, 1);
	// TOUCH_INFO_MSG("SynaF34_FlashStatus=[%x], uData=[%x]\n", SynaF34_FlashStatus, uData);

	//if ((uData & 0x3F) != 0)
	//	TOUCH_ERR_MSG( "Command %s failed.\n\tFlash status : 0x%X\n", SynaFlashCommandStr[command], uData & 0x3F);
	return !(uData & 0x3F);
}
开发者ID:AbdulrahmanAmir,项目名称:Dorimanx-LG-G2-D802-Kernel,代码行数:12,代码来源:touch_synaptics_ds5_fw_upgrade.c


示例17: SynaWaitForATTN

/* SynaWaitForATTN waits for ATTN to be asserted within a certain time threshold.
 */
unsigned int SynaWaitForATTN(int timeout, struct i2c_client *client)
{
	unsigned char uStatus;
	/* int duration = 50; */
	/* int retry = timeout/duration; */
	/* int times = 0; */
#ifdef POLLING
	do {
		uStatus = 0x00;
		readRMI((SynaF01DataBase + 1), &uStatus, 1);
		if (uStatus != 0)
			break;
		Sleep(duration);
		times++;
	} while (times < retry);

	if (times == retry)
		return -1;
#else
	/* if (Line_WaitForAttention(timeout) == EErrorTimeout) */
	/* { */
	/* return -1; */
	/* } */
	int trial_us = 0;

	while ((mt_get_gpio_in(GPIO_CTP_EINT_PIN) != 0) && (trial_us < (timeout * 1000))) {
		udelay(1);
		trial_us++;
	}

	if (mt_get_gpio_in(GPIO_CTP_EINT_PIN) != 0) {
		TPD_LOG("interrupt pin is busy...");
		return -EBUSY;
	}

	readRMI(client, (SynaF01DataBase + 1), &uStatus, 1);
#endif
	return 0;
}
开发者ID:vitek999,项目名称:android_kernel_lg_mm,代码行数:41,代码来源:s3320_fw_update.c


示例18: SynaFinalizeReflash

/* SynaFinalizeReflash finalizes the reflash process
 */
static void SynaFinalizeReflash(void)
{
    unsigned char uData;
    unsigned char uStatus;

    printk("\nFinalizing Reflash...\n");

    // Issue the "Reset" command to F01 command register to reset the chip
    // This command will also test the new firmware image and check if its is valid
    uData = 1;
    writeRMI(SynaF01CommandBase, &uData, 1);

    SynaWaitForATTN();
    readRMI(SynaF01DataBase, &uData, 1);
    printk("-----SynaFinalizeReflash-1-\n");
    // Sanity check that the reflash process is still enabled
    do {
        readRMI(SynaF34_FlashControl, &uStatus, 1);
        printk("-----SynaFinalizeReflash-2-\n");
    } while ((uStatus & 0x0f) != 0x00);
    printk("-----SynaFinalizeReflash-3-\n");
    readRMI((SynaF01DataBase + 1), &uStatus, 1);
    printk("-----SynaFinalizeReflash-4-\n");
    SynaSetup();
    printk("-----SynaFinalizeReflash-5-\n");
    uData = 0;

    // Check if the "Program Enabled" bit in F01 data register is cleared
    // Reflash is completed, and the image passes testing when the bit is cleared
    do {
        readRMI(SynaF01DataBase, &uData, 1);
        printk("-----SynaFinalizeReflash-6- data=%02x\n", uData);
    } while ((uData & 0x40) != 0);
    printk("-----SynaFinalizeReflash-7-\n");
    // Rescan PDT the update any changed register offsets
    SynaSetup();

    printk("\nReflash Completed. Please reboot.\n");
}
开发者ID:El-Nath,项目名称:bidji-find5,代码行数:41,代码来源:synaptics_update_firmware.c


示例19: SynaSetup

/* SynaSetup 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 PDT.c, since only F34 and F01 are needed for reflash.
 */
static void SynaSetup(void)
{
	u8 address;
	u8 buffer[6];

	pr_info("tsp fw. : SynaSetup ++\n");

	for (address = 0xe9; address > 0xc0; address = address - 6) {
		readRMI(address, buffer, 6);

		switch (buffer[5]) {
		case 0x34:
			SynaF34DataBase = buffer[3];
			SynaF34QueryBase = buffer[0];
			break;

		case 0x01:
			SynaF01DataBase = buffer[3];
			SynaF01CommandBase = buffer[1];
			break;
		}
	}

	SynaF34Reflash_BlockNum = SynaF34DataBase;
	SynaF34Reflash_BlockData = SynaF34DataBase + 2;
	SynaF34ReflashQuery_BootID = SynaF34QueryBase;
	SynaF34ReflashQuery_FlashPropertyQuery = SynaF34QueryBase + 2;
	SynaF34ReflashQuery_FirmwareBlockSize = SynaF34QueryBase + 3;
	SynaF34ReflashQuery_FirmwareBlockCount = SynaF34QueryBase + 5;
	SynaF34ReflashQuery_ConfigBlockSize = SynaF34QueryBase + 3;
	SynaF34ReflashQuery_ConfigBlockCount = SynaF34QueryBase + 7;

	SynafirmwareImgData = (u8 *)((&SynaFirmwareData[0]) + 0x100);
	SynaconfigImgData = (u8 *)(SynafirmwareImgData + SynaImageSize);
	SynafirmwareImgVersion = (u32)(SynaFirmwareData[7]);

	switch (SynafirmwareImgVersion) {
	case 2:
		SynalockImgData = (u8 *)((&SynaFirmwareData[0]) + 0xD0);
		break;
	case 3:
	case 4:
		SynalockImgData = (u8 *)((&SynaFirmwareData[0]) + 0xC0);
		break;
	case 5:
		SynalockImgData = (u8 *)((&SynaFirmwareData[0]) + 0xB0);
		break;
	default:
		break;
	}
}
开发者ID:ItsAnilSingh,项目名称:android_kernel_samsung_logan2g,代码行数:55,代码来源:synaptics_fw_updater.c


示例20: SynaFinalizeReflash

/* SynaFinalizeReflash finalizes the reflash process
*/
static void SynaFinalizeReflash(void)
{
	u8 uData;
	u8 uStatus;

	pr_info("tsp fw. : Finalizing Reflash..\n");

	/* Issue the "Reset" command to F01 command register to reset the chip
	 This command will also test the new firmware image and check if its is
	 valid */
	uData = 1;
	writeRMI(SynaF01CommandBase, &uData, 1);

	mdelay(300);
	readRMI(SynaF01DataBase, &uData, 1);

	/* Sanity check that the reflash process is still enabled */
	do {
		readRMI(SynaF34_FlashControl, &uStatus, 1);
	} while ((uStatus & 0x0f) != 0x00);
	readRMI((SynaF01DataBase + 1), &uStatus, 1);

	SynaSetup();

	uData = 0;

	/* Check if the "Program Enabled" bit in F01 data register is cleared
	 Reflash is completed, and the image passes testing when the bit is
	 cleared */
	do {
		readRMI(SynaF01DataBase, &uData, 1);
	} while ((uData & 0x40) != 0);

	/* Rescan PDT the update any changed register offsets */
	SynaSetup();

	pr_info("tsp fw. : Reflash Completed. Please reboot.\n");
}
开发者ID:ItsAnilSingh,项目名称:android_kernel_samsung_logan2g,代码行数:40,代码来源:synaptics_fw_updater.c



注:本文中的readRMI函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ readReg函数代码示例发布时间:2022-05-30
下一篇:
C++ readProcessOutput函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap