@@ -92,6 +92,18 @@ void TwoWire::begin(void)
92
92
_config.eInterfaceMode = AM_HAL_IOM_I2C_MODE;
93
93
_config.ui32ClockFreq = _clockSpeed;
94
94
95
+ // Setup defaults that do not change
96
+ iomTransfer.ui32InstrLen = 0 ; // Use only data phase
97
+ iomTransfer.ui32Instr = 0 ; //
98
+ // iomTransfer.ui32NumBytes = ; //
99
+ iomTransfer.eDirection = AM_HAL_IOM_TX;
100
+ iomTransfer.pui32TxBuffer = (uint32_t *)_linearBugger;
101
+ iomTransfer.pui32RxBuffer = NULL ;
102
+ iomTransfer.ui8RepeatCount = 0 ; // ?
103
+ iomTransfer.ui8Priority = 1 ; // ?
104
+ iomTransfer.ui32PauseCondition = 0 ; // ?
105
+ iomTransfer.ui32StatusSetClr = 0 ; // ?
106
+
95
107
initialize (); // Initialize the IOM
96
108
}
97
109
@@ -190,19 +202,8 @@ uint8_t TwoWire::endTransmission(bool stopBit)
190
202
{
191
203
_transmissionBegun = false ;
192
204
193
- am_hal_iom_transfer_t iomTransfer = {0 };
194
205
iomTransfer.uPeerInfo .ui32I2CDevAddr = _transmissionAddress;
195
- iomTransfer.ui32InstrLen = 0 ; // Use only data phase
196
- iomTransfer.ui32Instr = 0 ; //
197
- // iomTransfer.ui32NumBytes = ; //
198
- iomTransfer.eDirection = AM_HAL_IOM_TX;
199
- iomTransfer.pui32TxBuffer = (uint32_t *)_linearBugger;
200
- iomTransfer.pui32RxBuffer = NULL ;
201
206
iomTransfer.bContinue = (stopBit ? false : true ); // whether or not to hold onto the bus after this transfer
202
- iomTransfer.ui8RepeatCount = 0 ; // ?
203
- iomTransfer.ui8Priority = 1 ; // ?
204
- iomTransfer.ui32PauseCondition = 0 ; // ?
205
- iomTransfer.ui32StatusSetClr = 0 ; // ?
206
207
207
208
// Copy the bytes from the TX Buffer into the linear buffer
208
209
size_t count = 0 ;
0 commit comments