Sha256: dcbcc91c670d64d2936a6f4a5cc851fcae38565b876d6437a624b0d8c2947e4c

Contents?: true

Size: 1.58 KB

Versions: 47

Compression:

Stored size: 1.58 KB

Contents

/*
  twi.h - TWI/I2C library for Wiring & Arduino
  Copyright (c) 2006 Nicholas Zambetti.  All right reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#ifndef twi_h
#define twi_h

  #include <inttypes.h>

  //#define ATMEGA8

  #ifndef CPU_FREQ
  #define CPU_FREQ 16000000L
  #endif

  #ifndef TWI_FREQ
  #define TWI_FREQ 100000L
  #endif

  #ifndef TWI_BUFFER_LENGTH
  #define TWI_BUFFER_LENGTH 32
  #endif

  #define TWI_READY 0
  #define TWI_MRX   1
  #define TWI_MTX   2
  #define TWI_SRX   3
  #define TWI_STX   4
  
  void twi_init(void);
  void twi_setAddress(uint8_t);
  uint8_t twi_readFrom(uint8_t, uint8_t*, uint8_t);
  uint8_t twi_writeTo(uint8_t, uint8_t*, uint8_t, uint8_t);
  uint8_t twi_transmit(uint8_t*, uint8_t);
  void twi_attachSlaveRxEvent( void (*)(uint8_t*, int) );
  void twi_attachSlaveTxEvent( void (*)(void) );
  void twi_reply(uint8_t);
  void twi_stop(void);
  void twi_releaseBus(void);

#endif

Version data entries

47 entries across 24 versions & 4 rubygems

Version Path
neo_rad-0.4.0 lib/libraries/Wire/utility/twi.h
neo_rad-0.4.0 lib/libraries/Wire/twi.h
atduskgreg-rad-0.2.5 lib/libraries/Wire/utility/twi.h
atduskgreg-rad-0.2.5 lib/libraries/Wire/twi.h
atduskgreg-rad-0.3.0.1 lib/libraries/Wire/utility/twi.h
atduskgreg-rad-0.3.0.1 lib/libraries/Wire/twi.h
atduskgreg-rad-0.3.1 lib/libraries/Wire/utility/twi.h
atduskgreg-rad-0.3.1 lib/libraries/Wire/twi.h
madrona-rad-0.2.5 lib/libraries/Wire/twi.h
madrona-rad-0.2.6 lib/libraries/Wire/utility/twi.h
madrona-rad-0.2.6 lib/libraries/Wire/twi.h
madrona-rad-0.2.7 lib/libraries/Wire/utility/twi.h
madrona-rad-0.2.7 lib/libraries/Wire/twi.h
madrona-rad-0.3.1.1 lib/libraries/Wire/utility/twi.h
madrona-rad-0.3.1.1 lib/libraries/Wire/twi.h
madrona-rad-0.3.1 lib/libraries/Wire/utility/twi.h
madrona-rad-0.3.1 lib/libraries/Wire/twi.h
madrona-rad-0.3.2 lib/libraries/Wire/twi.h
madrona-rad-0.3.2 lib/libraries/Wire/utility/twi.h
madrona-rad-0.3.3 lib/libraries/Wire/utility/twi.h