#include "protocol.h"
#include "cmd_ctor.h" // MAKE_CMD, REGISTER_CMD
#include "verstag.h"
+
#include "hw/hw_adc.h"
#include "hw/hw_input.h"
/// Readline context, used for interactive mode.
static struct RLContext rl_ctx;
+static Sipo fd_sipo;
+
uint8_t reg_status_dout;
/**
* Send a NAK asking the host to send the current message again.
/* Dout */
MAKE_CMD(dout, "d", "",
({
- sipo_putchar((uint8_t)args[1].l);
+ kfile_putc((uint8_t)args[1].l, &fd_sipo.fd);
//Store status of dout ports.
reg_status_dout = (uint8_t)args[1].l;
/* Initialization: readline context, parser and register commands. */
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;
rl_init_ctx(&rl_ctx);