/*
* WARNING: be careful changing this code, it is very timing dependent
*/
// Serial pulse period in microseconds.
// Very High speed
// High speed
// Middle speed
// Low speed
// Very Low speed
uint8_t volatile serial_slave_buffer = ;
uint8_t volatile serial_master_buffer = ;
volatile uint8_t status = 0;
inline static
void
inline static
void
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 sender to synchronize timing with the reciver.
static
void
// Used by the reciver to send a synchronization signal to the sender.
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
// 2 => checksum error
int