diff options
author | Paul Selkirk <paul@psgd.org> | 2015-04-08 16:01:31 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2015-04-08 16:03:15 -0400 |
commit | aeaf94f4e83826fe56f38fc670973a60a5010ef1 (patch) | |
tree | 6f3d3ba5d0caf5be29f2a4f873a97b8070d6adc9 /i2c/sw/tc_i2c.h | |
parent | 891a24d969181f02762c031b9cfe0fd96c116634 (diff) |
Unify and refactor eim and i2c software.
Unify memory maps.
Move tc_init, tc_next, tc_wait_* into tc_[eim|i2c].c.
Move eim_setup into tc_eim.c, move i2c_open into tc_i2c.c.
Diffstat (limited to 'i2c/sw/tc_i2c.h')
-rw-r--r-- | i2c/sw/tc_i2c.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/i2c/sw/tc_i2c.h b/i2c/sw/tc_i2c.h index f9648da..b1afae1 100644 --- a/i2c/sw/tc_i2c.h +++ b/i2c/sw/tc_i2c.h @@ -33,15 +33,23 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/* I2C configuration */ -#define I2C_dev "/dev/i2c-2" -#define I2C_addr 0x0f +/* cryptech memory map */ +#define BASE_ADDR 0 +#define SEGMENT_SIZE 0x2000 +#define ADDR(x) (x) +#include "cryptech_memory_map.h" -/* I2C public functions */ -int i2c_open(char *dev, int addr); +/* I2C configuration */ +#define I2C_dev "/dev/i2c-2" +#define I2C_addr 0x0f +#define I2C_SLAVE 0x0703 /* test case public functions */ int tc_write(off_t offset, const uint8_t *data, size_t len); int tc_read(off_t offset, uint8_t *data, size_t len); int tc_expected(off_t offset, const uint8_t *data, size_t len); +int tc_init(off_t offset); +int tc_next(off_t offset); int tc_wait(off_t offset, uint8_t status, int *count); +int tc_wait_ready(off_t offset); +int tc_wait_valid(off_t offset); |