|
ArduboyI2C Library
|
An I2C library for Arduboy multiplayer games. More...
#include <avr/interrupt.h>#include <avr/power.h>#include <util/twi.h>#include <util/delay.h>#include <stdlib.h>#include <stdint.h>#include <stddef.h>#include <string.h>Go to the source code of this file.
Classes | |
| class | I2C |
Macros | |
| #define | I2C_FREQUENCY 100000 |
| The initial I2C frequency in Hz. | |
| #define | I2C_BUFFER_CAPACITY 32 |
| The capacity of the buffer used for writes/target (slave) operations. | |
| #define | I2C_HANDSHAKE_BUSY_CHECKS 128 |
| Number of times to check for a busy bus during a handshake. | |
| #define | I2C_CHECK_CABLE_FLIPPED_CHECKS 128 |
| The total number of checks to perform when checking for a flipped cable. | |
| #define | I2C_CHECK_CABLE_FLIPPED_DEBOUNCE_CHECKS 128 |
| The number of consecutive cable flip checks that pass before confirming the cable has been flipped back. | |
| #define | I2C_SDA_BIT PIND1 |
| The bit of the pin on which the SDA line is connected. | |
| #define | I2C_SCL_BIT PIND0 |
| The bit of the pin on which the SCL line is connected. | |
| #define | I2C_PIN PIND |
| The pin on which the SDA and SCL lines are connected. | |
| #define | I2C_PORT PORTD |
| The port on which the SDA and SCL lines are connected. | |
| #define | I2C_DDR DDRD |
| The data direction register for the SDA and SCL lines. | |
| #define | I2C_VERSION_MAJOR 3 |
| I2C library major version. | |
| #define | I2C_VERSION_MINOR 0 |
| I2C library minor version. | |
| #define | I2C_VERSION_PATCH 0 |
| I2C library patch version. | |
| #define | I2C_VERSION (I2C_VERSION_MAJOR * 10000 + I2C_VERSION_MINOR * 100 + I2C_VERSION_PATCH) |
| I2C library version. | |
An I2C library for Arduboy multiplayer games.
| #define I2C_FREQUENCY 100000 |
| #define I2C_BUFFER_CAPACITY 32 |
The capacity of the buffer used for writes/target (slave) operations.
Defaults to 32. If more than 32 bytes are needed for writes/target (slave) operations, increase. If more RAM is needed, decrease. Maximum is 255.
| #define I2C_HANDSHAKE_BUSY_CHECKS 128 |
Number of times to check for a busy bus during a handshake.
Defaults to 128, with a maximum of 65535. Increase for a more accurate detection at the cost of a longer detection time, especially when a custom loop function is provided to the handshake function.
| #define I2C_CHECK_CABLE_FLIPPED_CHECKS 128 |
The total number of checks to perform when checking for a flipped cable.
Defaults to 128, with a maximum of 65535. Increase for a more accurate detection at the cost of a longer detection time.
| #define I2C_CHECK_CABLE_FLIPPED_DEBOUNCE_CHECKS 128 |
The number of consecutive cable flip checks that pass before confirming the cable has been flipped back.
Defaults to 128, with a maximum of 65535. Increase for more accurate debouncing at the cost of a longer detection time.
| #define I2C_SDA_BIT PIND1 |
The bit of the pin on which the SDA line is connected.
Defaults to PIND1.
| #define I2C_SCL_BIT PIND0 |
The bit of the pin on which the SCL line is connected.
Defaults to PIND0.
| #define I2C_PIN PIND |
The pin on which the SDA and SCL lines are connected.
Defaults to PIND.
| #define I2C_PORT PORTD |
The port on which the SDA and SCL lines are connected.
Defaults to PORTD.
| #define I2C_DDR DDRD |
The data direction register for the SDA and SCL lines.
Defaults to DDRD.
| #define I2C_VERSION (I2C_VERSION_MAJOR * 10000 + I2C_VERSION_MINOR * 100 + I2C_VERSION_PATCH) |
I2C library version.
For a given version x.y.z, the library version will be in the form x * 10000 + y * 100 + z.