当前位置: 首页>>代码示例>>C++>>正文


C++ TEMP_FROM_REG函数代码示例

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


在下文中一共展示了TEMP_FROM_REG函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: show_temp_min_hyst

static ssize_t show_temp_min_hyst(struct device *dev,
				  struct device_attribute *attr, char *buf)
{
	struct lm92_data *data = lm92_update_device(dev);
	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[t_min])
		       + TEMP_FROM_REG(data->temp[t_hyst]));
}
开发者ID:GDGroup,项目名称:linux,代码行数:7,代码来源:lm92.c

示例2: max1619_remote_crit

static void max1619_remote_crit(struct i2c_client *client, int operation,
	int ctl_name, int *nrels_mag, long *results)
{
	struct max1619_data *data = client->data;

	if (operation == SENSORS_PROC_REAL_INFO)
		*nrels_mag = 0; /* magnitude */
	else if (operation == SENSORS_PROC_REAL_READ) {
		max1619_update_client(client);
		results[0] = TEMP_FROM_REG(data->remote_max);
		results[1] = TEMP_FROM_REG(data->remote_hyst);
		*nrels_mag = 2;
	} else if (operation == SENSORS_PROC_REAL_WRITE) {
		if (*nrels_mag >= 1) {
			data->remote_max = TEMP_TO_REG(results[0]);
			i2c_smbus_write_byte_data(client,
				MAX1619_REG_W_REMOTE_TMAX, data->remote_max);
		}
		if (*nrels_mag >= 2) {
			data->remote_hyst = TEMP_TO_REG(results[1]);
			i2c_smbus_write_byte_data(client,
				MAX1619_REG_W_REMOTE_THYST, data->remote_hyst);
		}
	}
}
开发者ID:OPSF,项目名称:uClinux,代码行数:25,代码来源:max1619.c

示例3: show_temp_hyst

static ssize_t show_temp_hyst(struct device *dev,
			      struct device_attribute *devattr, char *buf)
{
	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
	struct lm92_data *data = lm92_update_device(dev);
	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp[attr->index])
		       - TEMP_FROM_REG(data->temp[t_hyst]));
}
开发者ID:GDGroup,项目名称:linux,代码行数:8,代码来源:lm92.c

示例4: show_temp_max

static ssize_t
show_temp_max(struct device *dev, struct device_attribute *attr, char *buf)
{
	int index = to_sensor_dev_attr(attr)->index;
	struct adm1025_data *data = adm1025_update_device(dev);
	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_max[index]));
}
开发者ID:MohdVara,项目名称:linux,代码行数:7,代码来源:adm1025.c

示例5: show_temp_offset

static ssize_t show_temp_offset(struct device *dev, struct device_attribute
		*attr, char *buf)
{
	struct sensor_device_attribute *sensor_attr = to_sensor_dev_attr(attr);
	int nr = sensor_attr->index;
	struct smsc47m192_data *data = smsc47m192_update_device(dev);
	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_offset[nr]));
}
开发者ID:forgivemyheart,项目名称:linux,代码行数:8,代码来源:smsc47m192.c

示例6: max1619_local_temp

static void max1619_local_temp(struct i2c_client *client, int operation,
	int ctl_name, int *nrels_mag, long *results)
{
	struct max1619_data *data = client->data;

	if (operation == SENSORS_PROC_REAL_INFO)
		*nrels_mag = 0; /* magnitude */
	else if (operation == SENSORS_PROC_REAL_READ) {
		max1619_update_client(client);
		results[0] = TEMP_FROM_REG(data->local_temp);
		*nrels_mag = 1;
	}

}
开发者ID:OPSF,项目名称:uClinux,代码行数:14,代码来源:max1619.c

示例7: set_temp1_crit_hyst

static ssize_t set_temp1_crit_hyst(struct device *dev, struct device_attribute *attr, const char *buf,
	size_t count)
{
	struct i2c_client *client = to_i2c_client(dev);
	struct lm92_data *data = i2c_get_clientdata(client);
	long val = simple_strtol(buf, NULL, 10);

	mutex_lock(&data->update_lock);
	data->temp1_hyst = TEMP_FROM_REG(data->temp1_crit) - val;
	i2c_smbus_write_word_data(client, LM92_REG_TEMP_HYST,
				  swab16(TEMP_TO_REG(data->temp1_hyst)));
	mutex_unlock(&data->update_lock);
	return count;
}
开发者ID:johnny,项目名称:CobraDroidBeta,代码行数:14,代码来源:lm92.c

示例8: set_temp1_crit_hyst

static ssize_t set_temp1_crit_hyst(struct device *dev,
				   struct device_attribute *attr,
				   const char *buf, size_t count)
{
	struct i2c_client *client = to_i2c_client(dev);
	struct lm92_data *data = i2c_get_clientdata(client);
	long val;
	int err;

	err = kstrtol(buf, 10, &val);
	if (err)
		return err;

	mutex_lock(&data->update_lock);
	data->temp1_hyst = TEMP_FROM_REG(data->temp1_crit) - val;
	i2c_smbus_write_word_swapped(client, LM92_REG_TEMP_HYST,
				     TEMP_TO_REG(data->temp1_hyst));
	mutex_unlock(&data->update_lock);
	return count;
}
开发者ID:romanbb,项目名称:android_kernel_lge_d851,代码行数:20,代码来源:lm92.c

示例9: set_temp_hyst

static ssize_t set_temp_hyst(struct device *dev,
			     struct device_attribute *devattr,
			     const char *buf, size_t count)
{
	struct sensor_device_attribute *attr = to_sensor_dev_attr(devattr);
	struct lm92_data *data = dev_get_drvdata(dev);
	struct i2c_client *client = data->client;
	long val;
	int err;

	err = kstrtol(buf, 10, &val);
	if (err)
		return err;

	mutex_lock(&data->update_lock);
	data->temp[t_hyst] = TEMP_FROM_REG(data->temp[attr->index]) - val;
	i2c_smbus_write_word_swapped(client, LM92_REG_TEMP_HYST,
				     TEMP_TO_REG(data->temp[t_hyst]));
	mutex_unlock(&data->update_lock);
	return count;
}
开发者ID:GDGroup,项目名称:linux,代码行数:21,代码来源:lm92.c

示例10: show_temp_hyst

static ssize_t show_temp_hyst(struct device *dev, struct device_attribute *da,
			      char *buf)
{
	struct lm78_data *data = lm78_update_device(dev);
	return sprintf(buf, "%d\n", TEMP_FROM_REG(data->temp_hyst));
}
开发者ID:285452612,项目名称:ali_kernel,代码行数:6,代码来源:lm78.c


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