AT07334: SAM4 TWI Master Mode Driver [APPLICATION NOTE]
42274A-MCU-05/2014
9
Type Name Description
bool smbus SMBUS mode
uint32_t speed The baudrate of the TWI bus
uint32_t twim_clk The TWIM clock frequency
4.2.2 Struct twim_package
Table 4-2. Members
Type Name Description
uint8_t addr[] TWI address/commands to issue to
the other chip (node)
uint8_t addr_length Length of the TWI data address
segment (1-3 bytes)
void * buffer Where to find the data to be written
uint32_t chip TWI chip address to communicate
with
bool high_speed Indicate if it is a high-speed
transfer
uint8_t high_speed_code High speed mode master code,
valid if high_speed is true
uint32_t length How many bytes do we want to
write
bool ten_bit Indicate if it is 10-bit addressing
4.3 Macro Definitions
4.3.1 TWI Driver Compatibility
These codes are defined for SAM devices to simplify the porting of existing code from other Atmel devices. For the
definition of technical terms and acronyms refer to Acronyms and the appropriate device datasheet.
4.3.1.1 Macro twi_options_t
#define twi_options_t
4.3.1.2 Macro twi_package_t
#define twi_package_t
4.3.1.3 Macro twi_master_init
#define twi_master_init