AT07334: SAM4 TWI Master Mode Driver [APPLICATION NOTE]
42274A-MCU-05/2014
15
Data direction Parameter name Description
[in] read True if it's a read trasnfer
4.4.12 Function twim_probe()
Test if a device answers for a given TWI address.
status_code_t twim_probe(
Twim * twim,
uint32_t chip_addr)
Table 4-16. Parameters
Data direction Parameter name Description
[in] twim Base address of the TWIM
[in] chip_addr Address of the device being
probed for
Table 4-17. Return Values
Return value Description
STATUS_OK Slave Found
ERR_IO_ERROR ANAK received or Bus Arbitration lost
4.4.13 Function twim_set_callback()
Set callback for TWIM.
void twim_set_callback(
Twim * twim,
uint32_t interrupt_source,
twim_callback_t callback,
uint8_t irq_level)
For a specfied interrupt source and interrupt level, register an interrupt service routine.
Table 4-18. Parameters
Data direction Parameter name Description
[in] twim Base address of the TWIM
[in] interrupt_source TWIM interrupt source
[in] callback Callback function pointer
[in] irq_level Interrupt level
4.4.14 Function twim_set_config()
Initialize the TWIM module.
status_code_t twim_set_config(
Twim * twim,
struct twim_config * config)