ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
Loading...
Searching...
No Matches
cam_image.h File Reference

SDRAM-backed RGB888 views of one packed VGA UYVY camera frame. More...

#include <stdint.h>
#include "ra8_err.h"
Include dependency graph for cam_image.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  cam_image_size_t : uint32_t {
  k_cam_image_width_px = 640U ,
  k_cam_image_height_px = 480U ,
  k_cam_uyvy_frame_bytes = 614400U ,
  k_cam_rgb_bytes_per_px = 3U ,
  k_cam_rgb_frame_bytes = 921600U
}
 Captured VGA geometry and RGB888 buffer contract. More...

Functions

ra8_err_t cam_image_generate (const uint8_t *uyvy, uint32_t source_bytes)
 Convert one packed Cb-Y0-Cr-Y1 VGA frame into all four RGB views.

Variables

uint8_t g_cam_rgb_0 [k_cam_rgb_frame_bytes]
 Unrotated 640x480 RGB888 image in external SDRAM.
uint8_t g_cam_rgb_90 [k_cam_rgb_frame_bytes]
 Clockwise-90-degree 480x640 RGB888 image in external SDRAM.
uint8_t g_cam_rgb_180 [k_cam_rgb_frame_bytes]
 Clockwise-180-degree 640x480 RGB888 image in external SDRAM.
uint8_t g_cam_rgb_270 [k_cam_rgb_frame_bytes]
 Clockwise-270-degree 480x640 RGB888 image in external SDRAM.
const uint32_t g_cam_rgb_frame_bytes
 Stable byte count of each exported RGB888 buffer.

Detailed Description

SDRAM-backed RGB888 views of one packed VGA UYVY camera frame.

Tag
[Ring 6 / APP] {World: S}

Defines the stable firmware/SWD contract for four RGB888 renderings of the captured VGA frame. The 0- and 180-degree buffers are 640x480; the 90- and 270-degree clockwise buffers are 480x640. Every buffer contains exactly k_cam_rgb_frame_bytes bytes in row-major RGB byte order.

Since
0.1.0

Definition in file cam_image.h.

Enumeration Type Documentation

◆ cam_image_size_t

enum cam_image_size_t : uint32_t

Captured VGA geometry and RGB888 buffer contract.

Enumerator
k_cam_image_width_px 

Unrotated and 180-degree width.

k_cam_image_height_px 

Unrotated and 180-degree height.

k_cam_uyvy_frame_bytes 

640 x 480 x 2-byte packed UYVY input.

k_cam_rgb_bytes_per_px 

RGB888 bytes per output pixel.

k_cam_rgb_frame_bytes 

640 x 480 x 3 bytes.

Definition at line 26 of file cam_image.h.

Function Documentation

◆ cam_image_generate()

ra8_err_t cam_image_generate ( const uint8_t * uyvy,
uint32_t source_bytes )

Convert one packed Cb-Y0-Cr-Y1 VGA frame into all four RGB views.

Performs fixed-point YCbCr conversion and scatters each pixel into caller-observable SDRAM buffers for the four clockwise orientations.

Parameters
[in]uyvySource VGA frame in packed UYVY byte order.
[in]source_bytesValid bytes at uyvy; must equal 614400.
Returns
Error code from validation or cache maintenance.
Return values
k_ra8_okFour complete RGB888 buffers are visible to SWD.
k_ra8_err_null_ptruyvy was NULL.
k_ra8_err_invalid_argsource_bytes was not one VGA UYVY frame.
Precondition
External SDRAM was initialized by ra8_sdramc_init.
uyvy contains a completed, cache-coherent CEU capture.
Postcondition
All four exported buffers contain the same frame at 0/90/180/270.
Dirty D-cache lines covering the four buffers are written to SDRAM.
Note
Rotation angles are clockwise. Not thread-safe.
Since
0.1.0

Definition at line 209 of file cam_image.c.

References cam_image_clean_outputs(), cam_image_convert(), k_cam_uyvy_frame_bytes, k_ra8_err_invalid_arg, and RA8_CHECK_NULL_PTR.

Referenced by cam_finish_verdict().

Variable Documentation

◆ g_cam_rgb_0

uint8_t g_cam_rgb_0[k_cam_rgb_frame_bytes]
extern

Unrotated 640x480 RGB888 image in external SDRAM.

Since
0.1.0

Definition at line 49 of file cam_image.c.

Referenced by cam_image_clean_outputs(), and cam_image_scatter().

◆ g_cam_rgb_180

uint8_t g_cam_rgb_180[k_cam_rgb_frame_bytes]
extern

Clockwise-180-degree 640x480 RGB888 image in external SDRAM.

Since
0.1.0

Definition at line 53 of file cam_image.c.

Referenced by cam_image_clean_outputs(), and cam_image_scatter().

◆ g_cam_rgb_270

uint8_t g_cam_rgb_270[k_cam_rgb_frame_bytes]
extern

Clockwise-270-degree 480x640 RGB888 image in external SDRAM.

Since
0.1.0

Definition at line 55 of file cam_image.c.

Referenced by cam_image_clean_outputs(), and cam_image_scatter().

◆ g_cam_rgb_90

uint8_t g_cam_rgb_90[k_cam_rgb_frame_bytes]
extern

Clockwise-90-degree 480x640 RGB888 image in external SDRAM.

Since
0.1.0

Definition at line 51 of file cam_image.c.

Referenced by cam_image_clean_outputs(), and cam_image_scatter().

◆ g_cam_rgb_frame_bytes

const uint32_t g_cam_rgb_frame_bytes
extern

Stable byte count of each exported RGB888 buffer.

Since
0.1.0

Definition at line 57 of file cam_image.c.

Referenced by cam_finish_verdict().