Lines Matching +full:read +full:- +full:command
5 * SPDX-License-Identifier: Apache-2.0
24 * smbus <shell command> <device> <peripheral address> <command byte>
35 * WARNING: As there is no standard SMBUS detection command, this code
42 * https://manpages.debian.org/buster/i2c-tools/i2cdetect.8.en.html
54 return -ENODEV; in cmd_smbus_scan()
71 shell_fprintf(sh, SHELL_NORMAL, "-- "); in cmd_smbus_scan()
93 return -ENODEV; in cmd_smbus_quick()
117 return -ENODEV; in cmd_smbus_byte_read()
124 shell_error(sh, "SMBus: Failed to read from periph: 0x%02x", in cmd_smbus_byte_read()
126 return -EIO; in cmd_smbus_byte_read()
146 return -ENODEV; in cmd_smbus_byte_write()
150 /* First byte is command */ in cmd_smbus_byte_write()
157 return -EIO; in cmd_smbus_byte_write()
168 uint8_t addr, command; in cmd_smbus_byte_data_read() local
175 return -ENODEV; in cmd_smbus_byte_data_read()
179 command = strtol(argv[ARGV_CMD], NULL, 16); in cmd_smbus_byte_data_read()
181 ret = smbus_byte_data_read(dev, addr, command, &out); in cmd_smbus_byte_data_read()
183 shell_error(sh, "SMBus: Failed to read from periph: 0x%02x", in cmd_smbus_byte_data_read()
185 return -EIO; in cmd_smbus_byte_data_read()
198 uint8_t addr, command; in cmd_smbus_byte_data_write() local
205 return -ENODEV; in cmd_smbus_byte_data_write()
209 command = strtol(argv[ARGV_CMD], NULL, 16); in cmd_smbus_byte_data_write()
212 ret = smbus_byte_data_write(dev, addr, command, value); in cmd_smbus_byte_data_write()
216 return -EIO; in cmd_smbus_byte_data_write()
227 uint8_t addr, command; in cmd_smbus_word_data_read() local
234 return -ENODEV; in cmd_smbus_word_data_read()
238 command = strtol(argv[ARGV_CMD], NULL, 16); in cmd_smbus_word_data_read()
240 ret = smbus_word_data_read(dev, addr, command, &out); in cmd_smbus_word_data_read()
242 shell_error(sh, "SMBus: Failed to read from periph: 0x%02x", in cmd_smbus_word_data_read()
244 return -EIO; in cmd_smbus_word_data_read()
257 uint8_t addr, command; in cmd_smbus_word_data_write() local
264 return -ENODEV; in cmd_smbus_word_data_write()
268 command = strtol(argv[ARGV_CMD], NULL, 16); in cmd_smbus_word_data_write()
271 ret = smbus_word_data_write(dev, addr, command, value); in cmd_smbus_word_data_write()
275 return -EIO; in cmd_smbus_word_data_write()
286 uint8_t addr, command; in cmd_smbus_block_write() local
287 uint8_t count = argc - 4; in cmd_smbus_block_write()
293 return -EINVAL; in cmd_smbus_block_write()
299 return -ENODEV; in cmd_smbus_block_write()
303 command = strtol(argv[ARGV_CMD], NULL, 16); in cmd_smbus_block_write()
311 ret = smbus_block_write(dev, addr, command, count, buf); in cmd_smbus_block_write()
326 uint8_t addr, command; in cmd_smbus_block_read() local
334 return -ENODEV; in cmd_smbus_block_read()
338 command = strtol(argv[ARGV_CMD], NULL, 16); in cmd_smbus_block_read()
340 ret = smbus_block_read(dev, addr, command, &count, buf); in cmd_smbus_block_read()
342 shell_error(sh, "Failed block read from periph: 0x%02x", in cmd_smbus_block_read()
349 return -ENODATA; in cmd_smbus_block_read()
362 entry->syntax = (dev != NULL) ? dev->name : NULL; in device_name_get()
363 entry->handler = NULL; in device_name_get()
364 entry->help = NULL; in device_name_get()
365 entry->subcmd = NULL; in device_name_get()
372 "SMBus Quick command\n"
376 "Scan SMBus peripheral devices command\n"
380 "SMBus: byte read command\n"
384 "SMBus: byte write command\n"
388 "SMBus: byte data read command\n"
392 "SMBus: byte data write command\n"
396 "SMBus: word data read command\n"
400 "SMBus: word data write command\n"
404 "SMBus: Block Write command\n"
408 "SMBus: Block Read command\n"