/*
* WARNING: be careful changing this code, it is very timing dependent
*/
// Serial pulse period in microseconds. Its probably a bad idea to lower this
// value.
uint8_t volatile serial_slave_buffer = ;
uint8_t volatile serial_master_buffer = ;
volatile uint8_t status = 0;
inline static
void
inline static
void
// make the serial pin an input with pull-up resistor
inline static
void
inline static
uint8_t
inline static
void
inline static
void
void
void
// Used by the master to synchronize timing with the slave.
static
void
// Used by the slave to send a synchronization signal to the master.
static
void
// Reads a byte from the serial line
static
uint8_t
// Sends a byte with MSB ordering
static
void
// interrupt handle to be used by the slave device
inline
bool
// Copies the serial_slave_buffer to the master and sends the
// serial_master_buffer to the slave.
//
// Returns:
// 0 => no error
// 1 => slave did not respond
int