[질문] Sis550의 smbus와 카메라 디코더 호스트버스(I2C)를 연결
글쓴이: iyouhe / 작성시간: 수, 2005/03/02 - 6:17오후
Sis550의 smbus와 카메라 디코더 호스트버스(I2C)를 연결하여 제어하기 위해서, 리눅스 드라이버 i2c_core.o i2c_sis5595
를 올린다음 어떤 디바이스를 열여서 제어하는 건지 알고 싶습니다.
/dev/에 i2c관련 디바이스가
/dev/i2c-0 /dev/i2c-1 /dev/i2c0 /dev/i2c 이렇게 4개 있는데, 어떤걸 사용해야 하죠?
그리고 read,write함수를 사용해도 되는지 알고 싶습니다.
참고로 시리얼 포맷은
<Slave_Address> <페이지 레지스터> <레지스터> <변경할 값들>
입니다.
Forums:
I2C 버스가 두개가 있나요? 첫번째 버스에 있으면 /dev/i2c-0
I2C 버스가 두개가 있나요? 첫번째 버스에 있으면 /dev/i2c-0 두번째 버스에 있으면 /dev/i2c-1일 것입니다. 장치 번호를 확인하세요. 첫번째는 89, 0입니다.
I2C 장치를 접근하는 것은 간단합니다. 장치 파일을 열고, ioctl(fd, I2C_SLAVE, 장치 주소)을 불러서 접근할 장치의 주소를 지정합니다. 그 다음에 read()와 write()를 사용할 수 있습니다. 특정 위치를 읽고 싶다면 write()로 한바이트를 써서 읽고 싶은 주소를 지정하고, 쓰기를 할 때는 I2C 장치 주소를 제외한 나머지를 write()에 넘겨주면 됩니다.
Freedom is another word for nothing left to lose,
Nothing doesn't mean nothing if it ain't free.
댓글 달기