X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=examples%2Ftriface%2Fprotocol.c;h=254880e5657287ffb19dd9fde352940559a6f7a1;hb=165ee3ab958eaab69c819853d527408e96a92ace;hp=156a414bc802983c28bc6a3f2d0f0ba43ba94497;hpb=e1fa8a6e8b036732e1bf86332c87b82677cd9a2a;p=bertos.git diff --git a/examples/triface/protocol.c b/examples/triface/protocol.c index 156a414b..254880e5 100644 --- a/examples/triface/protocol.c +++ b/examples/triface/protocol.c @@ -283,7 +283,7 @@ MAKE_CMD(ping, "", "", /* Dout */ MAKE_CMD(dout, "d", "", ({ - kfile_write(&fd_sipo.fd, (uint8_t *)&args[1].l, 1); + kfile_putc((uint8_t)args[1].l, &fd_sipo.fd); //Store status of dout ports. reg_status_dout = (uint8_t)args[1].l; @@ -360,6 +360,11 @@ static void protocol_registerCmds(void) void protocol_init(KFile *fd) { /* SPI Port Initialization */ + fd_sipo.load_device = TRIFACE_DOUT; + fd_sipo.bit_order = SIPO_DATAORDER_LSB; + fd_sipo.clock_pol = SIPO_START_LOW; + fd_sipo.load_pol = SIPO_LOW_TO_HIGH; + sipo_init(&fd_sipo); interactive = FORCE_INTERACTIVE;