File tree 2 files changed +11
-12
lines changed
libraries/Wire/src/utility
2 files changed +11
-12
lines changed Original file line number Diff line number Diff line change 41
41
#include " pins_arduino.h"
42
42
#include " twi.h"
43
43
44
- static volatile uint8_t twi_state;
44
+ constexpr uint32_t TWI_FREQ = 100000L ;
45
+
46
+ enum TWI_STATE : uint8_t {
47
+ TWI_READY = 0 ,
48
+ TWI_MRX = 1 ,
49
+ TWI_MTX = 2 ,
50
+ TWI_SRX = 3 ,
51
+ TWI_STX = 4 ,
52
+ };
53
+
54
+ static volatile TWI_STATE twi_state;
45
55
static volatile uint8_t twi_slarw;
46
56
static volatile uint8_t twi_sendStop; // should the transaction end with a stop
47
57
static volatile uint8_t twi_inRepStart; // in the middle of a repeated start
Original file line number Diff line number Diff line change 27
27
#include <inttypes.h>
28
28
//#define ATMEGA8
29
29
30
- #ifndef TWI_FREQ
31
- #define TWI_FREQ 100000L
32
- #endif
33
-
34
- #define TWI_READY 0
35
- #define TWI_MRX 1
36
- #define TWI_MTX 2
37
- #define TWI_SRX 3
38
- #define TWI_STX 4
39
-
40
-
41
30
void twi_init (void );
42
31
void twi_disable (void );
43
32
void twi_setAddress (uint8_t );
You can’t perform that action at this time.
0 commit comments