예제 #1
0
파일: i2c.c 프로젝트: BarclayII/pmon-3amatx
int tgt_i2cwrite(int type, unsigned char *addr, int addrlen, unsigned char *buf,
		 int count)
{
	tgt_i2cinit();
	switch (type & 0xff) {
	case I2C_SINGLE:
		i2c_send_s(addr, addrlen, buf, count);
		break;
	case I2C_BLOCK:
		return i2c_send_b(addr, addrlen, buf, count);
		break;
	case I2C_SMB_BLOCK:
		break;
	default:
		return -1;
		break;
	}
	return -1;
}
예제 #2
0
void tsc2003_test(void)
{
	unsigned char command_byte;
	command_byte = TSC2007_CMD (MEAS_TEMP0, PD_POWERDOWN_ENABLEPENIRQ, M_12BIT);
	i2c_send_b((0x48<<1) | 1, 1, &command_byte, 1);
}