Project

General

Profile

Revision 502da1a1

ID502da1a19fc733cc22070c181d2028eeb920badb
Parent 3bd564a7
Child f414f222

Added by Aaron Perley about 10 years ago

Sync i2c testing file

View differences:

scout_avr/bom/test.c
1
#include <stdint.h>
2
#include <avr/io.h>
3
#include <avr/interrupt.h>
4
#include <util/delay.h>
5
#include "tiny-twi-sync.h"
6

  
7

  
8
static void slave_rx(uint8_t *buf, int len) {
9
  if (len >= 3) {
10
    switch (buf[0]) {
11
      case BOM_I2C_SEND:
12
        smb_send_data(buf, len);
13
    }
14
  }
15
}
16

  
17
int main(void) {
18
    smb_init(slave_rx);
19
    smb_set_address(3);
20
    twi_run();
21
}

Also available in: Unified diff