Lines Matching refs:shell_ctx

50 static int cmd_i2c_scan(const struct shell *shell_ctx,  in cmd_i2c_scan()  argument
59 shell_error(shell_ctx, "I2C: Device driver %s not found.", in cmd_i2c_scan()
64 shell_print(shell_ctx, in cmd_i2c_scan()
67 shell_fprintf(shell_ctx, SHELL_NORMAL, "%02x: ", i); in cmd_i2c_scan()
70 shell_fprintf(shell_ctx, SHELL_NORMAL, " "); in cmd_i2c_scan()
82 shell_fprintf(shell_ctx, SHELL_NORMAL, in cmd_i2c_scan()
86 shell_fprintf(shell_ctx, SHELL_NORMAL, "-- "); in cmd_i2c_scan()
89 shell_print(shell_ctx, ""); in cmd_i2c_scan()
92 shell_print(shell_ctx, "%u devices found on %s", in cmd_i2c_scan()
99 static int cmd_i2c_recover(const struct shell *shell_ctx, in cmd_i2c_recover() argument
107 shell_error(shell_ctx, "I2C: Device driver %s not found.", in cmd_i2c_recover()
114 shell_error(shell_ctx, "I2C: Bus recovery failed (err %d)", in cmd_i2c_recover()
122 static int i2c_write_from_buffer(const struct shell *shell_ctx, in i2c_write_from_buffer() argument
140 shell_error(shell_ctx, "I2C: Device driver %s not found.", in i2c_write_from_buffer()
153 shell_info(shell_ctx, "Too many bytes provided, limit is %d", in i2c_write_from_buffer()
166 shell_error(shell_ctx, "Failed to write to device: %s", in i2c_write_from_buffer()
175 static int cmd_i2c_write(const struct shell *shell_ctx, in cmd_i2c_write() argument
178 return i2c_write_from_buffer(shell_ctx, argv[ARGV_DEV], in cmd_i2c_write()
184 static int cmd_i2c_write_byte(const struct shell *shell_ctx, in cmd_i2c_write_byte() argument
187 return i2c_write_from_buffer(shell_ctx, argv[ARGV_DEV], in cmd_i2c_write_byte()
192 static int i2c_read_to_buffer(const struct shell *shell_ctx, in i2c_read_to_buffer() argument
203 shell_error(shell_ctx, "I2C: Device driver %s not found.", in i2c_read_to_buffer()
227 shell_error(shell_ctx, "Failed to read from device: %s", in i2c_read_to_buffer()
236 static int cmd_i2c_read_byte(const struct shell *shell_ctx, in cmd_i2c_read_byte() argument
243 ret = i2c_read_to_buffer(shell_ctx, argv[ARGV_DEV], in cmd_i2c_read_byte()
246 shell_print(shell_ctx, "Output: 0x%x", out); in cmd_i2c_read_byte()
253 static int cmd_i2c_read(const struct shell *shell_ctx, size_t argc, char **argv) in cmd_i2c_read() argument
268 ret = i2c_read_to_buffer(shell_ctx, argv[ARGV_DEV], in cmd_i2c_read()
272 shell_hexdump(shell_ctx, buf, num_bytes); in cmd_i2c_read()
279 static int cmd_i2c_direct_read(const struct shell *shell_ctx, size_t argc, char **argv) in cmd_i2c_direct_read() argument
294 ret = i2c_read_to_buffer(shell_ctx, argv[ARGV_DEV], argv[ARGV_ADDR], NULL, buf, num_bytes); in cmd_i2c_direct_read()
296 shell_hexdump(shell_ctx, buf, num_bytes); in cmd_i2c_direct_read()
305 static int cmd_i2c_speed(const struct shell *shell_ctx, size_t argc, char **argv) in cmd_i2c_speed() argument
315 shell_error(shell_ctx, "I2C: Device driver %s not found.", in cmd_i2c_speed()
332 shell_error(shell_ctx, "I2C: Failed to configure device: %s", in cmd_i2c_speed()