projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated command line 802.15.4 checksum calculator and added serClose to GoodFET to...
[goodfet]
/
firmware
/
include
/
sbw.h
diff --git
a/firmware/include/sbw.h
b/firmware/include/sbw.h
index
4bd4f5e
..
206dd6a
100644
(file)
--- a/
firmware/include/sbw.h
+++ b/
firmware/include/sbw.h
@@
-6,6
+6,11
@@
#ifndef SBW_H
#define SBW_H
#ifndef SBW_H
#define SBW_H
+#include "app.h"
+extern app_t const sbw_app;
+
+#define SBW 0x17
+
#include "platform.h"
#include "command.h"
#include "app.h"
#include "platform.h"
#include "command.h"
#include "app.h"
@@
-23,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
@@
-38,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();
@@
-49,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 { \