#include "twi_drv.h"
Go to the source code of this file.
Data Structures | |
struct | TWI_message |
Defines | |
#define | TWI_NB_SLAVE_DATA 100 |
#define | TWI_MASTER |
#define | TWI_SLAVE |
#define | TWI_OK 0 |
This constant is used as return value for the functions to. | |
#define | TWI_BUS_ERROR 1 |
#define | TWI_HOST_ADR_NACK 2 |
#define | TWI_HOST_DATA_NACK 3 |
#define | TWI_ARBITRATION_LOST 4 |
#define | TWI_UNKNOWN 5 |
#define | TWI_NOT_FREE 6 |
#define | TWI_READ 1 |
This constant is used as parameter value for the functions twi_send_message_xxx to select read operation. | |
#define | TWI_WRITE 0 |
This constant is used as parameter value for the functions twi_send_message_xxx to select write operation. | |
#define | TWI_CONFIG MSK_TWCR_TWEN |
Typedefs | |
typedef unsigned char | Length_TWI_frame |
Functions | |
unsigned char | twi_send_message_polling (unsigned char slave_addr, bit rw, Length_TWI_frame nbytes, Uchar *info) |
This function sends TWI message to a slave. This transmition is managed in polling fashion. | |
unsigned char | twi_send_message_interrupt (unsigned char slave_addr, bit rw, Length_TWI_frame nbytes, Uchar *info) |
This function sends TWI message to a slave. This transmition is managed in interruption fashion. | |
unsigned char | twi_slave_polling (void) |
This function can be called to be able to answer another master request in polling fashion. | |
void | twi_slave_interrupt (void) |
This function can be called to be able to answer another master request in interruption fashion. | |
void | twi_lib_init (void) |
This function allows to init the TWI controller. | |
Byte | twi_putchar (Byte addr, Byte b) |
This function can be used to send an byte to a slave in polling fashion. | |
Uint16 | twi_getchar (Byte addr) |
* This function can be used to receive an byte from a slave in polling fashion. | |
Variables | |
volatile TWI_message xdata | twi_message |
volatile bit | twi_busy |
volatile unsigned char | twi_err |
volatile unsigned char xdata | twi_slave_data [100] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This constant is used as return value for the functions to.
|
|
This constant is used as parameter value for the functions twi_send_message_xxx to select read operation.
|
|
|
|
|
|
This constant is used as parameter value for the functions twi_send_message_xxx to select write operation.
|
|
|
|
* This function can be used to receive an byte from a slave in polling fashion.
|
|
This function allows to init the TWI controller.
|
|
This function can be used to send an byte to a slave in polling fashion.
|
|
This function sends TWI message to a slave.
|
|
This function sends TWI message to a slave.
|
|
This function can be called to be able to answer another master request in interruption fashion.
|
|
This function can be called to be able to answer another master request in polling fashion.
|
|
|
|
|
|
|
|
|