Lines Matching +full:bus +full:- +full:addr

19 int smbus_quick_command(I2CBus *bus, uint8_t addr, int read)  in smbus_quick_command()  argument
21 if (i2c_start_transfer(bus, addr, read)) { in smbus_quick_command()
22 return -1; in smbus_quick_command()
24 i2c_end_transfer(bus); in smbus_quick_command()
28 int smbus_receive_byte(I2CBus *bus, uint8_t addr) in smbus_receive_byte() argument
32 if (i2c_start_recv(bus, addr)) { in smbus_receive_byte()
33 return -1; in smbus_receive_byte()
35 data = i2c_recv(bus); in smbus_receive_byte()
36 i2c_nack(bus); in smbus_receive_byte()
37 i2c_end_transfer(bus); in smbus_receive_byte()
41 int smbus_send_byte(I2CBus *bus, uint8_t addr, uint8_t data) in smbus_send_byte() argument
43 if (i2c_start_send(bus, addr)) { in smbus_send_byte()
44 return -1; in smbus_send_byte()
46 i2c_send(bus, data); in smbus_send_byte()
47 i2c_end_transfer(bus); in smbus_send_byte()
51 int smbus_read_byte(I2CBus *bus, uint8_t addr, uint8_t command) in smbus_read_byte() argument
54 if (i2c_start_send(bus, addr)) { in smbus_read_byte()
55 return -1; in smbus_read_byte()
57 i2c_send(bus, command); in smbus_read_byte()
58 if (i2c_start_recv(bus, addr)) { in smbus_read_byte()
59 i2c_end_transfer(bus); in smbus_read_byte()
60 return -1; in smbus_read_byte()
62 data = i2c_recv(bus); in smbus_read_byte()
63 i2c_nack(bus); in smbus_read_byte()
64 i2c_end_transfer(bus); in smbus_read_byte()
68 int smbus_write_byte(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t data) in smbus_write_byte() argument
70 if (i2c_start_send(bus, addr)) { in smbus_write_byte()
71 return -1; in smbus_write_byte()
73 i2c_send(bus, command); in smbus_write_byte()
74 i2c_send(bus, data); in smbus_write_byte()
75 i2c_end_transfer(bus); in smbus_write_byte()
79 int smbus_read_word(I2CBus *bus, uint8_t addr, uint8_t command) in smbus_read_word() argument
82 if (i2c_start_send(bus, addr)) { in smbus_read_word()
83 return -1; in smbus_read_word()
85 i2c_send(bus, command); in smbus_read_word()
86 if (i2c_start_recv(bus, addr)) { in smbus_read_word()
87 i2c_end_transfer(bus); in smbus_read_word()
88 return -1; in smbus_read_word()
90 data = i2c_recv(bus); in smbus_read_word()
91 data |= i2c_recv(bus) << 8; in smbus_read_word()
92 i2c_nack(bus); in smbus_read_word()
93 i2c_end_transfer(bus); in smbus_read_word()
97 int smbus_write_word(I2CBus *bus, uint8_t addr, uint8_t command, uint16_t data) in smbus_write_word() argument
99 if (i2c_start_send(bus, addr)) { in smbus_write_word()
100 return -1; in smbus_write_word()
102 i2c_send(bus, command); in smbus_write_word()
103 i2c_send(bus, data & 0xff); in smbus_write_word()
104 i2c_send(bus, data >> 8); in smbus_write_word()
105 i2c_end_transfer(bus); in smbus_write_word()
109 int smbus_read_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data, in smbus_read_block() argument
116 if (i2c_start_send(bus, addr)) { in smbus_read_block()
117 return -1; in smbus_read_block()
119 i2c_send(bus, command); in smbus_read_block()
121 if (i2c_start_recv(bus, addr)) { in smbus_read_block()
123 i2c_end_transfer(bus); in smbus_read_block()
125 return -1; in smbus_read_block()
128 rlen = i2c_recv(bus); in smbus_read_block()
136 data[i] = i2c_recv(bus); in smbus_read_block()
138 i2c_nack(bus); in smbus_read_block()
139 i2c_end_transfer(bus); in smbus_read_block()
143 int smbus_write_block(I2CBus *bus, uint8_t addr, uint8_t command, uint8_t *data, in smbus_write_block() argument
152 if (i2c_start_send(bus, addr)) { in smbus_write_block()
153 return -1; in smbus_write_block()
155 i2c_send(bus, command); in smbus_write_block()
157 i2c_send(bus, len); in smbus_write_block()
160 i2c_send(bus, data[i]); in smbus_write_block()
162 i2c_end_transfer(bus); in smbus_write_block()