AT07334: SAM4 TWI Master Mode Driver [APPLICATION NOTE]
42274A-MCU-05/2014
16
Table 4-19. Parameters
Data direction Parameter name Description
[in] twim Base address of the TWIM
[in] config Options for initializing the TWIM
module
Table 4-20. Return Values
Return value Description
STATUS_OK Transaction is successful
ERR_INVALID_ARG Invalid arg resulting in wrong CWGR Exponential
4.4.15 Function twim_set_hsmode_speed()
Set the TWI bus speed in conjunction with the clock frequency in high speed mode.
status_code_t twim_set_hsmode_speed(
Twim * twim,
uint32_t speed,
uint32_t clk,
uint8_t cycles)
Table 4-21. Parameters
Data direction Parameter name Description
[in] twim Base address of the TWIM
[in] speed The desired twim bus speed
[in] clk The current running system clock
frequency
[in] cycles Clock cycles for data setup count
Table 4-22. Return Values
Return value Description
STATUS_OK Transaction is successful
ERR_INVALID_ARG Invalid arg resulting in wrong CWGR Exponential
4.4.16 Function twim_set_speed()
Set the TWI bus speed in conjunction with the clock frequency.
status_code_t twim_set_speed(
Twim * twim,
uint32_t speed,
uint32_t clk,
uint8_t cycles)
Table 4-23. Parameters
Data direction Parameter name Description
[in] twim Base address of the TWIM
[in] speed The desired twim bus speed