twi_at91.h File Reference
Driver for the AT91 ARM TWI (implementation). More...
#include <cfg/compiler.h>
Go to the source code of this file.
Functions | |
| void | twi_init (void) |
| Init the (broken) sam7 twi driver. | |
| bool | twi_read (uint8_t id, twi_iaddr_t byte1, twi_iaddr_t byte2, twi_iaddr_t byte3, void *_buf, size_t len) |
| Read size bytes from the twi line from slave id. | |
| bool | twi_write (uint8_t id, twi_iaddr_t byte1, twi_iaddr_t byte2, twi_iaddr_t byte3, const void *_buf, size_t len) |
| Send size bytes over the twi line to slave id. | |
Detailed Description
Driver for the AT91 ARM TWI (implementation).
- Version:
- Id
- twi_at91.h 1221 2008-04-09 14:38:11Z batt
Definition in file twi_at91.h.
Function Documentation
| bool twi_read | ( | uint8_t | id, | |
| twi_iaddr_t | byte1, | |||
| twi_iaddr_t | byte2, | |||
| twi_iaddr_t | byte3, | |||
| void * | _buf, | |||
| size_t | size | |||
| ) |
Read size bytes from the twi line from slave id.
If the device requires internal addressing before reading, byte1 byte2 and byte3 must be specified. Internal addressign bytes not used *must* be set to TWI_NO_IADDR. If 1 or 2 bytes are required for internal addressing you *must* first use byte1 and than byte2.
- Note:
- Atmel TWI implementation is broken so it was not possible to supply a better interface. Additionally NACK handling is also broken, so if the i2c device reply nack this function will return after TWI_TIMEOUT.
- Returns:
- true if ok, false on slave timeout.
Definition at line 140 of file twi_at91.c.
| bool twi_write | ( | uint8_t | id, | |
| twi_iaddr_t | byte1, | |||
| twi_iaddr_t | byte2, | |||
| twi_iaddr_t | byte3, | |||
| const void * | _buf, | |||
| size_t | size | |||
| ) |
Send size bytes over the twi line to slave id.
If the device requires internal addressing before writing, byte1 byte2 and byte3 can be specified. Internal addressign bytes not used *must* be set to TWI_NO_IADDR. If 1 or 2 bytes are required for internal addressing you *must* first use byte1 and than byte2.
- Note:
- Atmel TWI implementation is broken so it was not possible to supply a better interface. Additionally NACK handling is also broken, so if the i2c device reply nack this function will return after TWI_TIMEOUT.
- Returns:
- true if ok, false on slave timeout.
Definition at line 66 of file twi_at91.c.
