@@ -92,6 +92,18 @@ void TwoWire::begin(void)
9292 _config.eInterfaceMode = AM_HAL_IOM_I2C_MODE;
9393 _config.ui32ClockFreq = _clockSpeed;
9494
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+
95107 initialize (); // Initialize the IOM
96108}
97109
@@ -190,19 +202,8 @@ uint8_t TwoWire::endTransmission(bool stopBit)
190202{
191203 _transmissionBegun = false ;
192204
193- am_hal_iom_transfer_t iomTransfer = {0 };
194205 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 ;
201206 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 ; // ?
206207
207208 // Copy the bytes from the TX Buffer into the linear buffer
208209 size_t count = 0 ;
0 commit comments