The PIO Parallel Capture Mode driver provides the interface to configure and use the PIO Parallel Capture Mode peripheral.
The PIO Controller integrates an interface able to read data from a CMOS digital image sensor, a high-speed parallel ADC, a DSP synchronous port in synchronous mode, etc.... For better understanding and to ease reading, the following description uses an example with a CMOS digital image sensor
To use the PIO Parallel Capture, the user has to follow these few steps:
-
Enable PIOA peripheral clock
-
Configure the PDC
-
Configure the PIO Capture interrupt
-
Enable the PDC
-
Enable the PIO Capture
-
Wait for interrupt
-
Disable the interrupt
-
Read the DATA
For more accurate information, please look at the PIO Parallel Capture Mode section of the Datasheet.
API Usage:
- Configurate the interrupt for PIOA, can be done by PIO_InitializeInterrupts()
- Initialize the PIO Parallel Capture API by filing the SpioCaptureInit structure options:
- alwaysSampling: for sample data with or without take in account ENABLE pins.
- halfSampling: for sample all data or only one time out of two
- Call PIO_CaptureInit() for init and enable the PDC, init the PIO capture.
- Call PIO_CaptureEnable() for enable the PIO Parallel Capture.
- When an interrupt is received, the PIO_CaptureHandler() is call and the respective callback is launch.
- When the transfer is complete, the user need to disable interrupt with PIO_CaptureDisableIt(). Otherwise, the PDC will send an interrupt.
- The data receive by the PIO Parallel Capture is inside the buffer passed in the PIO_CaptureInit().
Related files :
pio_capture.c
pio_capture.h