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 40
40
#include " pins_arduino.h"
41
41
#include " twi.h"
42
42
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
+
43
59
static volatile uint8_t twi_state;
44
60
static volatile uint8_t twi_slarw;
45
61
static volatile uint8_t twi_sendStop; // should the transaction end with a stop
Original file line number Diff line number Diff line change 19
19
Modified 2020 by Greyson Christoforo ([email protected] ) to implement timeouts
20
20
*/
21
21
22
+ #pragma once
23
+
22
24
#ifndef twi_h
23
25
#define twi_h
24
26
25
27
#include <inttypes.h>
26
28
27
29
//#define ATMEGA8
28
30
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
-
43
31
void twi_init (void );
44
32
void twi_disable (void );
45
33
void twi_setAddress (uint8_t );
56
44
void twi_handleTimeout (bool );
57
45
bool twi_manageTimeoutFlag (bool );
58
46
59
- #endif
47
+ #endif // #ifndef twi_h
You can’t perform that action at this time.
0 commit comments