Driver for the TWIS (Two-Wire Slave Interface).
This driver provides access to the main features of the TWIS controller. The TWIS interconnects a TWI slave on a unique two-wire bus. The TWIS is programmable as a slave with sequential or single-byte access. Internal Address access and Ten bit addressing mode is supported.
Modules | |
Related Project(s) | |
In this section you can find all the projects related to the TWI - Two-Wire Slave Interface. | |
Data Structures | |
struct | twis_options_t |
Input parameters when initializing the twi module mode. More... | |
struct | twis_package_t |
Information concerning the data transmission. More... | |
struct | twis_slave_fct_t |
Pointer on TWI slave user specific application routines. More... | |
Functions | |
void | twis_send_data_ack (volatile avr32_twis_t *twis) |
Enable ACK transfer in Slave Receiver Mode. More... | |
void | twis_send_data_nack (volatile avr32_twis_t *twis, bool stop_callback) |
Enable NACK transfer in Slave Receive Mode. More... | |
status_code_t | twis_slave_init (volatile avr32_twis_t *twis, const twis_options_t *opt, const twis_slave_fct_t *slave_fct) |
Initialize the TWI Slave Module. More... | |
TWI Driver Compatibility | |
Codes for UC3 devices using TWI modules can easily be ported to UC3 devices with TWIM module | |
#define | avr32_twi_t avr32_twis_t |
#define | twi_options_t twis_options_t |
#define | twi_package_t twis_package_t |
#define | twi_slave_fct_t twis_slave_fct_t |
#define | twi_slave_init twis_slave_init |
#define avr32_twi_t avr32_twis_t |
#define twi_options_t twis_options_t |
#define twi_package_t twis_package_t |
#define twi_slave_fct_t twis_slave_fct_t |
#define twi_slave_init twis_slave_init |
void twis_send_data_ack | ( | volatile avr32_twis_t * | twis | ) |
Enable ACK transfer in Slave Receiver Mode.
twis | Base address of the TWI (i.e. &AVR32_TWIS). |
void twis_send_data_nack | ( | volatile avr32_twis_t * | twis, |
bool | stop_callback | ||
) |
Enable NACK transfer in Slave Receive Mode.
twis | Base address of the TWI (i.e. &AVR32_TWIS). |
stop_callback | Set true to use Stop condition Callback function |
References twis_slave_fct_t::stop.
status_code_t twis_slave_init | ( | volatile avr32_twis_t * | twis, |
const twis_options_t * | opt, | ||
const twis_slave_fct_t * | slave_fct | ||
) |
Initialize the TWI Slave Module.
twis | Base address of the TWI (i.e. &AVR32_TWIS). |
*opt | Options for initializing the TWI module (see twis_options_t) |
*slave_fct | Pointer on application functions |
References twis_options_t::chip, cpu_irq_disable, cpu_irq_restore(), cpu_irq_save(), irq_register_handler, twis_options_t::pba_hz, twis_options_t::smbus, twis_options_t::speed, STATUS_OK, twis_options_t::tenbit, and twis_inst_slave.