• Stars
    star
    137
  • Rank 266,121 (Top 6 %)
  • Language
    C++
  • License
    GNU Lesser Genera...
  • Created over 11 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Software I2C implementation for Arduino and other Wiring-type environments

SoftWire

Introduction

SoftWire is a software I2C implementation for Arduino and other Wiring-type environments. It utilises the pinMode(), digitalWrite() and digitalRead() functions. The pins to be used for the serial data (SDA) and serial clock (SCL) control lines can be defined at run-time. Alternatively it is possible to override the functions which control the SDA and SCL lines, and read SDA and SCL, thereby allowing direct port manipulation to be used if preferred.

Multiple objects (for multiple software I2C buses) and clock-stretching by slave devices are supported. A timeout feature is included to prevent lockups by faulty or missing hardware. The microcontroller must function as the master device and multiple masters are not supported.

Low-level functions can be used to send start, and stop signals, and to read and write data; no buffers are required. In addition high-level functions provide almost direct compatibility with the Wire library. However, the user must first declare transmit and receive buffers, and configure SoftWire to use them before the high-level functions beginTransmission(), endTransmission(), read(), write() and requestFrom () can be used. Notify SoftWire of the buffers by calling the setTxBuffer() and setRxBuffer() functions, passing in a pointer to a byte or character buffer and the size of the buffer. See the ReadDS1307 fort an exmaple of how this is done.

It is possible to assign (and reassign) the pins associated with SCL and SDA at run-time using the functions setScl() and setSda().

Important changes for users of the v1.* library

To support the high-level functions required for compatibility with the Wire library the original low-level write() function has been renamed llWrite().

The setter functions setSdaLow(), setSdaHigh(), setSclLow(), setSclHigh(), setReadSda(), setReadScl() must be used to override the functions which control and read the SDA and SCL signals.

The functions which actually set SCL/SDA low/high are now named sclLow(), sdaLow(), sclHigh() and sdaHigh(). These functions should not be called directly in normal use but may be required to force some devices into low-power mode.

License

The SoftWire library is licensed with the GNU Lesser General Public License. See LICENSE.txt for details.

Requirements

The AsyncDelay library is required, see https://github.com/stevemarple/AsyncDelay

Contributors

Credits

This library is inspired by Peter Fleury's i2cmaster library.

More Repositories

1

MicroNMEA

A compact Arduino library to parse NMEA sentences.
C++
98
star
2

IniFile

Arduino library to parse ini files.
C++
87
star
3

AsyncDelay

A simple abstraction for implementing delays and timeouts in Arduino sketches.
Python
64
star
4

Calunium

Arduino clone based on the ATmega644P/ATmega1284P
C++
34
star
5

MCP342x

Arduino library to support Microchip ADC342x analogue to digital converters
C++
22
star
6

python-MCP342x

Access Microchip MCP342x analogue to digital converters from python
Python
13
star
7

RTCx

Arduino library to support DS1307 and similar I2C real-time clocks. The library can autoprobe to find the actual hardware based on I2C address and registers.
C++
13
star
8

AuroraWatchNet

Building a network of magnetometers for auroral alerts and citizen science.
C++
12
star
9

AS3935

Arduino library to support Austrian Microsystems AS3935 lightning sensor.
C++
9
star
10

RPi_RFM12B_ISP

RFM12B and Atmel ISP programmer shield for Raspberry Pi
C
7
star
11

RF12_Stream

Transparent serial link emulation using HopeRF RFM12B transceiver modules
Arduino
7
star
12

SteveMarple-Eagle-Library

Library for Cadsoft Eagle
6
star
13

MultiReadCircBuffer

Arduino library implementing a circular buffer with multiple readers
C++
5
star
14

MLX90614

Arduino library to support MLX90614 infrared thermometer
C++
4
star
15

WwwServer

A WWW server for Arduino
C++
4
star
16

HIH61xx

Arduino library to read Honeywell HIH61xx humidity sensors
C++
3
star
17

FLC100_shield

Shield for FLC100 fluxgate magnetometer
C++
3
star
18

FTDI_AIO

FTDI all-in-one, a USB-UART adaptor, AVR ISP, breakout board and USB switch and LED.
TeX
2
star
19

ntplib

Automatically exported from code.google.com/p/ntplib
Python
2
star
20

GNSS_Clock

Arduino clock implementation using GNSS (GPS/GLONASS/Galileo) NMEA messages and PPS
C++
2
star
21

python-aurorawatchuk

Python interface to the AuroraWatch UK API
Python
1
star
22

cameralogger

Record and decorate camera images for timelapses etc
Python
1
star
23

arduino-CommandHandler

An Arduino library to parse commands from a serial stream.
C++
1
star
24

AuroraWatchApp

Android app for AuroraWatch UK
Java
1
star
25

Calunium-software

Software for the Arduino Calunium clone
Makefile
1
star
26

RPi_ADC_hat

Raspberry Pi HAT with MCP3424 ADC, 1-wire and I2C interfaces, and 2 auxiliary switched outputs
Stata
1
star
27

RPiWirelessGateway

Raspberry Pi wireless gateway
1
star
28

NV08C_GPS_shield

Arduino shield supporting the NV08C-CSM GNSS (GPS/GLONASS/Galileo) receiver module
Eagle
1
star
29

RF12

Library for RFM12B, based on Jeelabs library but adapted for ATmega1284P and Calunium.
1
star
30

CircularStack

A circular stack implementation for Arduino.
C++
1
star
31

CounterRTC

Arduino library to implement a real-time clock using the asynchronous timer. Either a crystal or an external clock signal can be used.
C++
1
star