HWA
Bare metal programming with style
|
This class implements a software-emulated TWI master.
Header file:
HW_SWTWIMASTER( scl, <scl>, sda, <sda>, bps, <bps> ) defines a SWTWIMASTER object:
Example:
HW_DECLARE( TWI ) declares the functions that implement the TWI object:
HW_IMPLEMENT( TWI ) declares the functions that implement the TWI object:
hw( configure, TWI ) and hwa( configure, TWI ) configure the object:
hw( xfr_start, TWI ) sends a start condition on the TWI bus:
hw( xfr_slar, TWI, slave_address ) sends slave address + read bit:
hw( xfr_slaw, TWI, slave_address ) sends slave address + write bit:
hw( xfr_read, TWI, data, ack|nack ) receive one data byte:
hw( xfr_write, TWI, data ) transmit one data byte:
hw( xfr_stop, TWI ) sends a start condition on the TWI bus:
hw( stat, TWI ) get the status byte of the object:
Macros | |
#define | HW_SWTWIMASTER(...) |