Kaleidoscope
|
#include <math.h>
#include <stdlib.h>
#include <inttypes.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <compat/twi.h>
#include "pins_arduino.h"
#include "twi.h"
Macros | |
#define | ENABLE_TWI_SLAVE_MODE 0 |
#define | true 1 |
#define | false 0 |
#define | cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#define | sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit)) |
Functions | |
void | twi_init (void) |
void | twi_disable (void) |
void | twi_setAddress (uint8_t address) |
void | twi_setFrequency (uint32_t frequency) |
uint8_t | twi_readFrom (uint8_t address, uint8_t *data, uint8_t length, uint8_t sendStop) |
uint8_t | twi_writeTo (uint8_t address, uint8_t *data, uint8_t length, uint8_t wait, uint8_t sendStop) |
uint8_t | twi_transmit (const uint8_t *data, uint8_t length) |
void | twi_attachSlaveRxEvent (void(*function)(uint8_t *, int)) |
void | twi_attachSlaveTxEvent (void(*function)(void)) |
void | twi_reply (uint8_t ack) |
void | twi_stop (void) |
void | twi_releaseBus (void) |
ISR (TWI_vect) | |
#define cbi | ( | sfr, | |
bit | |||
) | (_SFR_BYTE(sfr) &= ~_BV(bit)) |
#define ENABLE_TWI_SLAVE_MODE 0 |
#define false 0 |
#define sbi | ( | sfr, | |
bit | |||
) | (_SFR_BYTE(sfr) |= _BV(bit)) |
#define true 1 |
ISR | ( | TWI_vect | ) |
void twi_attachSlaveRxEvent | ( | void(*)(uint8_t *, int) | function | ) |
void twi_attachSlaveTxEvent | ( | void(*)(void) | function | ) |
void twi_disable | ( | void | ) |
void twi_init | ( | void | ) |
uint8_t twi_readFrom | ( | uint8_t | address, |
uint8_t * | data, | ||
uint8_t | length, | ||
uint8_t | sendStop | ||
) |
void twi_releaseBus | ( | void | ) |
void twi_reply | ( | uint8_t | ack | ) |
void twi_setAddress | ( | uint8_t | address | ) |
void twi_setFrequency | ( | uint32_t | frequency | ) |
void twi_stop | ( | void | ) |
uint8_t twi_transmit | ( | const uint8_t * | data, |
uint8_t | length | ||
) |
uint8_t twi_writeTo | ( | uint8_t | address, |
uint8_t * | data, | ||
uint8_t | length, | ||
uint8_t | wait, | ||
uint8_t | sendStop | ||
) |