![]() |
Synergy Software Package User's Manual
|
Driver for the Parallel Data Capture Unit (PDC). More...
Data Structures | |
| struct | pdc_instance_ctrl_t |
Functions | |
| ssp_err_t | R_PDC_Open (pdc_ctrl_t *const p_api_ctrl, pdc_cfg_t const *const p_cfg) |
| Powers on PDC, handles required initialization described in the hardware manual. Implements pdc_api_t::open. More... | |
| ssp_err_t | R_PDC_Close (pdc_ctrl_t *const p_api_ctrl) |
| Stops and closes the transfer interface, disables the PDC, powers off the PDC, clears internal driver data and disables interrupts. Implements pdc_api_t::close. More... | |
| ssp_err_t | R_PDC_CaptureStart (pdc_ctrl_t *const p_api_ctrl, uint8_t *const p_buffer) |
| Starts a capture. Enables interrupts. Implements pdc_api_t::captureStart. More... | |
| ssp_err_t | R_PDC_StateGet (pdc_ctrl_t *const p_api_ctrl, pdc_state_t *p_state) |
| Returns the state of the VSYNC and HSYNC pins.Implements pdc_api_t::stateGet. More... | |
| ssp_err_t | R_PDC_VersionGet (ssp_version_t *const p_data) |
| Return PDC HAL driver version. Implements pdc_api_t::versionGet. More... | |
Driver for the Parallel Data Capture Unit (PDC).
extends PDC Interface The PDC interface allows the capturing of an image from a camera module.
| ssp_err_t R_PDC_CaptureStart | ( | pdc_ctrl_t *const | p_api_ctrl, |
| uint8_t *const | p_buffer | ||
| ) |
Starts a capture. Enables interrupts. Implements pdc_api_t::captureStart.
Sets up the transfer interface to transfer data from the PDC into the specified buffer. Configures the PDC settings as previously set by the pdc_api_t::open API. These settings are configured here as the PIXCLK input must be active for the PDC reset operation. When a capture is complete the callback registered during pdc_api_t::open API call will be called.
| SSP_SUCCESS | Capture start successful. |
| SSP_ERR_ASSERTION | One of the following parameters is incorrect. Either
|
| SSP_ERR_NOT_OPEN | Open has not been successfully called. |
| SSP_ERR_IN_USE | Pdc transfer is already in progress, wait for transfer to complete. |
| SSP_ERR_TIMEOUT | Reset operation timed out. |
The user is responsible to ensuring that the memory pointed to by p_buffer is both valid and large enough to store a complete image. The amount of space required, in bytes can be calculated as shown:
size (bytes) = image width (pixels) * image height (lines) * number of bytes per pixel
Set up transfer interface
Configure the transfer interface
Open transfer interface
Wait for reset to complete
Set horizontal capture range
Set horizontal capture size
Set vertical capture range
Set vertical capture size
Set VSYNC polarity
Set HSYNC polarity
Set endianess of capture data
Enable interrupts: Receive data ready interrupt, Underrun interrupt, Overrun interrupt, Frame end interrupt, Vertical line number setting error interrupt, Horizontal byte number setting error interrupt
| ssp_err_t R_PDC_Close | ( | pdc_ctrl_t *const | p_api_ctrl | ) |
Stops and closes the transfer interface, disables the PDC, powers off the PDC, clears internal driver data and disables interrupts. Implements pdc_api_t::close.
| SSP_SUCCESS | Successful close. |
| SSP_ERR_ASSERTION | One of the following parameters is incorrect. Either
|
| SSP_ERR_NOT_OPEN | Open has not been successfully called. |
Disable all interrupts.
Enable module stop mode for PDC
Unlock the PDC Hardware Resource
| ssp_err_t R_PDC_Open | ( | pdc_ctrl_t *const | p_api_ctrl, |
| pdc_cfg_t const *const | p_cfg | ||
| ) |
Powers on PDC, handles required initialization described in the hardware manual. Implements pdc_api_t::open.
The Open function provides initial configuration for the PDC module. It powers on the module and enables the PCLKO output and the PIXCLK input. Further initialization requires the PIXCLK input to be running in order to be able to reset the PDC as part of its initialization. This clock is input from a camera module and so the reset and further initialization is performed in pdc_api_t::captureStart. This function should be called once prior to calling any other PDC API functions. After the PDC is opened the Open function should not be called again without first calling the Close function.
| SSP_SUCCESS | Initialization was successful. |
| SSP_ERR_ASSERTION | One of the following parameters is incorrect. Either
|
| SSP_ERR_INVALID_ARGUMENT | One of the following configuration parameters is incorrect. Either
|
| SSP_ERR_HW_LOCKED | Unable to reserve BSP hardware lock for this module. |
Lock the PDC Hardware Resource
Disable module stop mode for PDC
Set PCLKB divider
Enable PCLKO output
Enable the PIXCLK input
Mark driver as open by initializing it to "PDC" in its ASCII equivalent
| ssp_err_t R_PDC_StateGet | ( | pdc_ctrl_t *const | p_api_ctrl, |
| pdc_state_t * | p_state | ||
| ) |
Returns the state of the VSYNC and HSYNC pins.Implements pdc_api_t::stateGet.
| SSP_SUCCESS | State read successful. |
| SSP_ERR_ASSERTION | p_api_ctrl is NULL OR p_state is NULL |
| SSP_ERR_NOT_OPEN | Open has not been successfully called. |
Check if the driver is open
Get the contents of PCMONR register
Update vsync signal state
Update hsync signal state
| ssp_err_t R_PDC_VersionGet | ( | ssp_version_t *const | p_data | ) |
Return PDC HAL driver version. Implements pdc_api_t::versionGet.
| SSP_SUCCESS | Version information successfully read. |
| SSP_ERR_ASSERTION | Null pointer passed as a parameter |