twi_basics/twi_basics.h File Reference

#include <stdint.h>
#include <avr/io.h>

Go to the source code of this file.

Typedefs

typedef uint8_t twi_status

Functions

twi_status twi_start ()
twi_status twi_send (uint8_t data)
twi_status twi_receive (uint8_t *where, uint8_t ack)
void twi_stop ()

Detailed Description

Author:
Krzysztof Wesolowski
Date:
September 09, 2009

Definition in file twi_basics.h.


Typedef Documentation

typedef uint8_t twi_status

twi related functions exept twi_stop() return this status

Definition at line 16 of file twi_basics.h.


Function Documentation

twi_status twi_receive ( uint8_t *  where,
uint8_t  ack 
)

Receive one byte over TWI interface

Parameters:
where Pointer to location where received data we'll be stored
ack Set to nonzero to send ACK after receiving. Usually it continues transfer.
Returns:
Status of TWI after operation extracted from TWSR

Definition at line 54 of file twi_basics.c.

References TW_SEND_CMD, and wait().

Referenced by ds1338_readBufferFromNVRAM(), and ds1338_readByteFromNVRAM().

twi_status twi_send ( uint8_t  data  ) 

Sends one byte over TWI interface

Parameters:
data Data to be send
Returns:
Status of TWI after operation extracted from TWSR

Definition at line 40 of file twi_basics.c.

References TW_SEND_CMD, and wait().

Referenced by ds1338_writeBufferToNVRAM(), and ds1338_writeByteToNVRAM().

twi_status twi_start (  ) 

Sends start condition

Returns:
Status of TWI after operation extracted from TWSR

Definition at line 28 of file twi_basics.c.

References TW_SEND_CMD, and wait().

void twi_stop (  ) 

Sends STOP condition. Take a look at unusual busy-wait loop (Stop doesn't affect TWINT)

Definition at line 68 of file twi_basics.c.

References TW_SEND_CMD.

Referenced by ds1338_readBufferFromNVRAM(), ds1338_readByteFromNVRAM(), ds1338_writeBufferToNVRAM(), and ds1338_writeByteToNVRAM().


Generated on Wed Sep 9 20:37:11 2009 for DS1338Library by  doxygen 1.6.1