Hello NXP Community,
I am attempting to configure my LPC54102 such that from within the PIN_INT0_IRQHandler() an I2C read from a downstream slave device will be done via DMA. I would like to know if there's an example that can outline such setup/configuration?
Alternatively, if an exact example for the above scenario is not available, I read from the LPC5410x Ref Manual regarding using DMA with I2C Master as follows:
23.7.6.1 DMA as a Master transmitter
A basic sequence for a Master transmitter:
• Software sets up DMA to transmit a message.
• Software causes a slave address with write command to be sent and checks that the
address was acknowledged.
• Software turns on DMA mode in the I 2C.
• DMA transfers data and eventually completes the transfer.
• Software causes a stop (or repeated start) to be sent.
However, I don't see any code snippet showing the above. Can anyone please point me to such sample code?
Much appreciated, thank you!
Ken
You're correct.
In MCUXpresso SDK for LPC54102, the following examples demonstrate partial functionality you need:
1. i2c_dma_b2b_transfer_slave
This shows how to:
Configure the I2C master for DMA-based receive.
But this does not include GPIO interrupts.
2. pint_pin_interrupt
This shows:
How to set up a GPIO pin interrupt using the General Purpose Interrupt.
You can combine these two examples to achieve your functionality.
BR
Harry
Sorry I referenced the wrong section of UM...
This is the one I intended to include:
23.7.6.2 DMA as a Master receiver
A basic sequence for a Master receiver:
• Software sets up DMA to receive a message.
• Software causes a slave address with read command to be sent and checks that the
address was acknowledged.
• Software starts DMA.
• DMA completes.
• Software causes a stop or repeated start to be sent.