/* low level command set
*/
-static int ep93xx_read(void);
-static void ep93xx_write(int tck, int tms, int tdi);
-static void ep93xx_reset(int trst, int srst);
+static bb_value_t ep93xx_read(void);
+static int ep93xx_write(int tck, int tms, int tdi);
+static int ep93xx_reset(int trst, int srst);
static int ep93xx_init(void);
static int ep93xx_quit(void);
.blink = 0,
};
-static int ep93xx_read(void)
+static bb_value_t ep93xx_read(void)
{
- return !!(*gpio_data_register & TDO_BIT);
+ return (*gpio_data_register & TDO_BIT) ? BB_HIGH : BB_LOW;
}
-static void ep93xx_write(int tck, int tms, int tdi)
+static int ep93xx_write(int tck, int tms, int tdi)
{
if (tck)
output_value |= TCK_BIT;
*gpio_data_register = output_value;
nanosleep(&ep93xx_zzzz, NULL);
+
+ return ERROR_OK;
}
/* (1) assert or (0) deassert reset lines */
-static void ep93xx_reset(int trst, int srst)
+static int ep93xx_reset(int trst, int srst)
{
if (trst == 0)
output_value |= TRST_BIT;
*gpio_data_register = output_value;
nanosleep(&ep93xx_zzzz, NULL);
+
+ return ERROR_OK;
}
static int set_gonk_mode(void)