Functions | |
void | twi_set_ack (uint8_t ack) |
void | twi_interrupt_config (uint8_t cmd) |
void | twi_send_byte (uint8_t val) |
void | twi_send_start (void) |
void | twi_send_stop (void) |
void | twi_set_prescalar (uint8_t pre) |
void | twi_wait_twint (void) |
uint8_t | twi_get_twint (void) |
uint8_t | twi_get_status (void) |
uint8_t | twi_get_byte (void) |
void | twi_set_state (uint8_t val) |
uint8_t | twi_get_state (void) |
uint8_t | twi_get_stop (void) |
void | twi_set_rate (uint8_t rate) |
void | twi_set_address (uint8_t address) |
void | twi_set_twint (void) |
uint8_t twi_get_byte | ( | void | ) | [inline] |
Return the byte received from the twi transaction
uint8_t twi_get_state | ( | void | ) | [inline] |
Get the state of the TWCR register
uint8_t twi_get_status | ( | void | ) | [inline] |
Return the status register
uint8_t twi_get_stop | ( | void | ) | [inline] |
Get the stop state of the TWI device.
uint8_t twi_get_twint | ( | void | ) | [inline] |
Return the TWINT status bit.
void twi_interrupt_config | ( | uint8_t | cmd | ) |
Configure the TWI interrupt.
cmd | TWI_INTERRUPT_ENABLE: enable the twi interrupt TWI_INTERRUPT_DISABLE: disable |
void twi_send_byte | ( | uint8_t | val | ) |
Place a byte for transmission into the buffer.
Note: Initiates the transmission of the byte immediately.
val | Byte value to transmit |
void twi_send_start | ( | void | ) |
Initiate the transmission of the "start" sequence
Note: initiates the transfer of this sequence.
void twi_send_stop | ( | void | ) |
Initiate the transfer of the the stop sequence
Note: Initiates the actual transfer immediately
void twi_set_ack | ( | uint8_t | ack | ) |
Set the state of the TWI acknowledgement.
Note: this does not initiate a transmission. A 2nd call is required to do this (e.g., twi_set_ack(), or twi_send_byte())
ack | TWI_ACKNOWLEDGE_ENABLE: acknowledge TWI_ACKNOWLEDGE_DISABLE: do not acknowledge |
Set the state of the acknowledgement bit.
Note: this does not initiate a transmission. A 2nd call is required to do this (e.g., twi_set_twint(), or twi_send_byte())
ack | TWI_ACKNOWLEDGE_ENABLE: acknowledge TWI_ACKNOWLEDGE_DISABLE: do not acknowledge |
void twi_set_address | ( | uint8_t | address | ) | [inline] |
Set the slave address
address | Slave address |
void twi_set_prescalar | ( | uint8_t | pre | ) |
Set the clock prescalar for the TWI device.
pre | One of: TWI_PRESCALAR_1: divide system clock by 1 TWI_PRESCALAR_4: divide by 4 TWI_PRESCALAR_16: divide by 16 TWI_PRESCALAR_64: divide by 64 |
void twi_set_rate | ( | uint8_t | rate | ) | [inline] |
Set the TWI data transmission rate
rate | Transmission rate |
void twi_set_state | ( | uint8_t | val | ) | [inline] |
Set the state of the TWCR register
val | The value to set TWCR to. |
void twi_set_twint | ( | void | ) | [inline] |
Force the twi device to initiate a transaction immediately. We assume that the device has already been configured
void twi_wait_twint | ( | void | ) |
Return when the twi device is ready to be serviced. This should only be used in non-interrupt mode.