Macros | |
#define | TWI_BAUD(F_SYS, F_TWI) (((F_SYS / (2 * F_TWI)) - 5)+1) |
#define | TWI_SUCCESS (STATUS_OK) |
Error Codes for the Module. More... | |
Functions | |
static void | twi_master_disable (TWI_t *twi) |
Disable Master Mode of the TWI. More... | |
static void | twi_master_enable (TWI_t *twi) |
Enable Master Mode of the TWI. More... | |
status_code_t | twi_master_init (TWI_t *twi, const twi_options_t *opt) |
Initialize the twi master module. More... | |
static status_code_t | twi_master_read (TWI_t *twi, const twi_package_t *package) |
Read multiple bytes from a TWI compatible slave device. More... | |
status_code_t | twi_master_transfer (TWI_t *twi, const twi_package_t *package, bool read) |
Perform a TWI master write or read transfer. More... | |
static status_code_t | twi_master_write (TWI_t *twi, const twi_package_t *package) |
Write multiple bytes to a TWI compatible slave device. More... | |
#define TWI_BAUD | ( | F_SYS, | |
F_TWI | |||
) | (((F_SYS / (2 * F_TWI)) - 5)+1) |
Baud register setting calculation. Formula described in datasheet.
Referenced by run_twi_master_recv_test(), run_twi_master_send_test(), run_twi_slave_recv_test(), twi_master_setup(), and twi_slave_setup().
#define TWI_SUCCESS (STATUS_OK) |
Error Codes for the Module.
Referenced by check_NVRBSY(), main(), mxt_probe_device(), read_temperature(), ts75_copy_nonvol_vol_register(), ts75_copy_vol_nonvol_register(), ts75_probe_nonvol_register(), ts_ack_polling(), ts_read_eeprom(), ts_read_register(), ts_write_eeprom(), ts_write_memory(), and ts_write_register().
|
inlinestatic |
Disable Master Mode of the TWI.
twi | Base address of the TWI instance. |
Referenced by sha204p_wakeup().
|
inlinestatic |
Enable Master Mode of the TWI.
twi | Base address of the TWI instance. |
Referenced by run_twi_master_recv_test(), run_twi_master_send_test(), run_twi_slave_recv_test(), and sha204p_wakeup().
status_code_t twi_master_init | ( | TWI_t * | twi, |
const twi_options_t * | opt | ||
) |
Initialize the twi master module.
twi | Base address of the TWI (i.e. &TWIC). |
*opt | Options for initializing the twi module (see twi_options_t) |
STATUS_OK | Transaction is successful |
ERR_INVALID_ARG | Invalid arguments in opt . |
References cpu_irq_enable, twi_options_t::speed_reg, STATUS_OK, and transfer.
Referenced by run_twi_master_recv_test(), run_twi_master_send_test(), run_twi_slave_recv_test(), and twi_master_setup().
|
inlinestatic |
Read multiple bytes from a TWI compatible slave device.
twi | Base address of the TWI (i.e. &TWI_t). |
package | Package information and data (see twi_package_t) |
References twi_master_transfer().
Referenced by main(), mxt_get_crc_value(), mxt_get_message_count(), mxt_probe_device(), mxt_read_config_object(), mxt_read_config_reg(), mxt_read_id_block(), mxt_read_message(), mxt_read_object_table(), qt_read_regs(), run_twi_master_recv_test(), sha204p_receive_response(), sha204p_resync(), and twi_read().
status_code_t twi_master_transfer | ( | TWI_t * | twi, |
const twi_package_t * | package, | ||
bool | read | ||
) |
Perform a TWI master write or read transfer.
This function is a TWI Master write or read transaction.
twi | Base address of the TWI (i.e. &TWI_t). |
package | Package information and data (see twi_package_t) |
read | Selects the transfer direction |
References twi_package_t::addr_length, twi_package_t::chip, ERR_INVALID_ARG, twi_package_t::no_wait, read, status, STATUS_OK, transfer, twim_acquire(), and twim_release().
Referenced by twi_master_read(), and twi_master_write().
|
inlinestatic |
Write multiple bytes to a TWI compatible slave device.
twi | Base address of the TWI (i.e. &TWI_t). |
package | Package information and data (see twi_package_t) |
References twi_master_transfer().
Referenced by main(), mxt_write_config_object(), mxt_write_config_reg(), qt_read_regs(), qt_write_regs(), run_twi_master_send_test(), run_twi_slave_recv_test(), sha204p_send(), sha204p_wakeup(), twi_probe_device(), and twi_write().