projects
/
goodfet
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Glitching functions.
[goodfet]
/
firmware
/
apps
/
i2c
/
i2c.c
diff --git
a/firmware/apps/i2c/i2c.c
b/firmware/apps/i2c/i2c.c
index
1171ee1
..
dc26032
100644
(file)
--- a/
firmware/apps/i2c/i2c.c
+++ b/
firmware/apps/i2c/i2c.c
@@
-1,5
+1,8
@@
-//GoodFET I2C Master Application
-//Handles basic I/O
+/*! \file i2c.c
+ \author Travis Goodspeed
+ \brief I2C Master
+*/
+
//Higher level left to client application.
//Higher level left to client application.
@@
-37,7
+40,7
@@
#define I2C_CLOCK_HI() SETSCL
#define I2C_CLOCK_LO() CLRSCL
#define I2C_CLOCK_HI() SETSCL
#define I2C_CLOCK_LO() CLRSCL
-#warning "Using internal resistors. Won't work on 161x devices."
+
//
#warning "Using internal resistors. Won't work on 161x devices."
//! Inits bitbanging port, must be called before using the functions below
void I2C_Init()
//! Inits bitbanging port, must be called before using the functions below
void I2C_Init()
@@
-46,6
+49,7
@@
void I2C_Init()
//Clear SDA and SCL.
//Direction, not value, is used to set the value.
//(Pull-up or 0.)
//Clear SDA and SCL.
//Direction, not value, is used to set the value.
//(Pull-up or 0.)
+
P5DIR|=(SDA|SCL);
P5REN|=SDA|SCL;
P5DIR|=(SDA|SCL);
P5REN|=SDA|SCL;
@@
-155,7
+159,7
@@
unsigned char I2C_Read( unsigned char ack )
//! Handles a monitor command.
void i2chandle(unsigned char app,
unsigned char verb,
//! Handles a monitor command.
void i2chandle(unsigned char app,
unsigned char verb,
- unsigned
char
len){
+ unsigned
long
len){
unsigned char i;
switch(verb){
unsigned char i;
switch(verb){