Change in simtrace2[master]: firmware: octsimtest: Add i/I command for setting card-insert via I2C...

laforge gerrit-no-reply at lists.osmocom.org
Sun Jun 6 09:47:02 UTC 2021


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/simtrace2/+/24572 )


Change subject: firmware: octsimtest: Add i/I command for setting card-insert via I2C GPIO
......................................................................

firmware: octsimtest: Add i/I command for setting card-insert via I2C GPIO

Change-Id: Ie1483ccf8465df0d640d55e50421fda910dced4a
---
M firmware/libboard/octsimtest/source/board_octsimtest.c
1 file changed, 10 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/simtrace2 refs/changes/72/24572/1

diff --git a/firmware/libboard/octsimtest/source/board_octsimtest.c b/firmware/libboard/octsimtest/source/board_octsimtest.c
index 5dff046..c77c1ce 100644
--- a/firmware/libboard/octsimtest/source/board_octsimtest.c
+++ b/firmware/libboard/octsimtest/source/board_octsimtest.c
@@ -35,10 +35,11 @@
 	switch (ch) {
 	case '?':
 		printf("\t?\thelp\n\r");
+		printf("\t0-8\tselect physical SIM slot\n\r");
 		printf("\tR\treset SAM3\n\r");
 		printf("\tm\trun mcp23017 test\n\r");
-		printf("\tR\ttoggle MSB of gpio on mcp23017\n\r");
-		printf("\t0-8\tselect physical SIM slot\n\r");
+		printf("\ti\tset card insert via I2C\n\r");
+		printf("\tI\tdisable card insert\n\r");
 		break;
 	case '0': mux_set_slot(0); break;
 	case '1': mux_set_slot(1); break;
@@ -56,8 +57,13 @@
 	case 'm':
 		mcp23017_test(MCP23017_ADDRESS);
 		break;
-	case 't':
-		mcp23017_toggle(MCP23017_ADDRESS);
+	case 'i':
+		printf("Setting card insert (slot=%u)\r\n", mux_get_slot());
+		mcp23017_set_output_a(MCP23017_ADDRESS, (1 << mux_get_slot()));
+		break;
+	case 'I':
+		printf("Releasing card insert (slot=%u)\r\n", mux_get_slot());
+		mcp23017_set_output_a(MCP23017_ADDRESS, 0);
 		break;
 	default:
 		printf("Unknown command '%c'\n\r", ch);

-- 
To view, visit https://gerrit.osmocom.org/c/simtrace2/+/24572
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: simtrace2
Gerrit-Branch: master
Gerrit-Change-Id: Ie1483ccf8465df0d640d55e50421fda910dced4a
Gerrit-Change-Number: 24572
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210606/9b994b1e/attachment.htm>


More information about the gerrit-log mailing list