@@ -65,9 +65,6 @@ typedef enum TWI_MODE_enum {
65
65
TWI_MODE_SLAVE_RECEIVE = 6
66
66
} TWI_MODE_t ;
67
67
68
- /*! Buffer size define */
69
- #define TWI_BUFFER_SIZE 128
70
-
71
68
/*! For adding R/_W bit to address */
72
69
#define ADD_READ_BIT (address ) (address | 0x01)
73
70
#define ADD_WRITE_BIT (address ) (address & ~0x01)
@@ -86,11 +83,12 @@ register8_t master_result; /*!< Result of transactio
86
83
87
84
/* Slave variables */
88
85
static void (* TWI_onSlaveTransmit )(void ) __attribute__((unused ));
89
- static void (* TWI_onSlaveReceive )(volatile uint8_t * , int ) __attribute__((unused ));
86
+ static void (* TWI_onSlaveReceive )(int ) __attribute__((unused ));
90
87
register8_t * slave_writeData ;
91
- register8_t slave_readData [ TWI_BUFFER_SIZE ] ;
88
+ register8_t * slave_readData ;
92
89
register8_t slave_bytesToWrite ;
93
90
register8_t slave_bytesWritten ;
91
+ register8_t slave_bytesToRead ;
94
92
register8_t slave_bytesRead ;
95
93
register8_t slave_trans_status ;
96
94
register8_t slave_result ;
@@ -136,7 +134,7 @@ void TWI_SlaveStopHandler(void);
136
134
void TWI_SlaveDataHandler (void );
137
135
void TWI_SlaveWriteHandler (void );
138
136
void TWI_SlaveReadHandler (void );
139
- void TWI_attachSlaveRxEvent ( void (* function )(volatile uint8_t * , int ) );
137
+ void TWI_attachSlaveRxEvent ( void (* function )(int ), uint8_t * read_data , uint8_t bytes_to_read );
140
138
void TWI_attachSlaveTxEvent ( void (* function )(void ) );
141
139
void TWI_SlaveTransactionFinished (uint8_t result );
142
140
/*! TWI master interrupt service routine.
0 commit comments