Lines Matching full:eeprom
10 * @brief EEPROM shell commands.
14 #include <zephyr/drivers/eeprom.h>
35 const struct device *eeprom; in cmd_read() local
45 eeprom = shell_device_get_binding(argv[args_indx.device]); in cmd_read()
46 if (!eeprom) { in cmd_read()
47 shell_error(sh, "EEPROM device not found"); in cmd_read()
51 shell_print(sh, "Reading %zu bytes from EEPROM, offset %zu...", len, in cmd_read()
58 err = eeprom_read(eeprom, addr, data, pending); in cmd_read()
60 shell_error(sh, "EEPROM read failed (err %d)", err); in cmd_read()
76 const struct device *eeprom; in cmd_write() local
101 eeprom = shell_device_get_binding(argv[args_indx.device]); in cmd_write()
102 if (!eeprom) { in cmd_write()
103 shell_error(sh, "EEPROM device not found"); in cmd_write()
107 shell_print(sh, "Writing %zu bytes to EEPROM...", len); in cmd_write()
109 err = eeprom_write(eeprom, offset, wr_buf, len); in cmd_write()
111 shell_error(sh, "EEPROM write failed (err %d)", err); in cmd_write()
117 err = eeprom_read(eeprom, offset, rd_buf, len); in cmd_write()
119 shell_error(sh, "EEPROM read failed (err %d)", err); in cmd_write()
135 const struct device *eeprom; in cmd_size() local
137 eeprom = shell_device_get_binding(argv[args_indx.device]); in cmd_size()
138 if (!eeprom) { in cmd_size()
139 shell_error(sh, "EEPROM device not found"); in cmd_size()
143 shell_print(sh, "%zu bytes", eeprom_get_size(eeprom)); in cmd_size()
151 const struct device *eeprom; in cmd_fill() local
170 eeprom = shell_device_get_binding(argv[args_indx.device]); in cmd_fill()
171 if (!eeprom) { in cmd_fill()
172 shell_error(sh, "EEPROM device not found"); in cmd_fill()
176 shell_print(sh, "Writing %zu bytes of 0x%02lx to EEPROM...", len, in cmd_fill()
183 err = eeprom_write(eeprom, addr, wr_buf, pending); in cmd_fill()
185 shell_error(sh, "EEPROM write failed (err %d)", err); in cmd_fill()
197 err = eeprom_read(eeprom, addr, rd_buf, pending); in cmd_fill()
199 shell_error(sh, "EEPROM read failed (err %d)", err); in cmd_fill()
241 SHELL_CMD_REGISTER(eeprom, &eeprom_cmds, "EEPROM shell commands", NULL);