File tree Expand file tree Collapse file tree 2 files changed +19
-15
lines changed
libraries/Wire/src/utility Expand file tree Collapse file tree 2 files changed +19
-15
lines changed Original file line number Diff line number Diff line change 4040#include " pins_arduino.h"
4141#include " twi.h"
4242
43+ #ifndef TWI_FREQ
44+ #define TWI_FREQ 100000L
45+ #endif
46+
47+ #ifndef TWI_BUFFER_LENGTH
48+ #define TWI_BUFFER_LENGTH 32
49+ #endif
50+
51+ enum TWI_STATE {
52+ TWI_READY = 0 ,
53+ TWI_MRX = 1 ,
54+ TWI_MTX = 2 ,
55+ TWI_SRX = 3 ,
56+ TWI_STX = 4 ,
57+ };
58+
4359static volatile uint8_t twi_state;
4460static volatile uint8_t twi_slarw;
4561static volatile uint8_t twi_sendStop; // should the transaction end with a stop
Original file line number Diff line number Diff line change 1919 Modified 2020 by Greyson Christoforo (grey@christoforo.net) to implement timeouts
2020*/
2121
22+ #pragma once
23+
2224#ifndef twi_h
2325#define twi_h
2426
2527 #include <inttypes.h>
2628
2729 //#define ATMEGA8
2830
29- #ifndef TWI_FREQ
30- #define TWI_FREQ 100000L
31- #endif
32-
33- #ifndef TWI_BUFFER_LENGTH
34- #define TWI_BUFFER_LENGTH 32
35- #endif
36-
37- #define TWI_READY 0
38- #define TWI_MRX 1
39- #define TWI_MTX 2
40- #define TWI_SRX 3
41- #define TWI_STX 4
42-
4331 void twi_init (void );
4432 void twi_disable (void );
4533 void twi_setAddress (uint8_t );
5644 void twi_handleTimeout (bool );
5745 bool twi_manageTimeoutFlag (bool );
5846
59- #endif
47+ #endif // #ifndef twi_h
You can’t perform that action at this time.
0 commit comments