projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
more work on ccspi reflexive jam with autoack. jamming is slow in the autoack mode...
[goodfet]
/
firmware
/
include
/
sbw.h
diff --git
a/firmware/include/sbw.h
b/firmware/include/sbw.h
index
4e1756c
..
206dd6a
100644
(file)
--- a/
firmware/include/sbw.h
+++ b/
firmware/include/sbw.h
@@
-3,7
+3,17
@@
\brief Spy-Bi-Wire Stuff
*/
\brief Spy-Bi-Wire Stuff
*/
+#ifndef SBW_H
+#define SBW_H
+
+#include "app.h"
+extern app_t const sbw_app;
+
+#define SBW 0x17
+
#include "platform.h"
#include "platform.h"
+#include "command.h"
+#include "app.h"
//IO Pins; these are for EZ430, not GoodFET/UIF
#define SBWTCK BIT3
//IO Pins; these are for EZ430, not GoodFET/UIF
#define SBWTCK BIT3
@@
-18,13
+28,21
@@
// I/O Redefintions
extern int tms, tdi, tdo;
// I/O Redefintions
extern int tms, tdi, tdo;
+#undef SETTMS
#define SETTMS tms=1
#define SETTMS tms=1
+#undef CLRTMS
#define CLRTMS tms=0
#define CLRTMS tms=0
+#undef SETTDI
#define SETTDI tdi=1
#define SETTDI tdi=1
+#undef CLRTDI
#define CLRTDI tdi=0
#define CLRTDI tdi=0
+#undef TCKTOCK
#define TCKTOCK clock_sbw()
#define TCKTOCK clock_sbw()
+#undef SETMOSI
#define SETMOSI SETTDI
#define SETMOSI SETTDI
+#undef CLRMOSI
#define CLRMOSI CLRTDI
#define CLRMOSI CLRTDI
+#undef READMISO
#define READMISO tdo
#endif
#define READMISO tdo
#endif
@@
-33,7
+51,7
@@
extern int tms, tdi, tdo;
void sbwsetup();
//! Handle a SBW request.
void sbwsetup();
//! Handle a SBW request.
-void sbw
handle(u8 app, u8 verb, u8
len);
+void sbw
_handler_fn(u8 app, u8 verb, u32
len);
//! Perform a SBW bit transaction.
void clock_sbw();
//! Perform a SBW bit transaction.
void clock_sbw();
@@
-44,17
+62,17
@@
void sbwCLRTCLK();
// Macros
#define SBWCLK() do { \
// Macros
#define SBWCLK() do { \
-
P5
OUT &= ~SBWTCK; \
+
SPI
OUT &= ~SBWTCK; \
asm("nop"); \
asm("nop"); \
asm("nop"); \
asm("nop"); \
asm("nop"); \
asm("nop"); \
-
P5
OUT |= SBWTCK; \
+
SPI
OUT |= SBWTCK; \
} while (0)
#define SETSBWIO(x) do { \
if (x) \
} while (0)
#define SETSBWIO(x) do { \
if (x) \
-
P5OUT |= SBWTDIO;
\
+
SPIOUT |= SBWTDIO;
\
else \
else \
-
P5OUT &= ~SBWTDIO;
\
+
SPIOUT &= ~SBWTDIO;
\
} while (0)
#undef RESTORETCLK
#define RESTORETCLK do { \
} while (0)
#undef RESTORETCLK
#define RESTORETCLK do { \
@@
-79,5
+97,5
@@
void sbwCLRTCLK();
//Do nothing for this.
#define SAVETCLK
//Do nothing for this.
#define SAVETCLK
-
+#endif // SBW_H