All Projects → JChristensen → Tinyspi

JChristensen / Tinyspi

Licence: gpl-3.0
Arduino hardware SPI library for ATtiny44/84, 45/85, 461/861, 2313/4313.

Projects that are alternatives of or similar to Tinyspi

Ssd1306
Driver for SSD1306, SSD1331, SSD1351, IL9163, ILI9341, ST7735, PCD8544, Nokia 5110 displays running on Arduino/ESP32/Linux (Rasperry) platforms
Stars: ✭ 303 (+126.12%)
Mutual labels:  arduino, spi, arduino-library
Beelan Lorawan
A LoRaWAN library for compatible arduino board
Stars: ✭ 87 (-35.07%)
Mutual labels:  arduino, arduino-library
Brasilino
Uma biblioteca que permite programar em linguagem Arduino utilizando comandos facilitados em PT-BR. 🇧🇷
Stars: ✭ 131 (-2.24%)
Mutual labels:  arduino, arduino-library
Button2
Arduino Library to simplify working with buttons. It allows you to use callback functions to track single, double, triple and long clicks. It also takes care of debouncing.
Stars: ✭ 109 (-18.66%)
Mutual labels:  arduino, arduino-library
Fpm
Arduino library for the R30x/ZFMxx/FPMxx optical fingerprint sensors
Stars: ✭ 79 (-41.04%)
Mutual labels:  arduino, arduino-library
Can library
Multiplatform Arduino library for supporting the native CAN controller on Due (SAM3X) and Teensy 3.1 (K2X) as well as MCP2515 through SPI
Stars: ✭ 81 (-39.55%)
Mutual labels:  arduino, spi
Esp8266 Oled Ssd1306
Driver for the SSD1306 and SH1106 based 128x64, 128x32, 64x48 pixel OLED display running on ESP8266/ESP32
Stars: ✭ 1,590 (+1086.57%)
Mutual labels:  arduino, spi
Ramp
Arduino Interpolation Library
Stars: ✭ 72 (-46.27%)
Mutual labels:  arduino, arduino-library
Mpu6050 tockn
Arduino library for easy communication with MPU6050
Stars: ✭ 119 (-11.19%)
Mutual labels:  arduino, arduino-library
Lora Serialization
LoraWAN serialization/deserialization library for The Things Network
Stars: ✭ 120 (-10.45%)
Mutual labels:  arduino, arduino-library
Arduinoxinput
XInput library for USB capable Arduino boards
Stars: ✭ 126 (-5.97%)
Mutual labels:  arduino, arduino-library
Tft espi
Arduino and PlatformIO IDE compatible TFT library optimised for the STM32, ESP8266 and ESP32 that supports different driver chips
Stars: ✭ 1,215 (+806.72%)
Mutual labels:  arduino, arduino-library
Ultrasonic
Minimalist library for Ultrasonic Module HC-SR04, PING))) and Seeed SEN136B5B to Arduino
Stars: ✭ 77 (-42.54%)
Mutual labels:  arduino, arduino-library
Arduino Plotter
An Arduino library for easy graphing on host computer via serial communication
Stars: ✭ 129 (-3.73%)
Mutual labels:  arduino, arduino-library
Aunit
Unit testing framework for Arduino platforms inspired by ArduinoUnit and Google Test. Used with AUniter or EpoxyDuino for continuous builds.
Stars: ✭ 73 (-45.52%)
Mutual labels:  arduino, arduino-library
Noodle Synth
A User-friendly Arduino/Teensy/ESP8266 Library to play MIDI files with infinite polyphonic notes with full control over volume, pitch, and . . . music. No shields needed(Just a speaker).
Stars: ✭ 99 (-26.12%)
Mutual labels:  arduino, arduino-library
Adafruit ina219
INA219 Current Sensor
Stars: ✭ 129 (-3.73%)
Mutual labels:  arduino, arduino-library
Nintendoextensionctrl
Arduino library for communicating with Nintendo extension controllers
Stars: ✭ 67 (-50%)
Mutual labels:  arduino, arduino-library
Liquidcrystal pcf8574
A library for driving LiquidCrystal displays (LCD) by using the I2C bus and an PCF8574 I2C adapter.
Stars: ✭ 67 (-50%)
Mutual labels:  arduino, arduino-library
Simpledht
Simple, Stable and Fast Arduino Temp & Humidity Sensors for DHT11 and DHT22. http://learn.adafruit.com/dht
Stars: ✭ 111 (-17.16%)
Mutual labels:  arduino, arduino-library

Arduino tinySPI Library

http://github.com/JChristensen/tinySPI
README file
Jack Christensen
Oct 2013

License

Arduino tinySPI Library Copyright (C) 2018 Jack Christensen GNU GPL v3.0

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 as published by the Free Software Foundation.

This program 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 General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/gpl.html

Description

tinySPI is an Arduino SPI master library for ATtiny microcontrollers that utilizes the USI hardware in the ATtiny MCUs. Supported MCUs include ATtiny24/44/84, 25/45/85, 261/461/861, 2313/4313.

Because the USI hardware is not as sophisticated as the dedicated SPI hardware in the ATmega MCUs, tinySPI is more limited than the standard Arduino SPI library but still has several advantages over software bit-bang approaches.

As compared to the Arduino shiftOut() function, tinySPI

  • is about 15 times faster,
  • has a smaller program memory footprint, and
  • has a consistent bit clock period.

tinySPI does not support

  • sending the least-significant bit first,
  • SPI data modes 2 and 3, or
  • user-selectable SPI clock frequencies.

tinySPI will generate an SPI bit clock that is about one-tenth the MCU system clock frequency. For example, given a 1MHz system clock, the SPI clock will be about 100kHz, and it will take about 80μs to transfer one byte.

Interrupts are inhibited during each byte transfer to ensure a consistent bit clock period.

Included with the library are example sketches that demonstrate driving a 74HC595 shift register from an ATtiny84 and from an ATtiny85.

tinySPI has been tested with Arduino 1.8.5 and the ATTiny Core.

Methods

  • begin()
  • end()
  • setDataMode()
  • transfer()

begin()

Description

Initializes the SPI bus, sets the USCK and DO pins to outputs, sets the DI pin to input.

Syntax

SPI.begin();

Parameters

None.

Returns

None.

end()

Description

Disables the SPI bus (leaving the pin modes unchanged).

Syntax

SPI.end();

Parameters

None.

Returns

None.

setDataMode()

Description

Sets the SPI data mode, i.e. clock polarity and phase. See the Wikipedia article on SPI for details.

Syntax

SPI.setDataMode(mode)

Parameters

mode: SPI_MODE0 or SPI_MODE1 (modes 2 and 3 are not supported)

Returns

None.

transfer()

Description

Transfers one byte over the SPI bus, both sending and receiving. Interrupts are inhibited during each byte transfer to ensure a consistent bit clock period.

Syntax

SPI.transfer(val);

Parameters

val: the byte to send over the bus (byte)

Returns

the byte read from the bus (byte)

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].