File tree Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Expand file tree Collapse file tree 2 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -470,6 +470,27 @@ uint8_t cmd_loop(void) {
470
470
resp = 0 ;
471
471
break ;
472
472
}
473
+ case CMD_READ_REG : {
474
+ len = SLIP_recv (args , sizeof (args ));
475
+ if (len == 4 ) {
476
+ uint32_t value = READ_PERI_REG ((uint32_t * ) args [0 ]);
477
+ SLIP_send (& value , sizeof (value ));
478
+ resp = 0 ;
479
+ } else {
480
+ resp = 0x91 ;
481
+ }
482
+ break ;
483
+ }
484
+ case CMD_WRITE_REG : {
485
+ len = SLIP_recv (args , sizeof (args ));
486
+ if (len == 8 ) {
487
+ WRITE_PERI_REG ((uint32_t * ) args [0 ], args [1 ]);
488
+ resp = 0 ;
489
+ } else {
490
+ resp = 0xa1 ;
491
+ }
492
+ break ;
493
+ }
473
494
}
474
495
SLIP_send (& resp , 1 );
475
496
} while (cmd != CMD_BOOT_FW && cmd != CMD_REBOOT );
Original file line number Diff line number Diff line change @@ -91,6 +91,24 @@ enum stub_cmd {
91
91
* Output: arguments.
92
92
*/
93
93
CMD_ECHO = 8 ,
94
+
95
+ /*
96
+ * Read register value.
97
+ *
98
+ * Args: register address.
99
+ * Input: None.
100
+ * Output: register value.
101
+ */
102
+ CMD_READ_REG = 9 ,
103
+
104
+ /*
105
+ * Write register value.
106
+ *
107
+ * Args: register address, value.
108
+ * Input: None.
109
+ * Output: None.
110
+ */
111
+ CMD_WRITE_REG = 10 ,
94
112
};
95
113
96
114
#endif /* CS_COMMON_PLATFORMS_ESP8266_STUBS_STUB_FLASHER_H_ */
You can’t perform that action at this time.
0 commit comments