RA Flexible Software Package Documentation  Release v5.6.0

 
CAPTURE Interface

Detailed Description

Interface for CAPTURE functions.

Summary

The CAPTURE interface provides the functionality for capturing an image from an image sensor/camera. When a capture is complete a capture complete interrupt is triggered.

Data Structures

struct  capture_status_t
 
struct  capture_callback_args_t
 
struct  capture_cfg_t
 
struct  capture_api_t
 
struct  capture_instance_t
 

Typedefs

typedef uint32_t capture_event_t
 
typedef void capture_ctrl_t
 

Enumerations

enum  capture_state_t
 

Data Structure Documentation

◆ capture_status_t

struct capture_status_t

CAPTURE status

Data Fields
capture_state_t state Current state.
uint32_t * p_buffer Pointer to active buffer.
uint32_t data_size Size of data written to provided buffer.

◆ capture_callback_args_t

struct capture_callback_args_t

CAPTURE callback function parameter data

Data Fields
capture_event_t event Event causing the callback.
uint8_t * p_buffer Pointer to buffer that contains captured data.
void const * p_context Placeholder for user data. Set in capture_api_t::open function in capture_cfg_t.

◆ capture_cfg_t

struct capture_cfg_t

CAPTURE configuration parameters.

Data Fields

uint16_t x_capture_start_pixel
 Horizontal position to start capture.
 
uint16_t x_capture_pixels
 Number of horizontal pixels to capture.
 
uint16_t y_capture_start_pixel
 Vertical position to start capture.
 
uint16_t y_capture_pixels
 Number of vertical lines/pixels to capture.
 
uint8_t bytes_per_pixel
 Number of bytes per pixel.
 
void(* p_callback )(capture_callback_args_t *p_args)
 Callback provided when a CAPTURE transfer ISR occurs.
 
void const * p_context
 User defined context passed to callback function.
 
void const * p_extend
 Extension parameter for hardware specific settings.
 

◆ capture_api_t

struct capture_api_t

CAPTURE functions implemented at the HAL layer will follow this API.

Data Fields

fsp_err_t(* open )(capture_ctrl_t *const p_ctrl, capture_cfg_t const *const p_cfg)
 
fsp_err_t(* close )(capture_ctrl_t *const p_ctrl)
 
fsp_err_t(* captureStart )(capture_ctrl_t *const p_ctrl, uint8_t *const p_buffer)
 
fsp_err_t(* callbackSet )(capture_ctrl_t *const p_ctrl, void(*p_callback)(capture_callback_args_t *), void const *const p_context, capture_callback_args_t *const p_callback_memory)
 
fsp_err_t(* statusGet )(capture_ctrl_t *const p_ctrl, capture_status_t *p_status)
 

Field Documentation

◆ open

fsp_err_t(* capture_api_t::open) (capture_ctrl_t *const p_ctrl, capture_cfg_t const *const p_cfg)

Initial configuration.

Note
To reconfigure after calling this function, call capture_api_t::close first.
Parameters
[in]p_ctrlPointer to control structure.
[in]p_cfgPointer to pin configuration structure.

◆ close

fsp_err_t(* capture_api_t::close) (capture_ctrl_t *const p_ctrl)

Closes the driver and allows reconfiguration. May reduce power consumption.

Parameters
[in]p_ctrlPointer to control structure.

◆ captureStart

fsp_err_t(* capture_api_t::captureStart) (capture_ctrl_t *const p_ctrl, uint8_t *const p_buffer)

Start a capture.

Parameters
[in]p_ctrlPointer to control structure.
[in]p_bufferNew pointer to store captured image data.

◆ callbackSet

fsp_err_t(* capture_api_t::callbackSet) (capture_ctrl_t *const p_ctrl, void(*p_callback)(capture_callback_args_t *), void const *const p_context, capture_callback_args_t *const p_callback_memory)

Specify callback function and optional context pointer and working memory pointer.

Parameters
[in]p_ctrlPointer to the CAPTURE control block.
[in]p_callbackCallback function
[in]p_contextPointer to send to callback function
[in]p_working_memoryPointer to volatile memory where callback structure can be allocated. Callback arguments allocated here are only valid during the callback.

◆ statusGet

fsp_err_t(* capture_api_t::statusGet) (capture_ctrl_t *const p_ctrl, capture_status_t *p_status)

Check scan status.

Parameters
[in]p_ctrlPointer to control handle structure
[out]p_statusPointer to store current status in

◆ capture_instance_t

struct capture_instance_t

This structure encompasses everything that is needed to use an instance of this interface.

Data Fields
capture_ctrl_t * p_ctrl Pointer to the control structure for this instance.
capture_cfg_t const * p_cfg Pointer to the configuration structure for this instance.
capture_api_t const * p_api Pointer to the API structure for this instance.

Typedef Documentation

◆ capture_event_t

typedef uint32_t capture_event_t

CAPTURE callback event ID - see implimentation for details

◆ capture_ctrl_t

typedef void capture_ctrl_t

CAPTURE control block. Allocate an instance specific control block to pass into the CAPTURE API calls.

Enumeration Type Documentation

◆ capture_state_t

CAPTURE states.

Enumerator
CAPTURE_STATE_IDLE 

CAPTURE is idle.

CAPTURE_STATE_IN_PROGRESS 

CAPTURE capture in progress.

CAPTURE_STATE_BUSY 

CAPTURE reset in progress.