This interface is used to communicate with a 3-wire
(microwire) serial EEPROM device, for example, the 93Cxx
series, via its pins. To set the values of the CS, SK, and
DI pins, use the set_cs(), set_sk(),
and set_di() functions, respectively. To read the
value output on the DO pin, use the get_do()
function. Zero represents low signal and non-zero high
signal. The read_word() and write_word()
functions are provided to shortcut high-level operations.
They operate on 8-bit or 16-bit entities depending on the
width of the eeprom.
#define MICROWIRE_INTERFACE "microwire"
SIM_INTERFACE(microwire) {
void (*set_cs)(conf_object_t *obj, int cs);
void (*set_sk)(conf_object_t *obj, int sk);
void (*set_di)(conf_object_t *obj, int di);
int (*get_do)(conf_object_t *obj);
uint16 (*read_word)(conf_object_t *obj, int offset);
void (*write_word)(conf_object_t *obj, int offset, uint16 value);
};