Note

This is the documentation for the latest development branch and may refer to features that are not available in released versions. If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

K230 video output API reference

Contents

K230 video output API reference#

Overview#

The VO (Video Output) module actively reads video and graphics data from the corresponding location in the memory, and outputs the video and graphics through the corresponding display device. Display/writeback devices, video layers and graphics layers supported by the chip.

LAYER layer supports:

LAYER0

LAYER1

LAYER2

Input format

YUV420 NV12

YUV420 NV12

YUV420 NV12 YUV422 NV16 ?

maximum resolution

1920x1080

1920x1080

1920x1080

Overlay display

Supports configurable overlay order

Supports configurable overlay order

Supports configurable overlay order

Rotation

-

Scaler

-

-

Mirror

-

Gray

-

independent switch

OSD layer support

OSD0

OSD1

OSD2

OSD3

Input format

RGB888 RGB565 ARGB8888 Monochrome-8-bit RGB4444 RGB1555

RGB888 RGB565 ARGB8888 Monochrome-8-bit RGB4444 RGB1555

RGB888 RGB565 ARGB8888 Monochrome-8-bit RGB4444 RGB1555

RGB888 RGB565 ARGB8888 Monochrome-8-bit RGB4444 RGB1555

maximum resolution

1920x1080

1920x1080

1920x1080

1920x1080

Overlay display

Supports configurable overlay order

Supports configurable overlay order

Supports configurable overlay order

Supports configurable overlay order

ARGB 265 grade ALPHA

independent switch

Hardware description#

This hardware introduction is based on evblp3

Mipi interface#

The hardware pins on evblp3 are as follows:

The image contains an icon and the description has been automatically generated

  • iic4 for screen touch iic (scl: gpio7, sda gpio8)

  • screen touch rst: gpio29, int: gpio30

  • screen’s rst: gpio9, backlight: gpio31

  • Mipi pins correspond to screen pins one-to-one

Physical picture#

The picture contains game console, electronics, circuit. Description has been automatically generated

  • 1 in the picture is the mipi interface, which uses a soft cable

  • 2 in the picture is the mipi signal test point, including four data lines and one clk line.

Software description#

The video output software configuration is divided into three parts: phy configuration, dsi configuration, and VO configuration.

PHY configuration process#

The frequency of phy requires configuring three parameters, calculating PLL, configuring voc, and configuring freq. Based on these three parameters, the frequency of txphy can be determined. Each parameter is calculated as follows.

Calculate phy’s pll#

The data rate is given by twice the PLL output clock phase frequency: Data Rate (Gbps) = PLL Fout(GHz) * 2, where the output frequency is a function of the input reference frequency and the multiplication/division ratio. The calculation of phy’s pll is divided into four ranges. Different frequencies correspond to different frequencies. It can be determined in the following ways:

M

m+2

N

n+1

Fclkin

24M

For:

Text, Letter Description automatically generated

However, the following restrictions need to be followed in this case:

Image contains text Description has been automatically generated

For:

Text, Letter Description automatically generated

For:

Text, Letter Description automatically generated

Text description has been automatically generated

For:

Text Medium confidence description has been automatically generated

Each for above corresponds to a pll level, and different levels correspond to different calculation formulas and restrictions. The calculation examples are as follows:

Example:

The rate of mipi is 445.5M: so the rate of pll is 222.75M. The second formula should be selected, and the calculation is as follows

222750000 = 1M / 2N = (m+2) / 2(n+1) * 24000000, the completed formula is as follows:

222.75n + 198.75 = 12m, calculated through excel as follows:

Table description has been automatically generated

The obtained m = 295, n = 15.

m and n in the configuration pll are both integers. If all the values ​​are not integers, you need to add 1 and subtract 1 to the values ​​of m and n. Then work backwards to see which frequency is closest to what you need, and then verify whether it is available. If not, repeat the above operation.

Configure phy’s voc#

To configure the voc of phy, you can query it according to the table:

Table description has been automatically generated

Table description has been automatically generated

Example:

The rate of mipi is 445.5M: so the rate of pll is 222.75M, voc = 010111 = 0x17

configurefreq#

Configuring phy’s freq can be queried according to the table:

Table description has been automatically generated

Table description has been automatically generated

Table description has been automatically generated

Example:

The rate of mipi is 445.5M: the rate of pll is 222.75M, freq selects 0100101, when configuring this, you need to set the highest bit[7] = 1, all freq = 10100101= 0xa5

DSI configuration#

DSI (Display Serial Interface) is a part of the alliance of a set of communication protocols defined by MIPI. It mainly implements digital controllers that implement all protocol functions defined in the MIPI DSI specification, including bidirectional PHYs with two and four channels.

DSI mainly configures the timing for screen display and the function of sending commands in the software.

Configure display timing#

Each manufacturer’s screen will have a set of timings used for screen control, which mainly include frame control timing and line control timing, as shown in the following figure:

Illustration description has been automatically generated

Illustration, schematic description has been automatically generated

These parameters will also be used in DSI, and the configuration timing can be consistent with the screen.

DSI command issuance#

Dsi needs to enter lp mode first, and then you can send commands. The required APIs are as follows:

The data sent is sent according to 8 bits, and it will automatically choose to send long packets or short packets according to the quantity.

DSI self-test mode#

The DSI self-test mode will generate color bar data according to the configured dsi timing and send it out, so that it does not rely on vo to read data from ddr. The test mode is displayed as follows:

Background pattern Medium confidence description has been automatically generated

A 24-bit interface is used between DSI and vo, so the configured color bar is the effect shown in the picture above. To use it, you only need to configure the DSI and then enable the color bar. The API is as follows

VO configuration#

VO (video output) is mainly the VO (Video Output, video output) module that actively reads video and graphics data from the corresponding location in the memory, and outputs the video and graphics through the corresponding display device. The VO part contains two configurations, one is the timing configuration, and the other is the video layer configuration.

VO timing configuration#

The timing configuration of VO uses the same configuration parameters as the timing configuration of dsi. The specific rows and columns are the same. Please refer to the introduction of dsi timing.

V1.2.3.2 O layer configuration#

The VO layer currently supports 3 layers and 4 osd layers. The Layer layer can only display the yuv image format (the functions supported by layer0 and layer1 are in the charts in Overview).

VO’s writeback function configuration#

VO also supports the write-back function. This can verify whether the VO configuration is correct. After the VO configuration is completed, the data will be written back to ddr to facilitate verification of whether there is any abnormality in the VO configuration.

Debugging method of VO module#

Screen test method#
  • You can configure the screen to enter self-test mode through the LP command to see if the generated image is normal.

  • Read the screen register through the LP command to see if there is a return

DSI test methods#
  • After configuring the DSI, let the screen enter the self-test mode, measure the signal to see if it is normal, and you can also see if the screen produces a color bar image.

  • Check the err status register of phy to see if there is an err status. You can check it through proc.

VO test method#
  • After the VO configuration is completed, turn on the writeback function to check whether it is consistent with the configuration requirements.

  • Read the err status register of DSI and check whether underflow or overflow occurs in data transmission between VO and dsi. If so, adjust the timing appropriately and try again.

API Reference#

TXPHY#

This function module provides the following APIs:

kd_mpi_set_mipi_phy_attr#

Description

Set the frequency of phy

Syntax

k_s32 kd_mpi_set_mipi_phy_attr(k_vo_mipi_phy_attr *attr)

Parameters

Parameter Name

Description

Input/Output

attr

Frequency structure description of Phy k_vo_mipi_phy_attr

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

DSI#

This function module provides the following APIs:

kd_mpi_dsi_set_attr#

Description

Configure dsi attribute parameters

Syntax

k_s32 kd_mpi_dsi_set_attr(k_display_mode *attr)

Parameter Name

Description

Input/Output

attr

dsi attribute parameters

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_dsi_enable#

Description

opendsi

Syntax

k_s32 kd_mpi_dsi_enable(k_u32 enable)

Parameters

Parameter Name

Description

Input/Output

enable

dsi enable status (1: enable, 0: disble)

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_dsi_send_cmd#

Description

Dsi send command

Syntax

k_s32 kd_mpi_dsi_send_cmd(k_u8 *data, k_s32 cmd_len)

Parameters

Parameter Name

Description

Input/Output

data

data sent

Input

cmd_len

Data length

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_dsi_read_pkg#

Description

Dsi read command

Syntax

k_s32 kd_mpi_dsi_read_pkg(k_u8 addr, k_u16 cmd_len, k_u32 *rv_data)

Parameters

Parameter Name

Description

Input/Output

addr

accepted data

Input

cmd_len

Data length

Input

rv_data

Returned data

Output

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_dsi_set_test_pattern#

Description

Configure dsi to enter self-test mode

Syntax

k_s32 kd_mpi_dsi_set_test_pattern(void)

【parameter】,

None

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

VO#

kd_mpi_vo_init#

Description

Vo initialization default parameters

Syntax

k_s32 kd_mpi_vo_init(void);

Parameters

None

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_set_dev_param#

Description

Dsi send command

Syntax

k_s32 kd_mpi_vo_set_dev_param(k_vo_pub_attr *attr)

Parameters

Parameter Name

Description

Input/Output

attr

Video output device public attribute structure pointer.

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_enable_video_layer#

Description

Configure layer attribute parameters

Syntax

k_s32 kd_mpi_vo_enable_video_layer(k_vo_layer layer)

Parameters

Parameter Name

Description

Input/Output

layer

Video output video layer number value range [0 – K_MAX_VO_LAYER_NUM]

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_disable_video_layer#

Description

Turn off video layer

Syntax

k_s32 kd_mpi_vo_disable_video_layer(k_vo_layer layer)

Parameters

Parameter Name

Description

Input/Output

layer

Video output video layer number value range [0 – K_MAX_VO_LAYER_NUM]

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File:

  • Library File:

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_enable#

Description

openvo

Syntax

k_u8 kd_mpi_vo_enable(void);

Parameters

None

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File:

  • Library File:

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_chn_insert_frame#

Description

Insert frames into the channel of vo

Syntax

k_s32 kd_mpi_vo_chn_insert_frame(k_u32 chn_num, k_video_frame_info *vf_info)

Parameters

Parameter Name

Description

Input/Output

chn_num

Number of channels

Input

vf_info

The structure pointer of the video frame.

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_video_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_chn_dump_frame#

Description

Grab a frame of data from the channel of vo

Syntax

k_s32 kd_mpi_vo_chn_dump_frame(k_u32 chn_num, k_video_frame_info *vf_info, k_u32 timeout_ms);

Parameters

Parameter Name

Description

Input/Output

chn_num

channel id

Input

vf_info

Structure pointer of video frame

Input

timeout_ms

timeout

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_video_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_chn_dump_release#

Description

Release grab frame

Syntax

k_s32 kd_mpi_vo_chn_dump_release(k_u32 chn_num, const k_video_frame_info *vf_info);

Parameters

Parameter Name

Description

Input/Output

chn_num

channel id

Input

vf_info

Structure pointer of video frame

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_video_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_osd_enable#

Description

Open the osd layer

Syntax

k_s32 kd_mpi_vo_osd_enable(k_vo_osd layer)

Parameters

Parameter Name

Description

Input/Output

layer

Video output video layer number value range [0 – K_MAX_VO_OSD_NUM]

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_osd_disable#

Description

Close osd layer

Syntax

k_s32 kd_mpi_vo_osd_disable(k_vo_osd layer)

Parameters

Parameter Name

Description

Input/Output

layer

Video output video layer number value range [0 – K_MAX_VO_OSD_NUM]

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_set_video_osd_attr#

Description

Set osd layer properties

Syntax

k_s32 kd_mpi_vo_set_video_osd_attr(k_vo_osd layer, k_vo_video_osd_attr *attr)

Parameters

Parameter Name

Description

Input/Output

layer

Video output video layer number value range [0 – K_MAX_VO_OSD_NUM]

Input

osd layer attribute parameters

osd layer attribute parameters

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_set_wbc_attr#

Description

Set writeback properties

Syntax

k_s32 kd_mpi_vo_set_wbc_attr(k_vo_wbc_attr *attr)

Parameters

Parameter Name

Description

Input/Output

attr

writeback attribute parameter

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_enable_wbc#

Description

enable writeback

Syntax

k_s32 kd_mpi_vo_enable_wbc(void)

Parameters

None

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_disable_wbc#

Description

Close writeback

Syntax

k_s32 kd_mpi_vo_disable_wbc(void)

Parameters

None

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_display_reset#

Description

Reset the video output subsystem

Syntax

k_s32 kd_display_reset(void)

Parameters

None

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_display_set_backlight#

Description

Reset screen and turn on backlight

Syntax

k_s32 kd_display_set_backlight(void)

Parameters

None

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_set_user_sync_info#

Description

Set user interface timing information for configuring clock source, clock size, and clock division ratio

Syntax

k_s32 kd_mpi_vo_set_user_sync_info(k_u32 pre_div,k_u32 clk_en)

Parameters

Parameter Name

Description

Input/Output

pre_div

User frequency division number

Input

clk_en

Frequency division enable enable

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_vo_draw_frame#

Description

picture frame

Syntax

k_s32 kd_mpi_vo_draw_frame(k_vo_draw_frame *frame)

Parameters

Parameter Name

Description

Input/Output

frame

Frame property parameters

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h

  • Library File: libvo.a

Notes

None

Example

None

Related Topics

None

kd_mpi_get_connector_info#

Description

Get the data structure of the connecor connector through the connection type

Syntax

k_s32 kd_mpi_get_connector_info(k_connector_type connector_type, k_connector_info *connector_info)

Parameters

Parameter Name

Description

Input/Output

connector_type

Connector type

Input

connector_info

Connector data structure

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h k_connector_comm.h

  • Library File: libvo.a libconnector.a

Notes

None

Example

None

Related Topics

None

kd_mpi_connector_open#

Description

Get the data structure of the connecor connector through the connection type

Syntax

k_s32 kd_mpi_connector_open(const char *connector_name)

Parameters

Parameter Name

Description

Input/Output

connector_name

Device node for the connector

Input

Return Value

Return Value

Description

fd

Successfully returns the id of the open fd

less than 0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h k_connector_comm.h

  • Library File: libvo.a libconnector.a

Notes

None

Example

None

Related Topics

None

kd_mpi_connector_power_set#

Description

Turn on the power of the connector

Syntax

k_s32 kd_mpi_connector_power_set(k_s32 fd, k_bool on)

Parameters

Parameter Name

Description

Input/Output

fd

Device node for the connector

Input

on

Connector device switch

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h k_connector_comm.h

  • Library File: libvo.a libconnector.a

Notes

None

Example

None

Related Topics

None

kd_mpi_connector_init#

Description

vo connector initialization

Syntax

k_s32 kd_mpi_connector_init(k_s32 fd, k_connector_info info)

Parameters

Parameter Name

Description

Input/Output

fd

Device node for the connector

Input

info

Connector initialization parameters

Input

Return Value

Return Value

Description

0

success.

non-0

Failure, see error code.

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h k_connector_comm.h

  • Library File: libvo.a libconnector.a

Notes

None

Example

None

Related Topics

None

kd_mpi_connector_get_negotiated_data#

Description

The Display driver and the monitor automatically negotiate the resolution. After the negotiation is successful, the negotiated data will be saved to the negotiated_data variable.

Syntax

k_s32 kd_mpi_connector_get_negotiated_data(k_s32 fd, k_connector_negotiated_data *negotiated_data);

Parameters

Parameter Name

Description

Input/Output

fd

file descriptor

Input

negotiated_data

Data negotiated between Display driver and HDMI display

Input

Return Value

Return Value

Description

>= 1

Success, the number of resolutions supported by the Display driver after adaptation is successful

-1

Failure, see error code

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h k_connector_comm.h

  • Library File: libvo.a libconnector.a

Notes

kd_mpi_connector_get_negotiated_data() will only negotiate with the display. After successful negotiation, the best resolution will not be set to the VO, DSI, and HDMI modules.

Example

None

Related Topics

None

kd_mpi_connector_adapt_resolution#

Description

The Display driver and the monitor automatically negotiate the resolution. After successful negotiation, the negotiated data will be saved to the negotiated_data variable, and the best resolution will be set to the VO, DSI, and HDMI modules.

Syntax

k_s32 kd_mpi_connector_adapt_resolution(k_connector_type type, k_connector_negotiated_data *negotiated_data)

Parameters

Parameter Name

Description

Input/Output

type

Device node of the connector, HDMI interface is usually set to LT9611_MIPI_ADAPT_RESOLUTION

Input

negotiated_data

Data negotiated between Display driver and HDMI display

Input

Return Value

Return Value

Description

0

Success

-1

Failure, see error code

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h k_connector_comm.h

  • Library File: libvo.a libconnector.a

Notes

1 kd_mpi_connector_adapt_resolution() internally negotiates with the display by calling kd_mpi_connector_get_negotiated_data()

2 After the application calls the kd_mpi_connector_adapt_resolution() function to complete the adaptive setting, it can still call kd_mpi_get_connector_info(), kd_mpi_connector_open(), kd_mpi_connector_power_set(), kd_mpi_connector_init() reset the output resolution

Example

None

Related Topics

None

kd_mpi_connector_set_mirror#

Description

Set screen mirror function

Syntax

k_s32 kd_mpi_connector_set_mirror(k_s32 fd, k_connector_mirror mirror)

Parameters

Parameter Name

Description

Input/Output

fd

file descriptor

Input

mirror

Screen mirror function

Input

Return Value

Return Value

Description

0

Success

-1

Failure, see error code

Chip differences

None

Requirements

  • Header File: mpi_vo_api.h k_vo_comm.h k_connector_comm.h

  • Library File: libvo.a libconnector.a

Notes

1 kd_mpi_connector_adapt_resolution() internally negotiates with the display by calling kd_mpi_connector_get_negotiated_data()

2 After the application calls the kd_mpi_connector_adapt_resolution() function to complete the adaptive setting, it can still call kd_mpi_get_connector_info(), kd_mpi_connector_open(), kd_mpi_connector_power_set(), kd_mpi_connector_init() reset the output resolution

Example

None

Related Topics

None

data type#

VO#

k_vo_intf_sync#

Description

Define resolution and frame rate in video

definition

typedef enum {  K_VO_OUT_1080P30,  K_VO_OUT_1080P60, } k_vo_intf_sync;

member

member name

Description

K_VO_OUT_1080P30

1080 means 1920x1080 pixels. 30 means 30fps

K_VO_OUT_1080P60

1080 means 1920x1080 pixels. 60 means 60fps

K_VO_OUT_1080x1920P30

1080x1920 means 1080x1920 pix. 30 means 30fps

K_VO_OUT_11080x1920P60

1080x1920 means 1080x1920 pix. 60 means 60fps

Notes

None

Related Data Types and Interfaces

k_vo_intf_type#

Description

Define resolution and frame rate in video

definition

typedef enum {  K_VO_INTF_MIPI = 0, } k_vo_intf_type;

member

member name

Description

K_VO_INTF_MIPI

MIPI interface

Notes

None

Related Data Types and Interfaces

k_pixel_format#

Description

The data formats supported by the layer in the display. The structure below only lists the data formats supported by the display, not all data formats.

definition

typedef enum { PIXEL_FORMAT_RGB_444 = 0, PIXEL_FORMAT_RGB_555, PIXEL_FORMAT_RGB_565, PIXEL_FORMAT_RGB_888, PIXEL_FORMAT_BGR_444, PIXEL_FORMAT_BGR_555, PIXEL_FORMAT_BGR_565, PIXEL_FORMAT_BGR_888, PIXEL_FORMAT_ARGB_1555, PIXEL_FORMAT_ARGB_4444, PIXEL_FORMAT_ARGB_8565, PIXEL_FORMAT_ARGB_8888, PIXEL_FORMAT_ARGB_2BPP, PIXEL_FORMAT_ABGR_1555, PIXEL_FORMAT_ABGR_4444, PIXEL_FORMAT_ABGR_8565, PIXEL_FORMAT_ABGR_8888, PIXEL_FORMAT_BGRA_8888, PIXEL_FORMAT_RGB_MONOCHROME_8BPP, PIXEL_FORMAT_RGB_BAYER_8BPP, PIXEL_FORMAT_RGB_BAYER_10BPP, PIXEL_FORMAT_RGB_BAYER_12BPP, PIXEL_FORMAT_RGB_BAYER_14BPP, PIXEL_FORMAT_RGB_BAYER_16BPP, PIXEL_FORMAT_YVU_PLANAR_422, PIXEL_FORMAT_YVU_PLANAR_420, PIXEL_FORMAT_YVU_PLANAR_444, PIXEL_FORMAT_YVU_SEMIPLANAR_422, PIXEL_FORMAT_YVU_SEMIPLANAR_420, PIXEL_FORMAT_YVU_SEMIPLANAR_444, PIXEL_FORMAT_YUV_SEMIPLANAR_422, PIXEL_FORMAT_YUV_SEMIPLANAR_420, PIXEL_FORMAT_YUV_SEMIPLANAR_444, PIXEL_FORMAT_YUYV_PACKAGE_422, PIXEL_FORMAT_YVYU_PACKAGE_422, PIXEL_FORMAT_UYVY_PACKAGE_422, PIXEL_FORMAT_VYUY_PACKAGE_422, PIXEL_FORMAT_YYUV_PACKAGE_422, PIXEL_FORMAT_YYVU_PACKAGE_422, PIXEL_FORMAT_UVYY_PACKAGE_422, PIXEL_FORMAT_VUYY_PACKAGE_422, PIXEL_FORMAT_VY1UY0_PACKAGE_422, PIXEL_FORMAT_YUV_PACKAGE_444, PIXEL_FORMAT_YUV_400, PIXEL_FORMAT_UV_420, PIXEL_FORMAT_BGR_888_PLANAR, PIXEL_FORMAT_RGB_888_PLANAR, PIXEL_FORMAT_HSV_888_PACKAGE, PIXEL_FORMAT_HSV_888_PLANAR, PIXEL_FORMAT_LAB_888_PACKAGE, PIXEL_FORMAT_LAB_888_PLANAR, PIXEL_FORMAT_S8C1, PIXEL_FORMAT_S8C2_PACKAGE, PIXEL_FORMAT_S8C2_PLANAR, PIXEL_FORMAT_S8C3_PLANAR, PIXEL_FORMAT_S16C1, PIXEL_FORMAT_U8C1, PIXEL_FORMAT_U16C1, PIXEL_FORMAT_S32C1, PIXEL_FORMAT_U32C1, PIXEL_FORMAT_U64C1, PIXEL_FORMAT_S64C1, PIXEL_FORMAT_RGB_565_LE = 300, PIXEL_FORMAT_BGR_565_LE, PIXEL_FORMAT_BUTT } k_pixel_format;

member

member name

Description

PIXEL_FORMAT_YVU_PLANAR_420

YUV420 NV12

PIXEL_FORMAT_YVU_PLANAR_422

YUV422 NV16

PIXEL_FORMAT_RGB_565

RGB565

PIXEL_FORMAT_RGB_888

RGB888

PIXEL_FORMAT_RGB_MONOCHROME_8BPP

8 BIT RGB

PIXEL_FORMAT_ARGB_8888

ARGB8888

PIXEL_FORMAT_ARGB_4444

ARGB4444

PIXEL_FORMAT_ARGB_1555

ARGB1444

Notes

None

Related Data Types and Interfaces

None

k_vo_osd#

Description

The number of OSDs and the number of each OSD

definition

typedef enum {  K_VO_OSD0,  K_VO_OSD1,  K_VO_OSD2,  K_VO_OSD3,  K_MAX_VO_OSD_NUM, } k_vo_osd;

member

member name

Description

K_VO_OSD0

Layer 0 osd

K_VO_OSD1

layer 1 osd

K_VO_OSD2

layer 2 osd

K_VO_OSD3

layer 3 osd

K_MAX_VO_OSD_NUM

Osd layer maximum number flag

Notes

None

Related Data Types and Interfaces

None

k_vo_layer#

Description

The number of layers and the number of each layer

definition

typedef enum {  K_VO_LYAER0 = 0,  K_VO_LYAER1,  K_VO_LYAER2,  K_MAX_VO_LAYER_NUM, } k_vo_layer;

member】

member name

Description

K_VO_LYAER0

Layer 0

K_VO_LYAER1

layer 1

K_VO_LYAER2

Layer 2

K_VO_LYAER3

layer 3

K_MAX_VO_LAYER_NUM

layer maximum number of layers flag

Notes

None

Related Data Types and Interfaces

None

k_vo_rotation#

Description

Layer rotation supported functions

definition

typedef enum {  K_ROTATION_0 = (0x01L << 0),  K_ROTATION_90 = (0x01L << 1),  K_ROTATION_180 = (0x01L << 2),  K_ROTATION_270 = (0x01L << 3), } k_vo_rotation;

Notes

None

Related Data Types and Interfaces

None

k_vo_mirror_mode#

Description

Features supported by Layer mirror.

definition

typedef enum {  K_VO_MIRROR_NONE = (0x01L << 4),  K_VO_MIRROR_HOR = (0x01L << 5),  K_VO_MIRROR_VER = (0x01L << 6),  K_VO_MIRROR_BOTH = (0x01L << 7), } k_vo_mirror_mode;

member

member name

Description

K_VO_MIRROR_NONE

Layer does not mirror

K_VO_MIRROR_HOR

Layer only does horizontal mirror

K_VO_MIRROR_VER

Layer only does vertical mirror

K_VO_MIRROR_BOTH

Layer does vertical and horizontal mirror

Notes

None

Related Data Types and Interfaces

None

k_vo_user_sync_info#

Description

User-defined clock frequency division.

definition

typedef struct { k_u32 pre_div; k_u32 clk_en;

} k_vo_user_sync_info;

member

member name

Description

pre_div

Clkext frequency division

clk_en

Display clock enable

Notes

None

Related Data Types and Interfaces

None

k_vo_point#

Description

Define the coordinate information structure.

definition

typedef struct {  k_u32 x;  k_u32 y; }k_vo_point;

member

member name

Description

x

abscissa

y

vertical coordinate

Notes

None

Related Data Types and Interfaces

None

k_vo_size#

Description

Define the size information structure.

definition

typedef struct {  k_u32 width;  k_u32 height; } k_vo_size;

member

member name

Description

width

width

height

high

Notes

None

Related Data Types and Interfaces

None

k_vo_video_layer_attr#

Description

Define display layer layer properties

definition

typedef struct { k_vo_point display_rect; k_vo_size img_size; k_pixel_format pixel_format; k_u32 stride; k_u32 func; k_vo_scaler_attr scaler_attr;

} k_vo_video_layer_attr;

member

member name

Description

display_rect;

The starting position of the OSD layer

img_size

Image resolution structure, that is, the size of the composite picture

pixel_format

Data formats supported by the video layer

stride

image stride

func

Set the rotation angle (0, 90, 180, 270)

scaler_attr

Zoom settings

Notes

alptha_tpye is only used for osd layer

Related Data Types and Interfaces

None

k_vo_wbc_attr#

Description

Define the writeback attribute.

definition

typedef struct {  k_vo_size target_size;  k_pixel_format pixel_format;  k_u32 stride;  k_u32 y_phy_addr; } k_vo_wbc_attr;

member

member name

Description

target_size

Target size for writeback

pixel_format

Write-back data format

stride;

write-back stride

y_addr

Physical address of image writeback

Notes

y_addr needs to allocate space

Related Data Types and Interfaces

None

k_vo_pub_attr#

Description

Configure the public properties of the video output device.

definition

typedef struct {  k_u32 bg_color;  k_vo_intf_type intf_type;  k_vo_intf_sync intf_sync;  k_vo_display_resolution *sync_info;  }k_vo_pub_attr;

member

member name

Description

bg_color

background color

type

Interface type, currently only supports mipi

intf_sync

Resolution and frame rate in video

sync_info

Image output timing

Notes

None

Related Data Types and Interfaces

None

k_vo_scaler_attr#

Description

Define the scaler attribute

definition

typedef struct{  k_size out_size;  k_u32 stride; }k_vo_scaler_attr;

member

member name

Description

out_size

Output size

stride

Input stride

Notes

None

Related Data Types and Interfaces

None

k_vo_draw_frame#

Description

Define the properties of the frame

definition

typedef struct {  k_u32 draw_en;  k_u32 line_x_start;  k_u32 line_y_start;  k_u32 line_x_end;  k_u32 line_y_end;  k_u32 frame_num; }k_vo_draw_frame;

member

member name

Description

draw_en

Picture frame enable

line_x_start

Start of X direction

line_y_start

Start of y direction

line_x_end

End point in X direction

line_y_end

end point in y direction

frame_num

The num number of the current frame [0 - 16]

Notes

None

Related Data Types and Interfaces

None

k_vo_display_resolution#

Description

Display timing attribute.

definition

typedef struct{  k_u32 pclk;  k_u32 phyclk;  k_u32 htotal;  k_u32 hdisplay;  k_u32 hsync_len;  k_u32 hback_porch;  k_u32 hfront_porch;  k_u32 vtotal;  k_u32 vdisplay;  k_u32 vsync_len;  k_u32 vback_porch;  k_u32 vfront_porch; } k_vo_display_resolution;

member

member name

Description

pclk

Vo’s pix clk frequency

phyclk

frequency of d-phy

htotal

Total pixels in a row

hdisplay

The effective number of pixels in a row

hsync_len

Number of pixels for row synchronization

hback_porch

The number of pixels in the back shoulder

hfront_porch

The number of pixels on the front shoulder

vtotal

Total number of rows

vdisplay

The number of valid lines in one frame

vsync_len

Number of pixels for frame synchronization

vback_porch

Number of rows of back shoulder

vfront_porch

Number of rows of front shoulder

Notes

None

Related Data Types and Interfaces

None

k_vo_mipi_phy_attr#

Description

Structure defining mipi phy frequency

definition

typedef struct { k_u32 n; k_u32 m; k_u32 voc; k_u32 phy_lan_num; k_u32 hs_freq; } k_vo_mipi_phy_attr;

member

member name

Description

n

Pll coefficient

m

Pll coefficient

voc

Pll coefficient

phy_lan_num

Phy lan quantity

hs_freq

Frequency range of Phy

Notes

None

Related Data Types and Interfaces

None

k_vo_video_osd_attr#

Description

Configure the public properties of the osd layer.

definition

typedef struct {  k_vo_point display_rect;  k_vo_size img_size;  k_pixel_format pixel_format;  k_u32 stride;  k_u8 global_alptha; } k_vo_video_osd_attr;

member

member name

Description

display_rect

location information

img_size

effective size

pixel_format

Data format

stride;

Stride

global_alptha

transparency

Notes

None

Related Data Types and Interfaces

None

k_video_frame_info#

Description

One frame of information.

definition

typedef struct {  k_video_frame v_frame;  k_u32 pool_id;  k_mod_id mod_id; } k_video_frame_info;

member

member name

Description

v_frame

frame information

pool_id

VB pool ID

mod_id

Video frame id

Notes

None

Related Data Types and Interfaces

None

k_connector_type#

Description

Type of connected screen (since the number of supported screens will be increased, please refer to the latest definition in the SDK).

definition

typedef enum {  HX8377_V2_MIPI_4LAN_1080X1920_30FPS;  LT9611_MIPI_4LAN_1920X1080_60FPS;  LT9611_MIPI_4LAN_1920X1080_30FPS; } k_connector_type;

member

member name

Description

v_frame

frame information

HX8377_V2_MIPI_4LAN_1080X1920_30FPS

hx8377 screen initialization

LT9611_MIPI_4LAN_1920X1080_60FPS

hdmi 1080p60 initialization

LT9611_MIPI_4LAN_1920X1080_30FPS

hdmi 1080p30 initialization

Notes

None

Related Data Types and Interfaces

None

k_dsi_lan_num#

Description

Number of lanes for dsi.

definition

typedef enum {  K_DSI_1LAN = 0,  K_DSI_2LAN = 1,  K_DSI_4LAN = 3, } k_dsi_lan_num;

member

member name

Description

K_DSI_1LAN

1 line mode

K_DSI_2LAN

2-wire mode

K_DSI_4LAN

4-wire mode

Notes

None

Related Data Types and Interfaces

None

k_dsi_work_mode#

Description

dsi working mode

definition

typedef enum{  K_BURST_MODE = 0,  K_NON_BURST_MODE_WITH_SYNC_EVENT = 1,  K_NON_BURST_MODE_WITH_PULSES = 2, } k_dsi_work_mode;

member

member name

Description

K_BURST_MODE

dsi works in brutal mode

K_NON_BURST_MODE_WITH_SYNC_EVENT

dsi works in non brust event mode

K_NON_BURST_MODE_WITH_PULSES

dsi works in non brust pulses mode

Notes

None

Related Data Types and Interfaces

None

k_vo_dsi_cmd_mode#

Description

dsi mode for sending commands.

definition

typedef enum {  K_VO_LP_MODE,  K_VO_HS_MODE, } k_vo_dsi_cmd_mode;

member

member name

Description

K_VO_LP_MODE

Send command in lp mode

K_VO_HS_MODE

Send command in hs mode

Notes

None

Related Data Types and Interfaces

None

k_connectori_phy_attr#

Description

connector connector configures phy information.

definition

typedef struct {  k_u32 n;  k_u32 m;  k_u32 voc;  k_u32 hs_freq; } k_connectori_phy_attr;

member

member name

Description

n

Pll coefficient

m

Pll coefficient

voc

Pll coefficient

hs_freq

Frequency range of Phy

Notes

None

Related Data Types and Interfaces

None

k_connector_info#

Description

Connector information.

definition

typedef struct {  const char *connector_name;  k_u32 screen_test_mode;  k_u32 dsi_test_mode;  k_u32 bg_color;  k_u32 intr_line;  k_u32 pixclk_div;  k_dsi_lan_num lan_num;  k_dsi_work_mode work_mode;  k_vo_dsi_cmd_mode cmd_mode;  k_connectori_phy_attr phy_attr;  k_vo_display_resolution resolution;  k_connector_type type; } k_connector_info;

member

member name

Description

connector_name

Device node for the connector

screen_test_mode

screen test mode

dsi_test_mode

DSI test mode

bg_color

background color

intr_line

Screen line count

pixclk_div

Clock divider

lan_num

Lan mode settings: 1LAN, 2LAN, 4LAN

work_mode

working mode

cmd_mode

command mode

phy_attr

Displayed physical address

resolution

resolution

k_connector_info

Current connector information

Notes

None

Related Data Types and Interfaces

None

k_connector_negotiated_data#

Description

Data negotiated between Display driver and HDMI display

definition

typedef struct {  k_u32 connection_status;  k_u32 negotiated_count;  k_connector_type negotiated_types[256]; } k_connector_negotiated_data;

member

member name

Description

connection_status

HDMI interface connection status

negotiated_count

After negotiation between the Display driver and the HDMI display, the number of resolutions supported by the Display driver

negotiated_types[256]

After negotiation between the Display driver and the HDMI display, the list of resolutions supported by the Display driver, negotiated_types[0] indicates the best resolution

Notes

None

Related Data Types and Interfaces

None

k_connector_mirror#

Description

Mirror function of Display driver

definition

typedef enum {  K_CONNECTOR_MIRROR_HOR = 1,  K_CONNECTOR_MIRROR_VER,  K_CONNECTOR_MIRROR_BOTH, }k_connector_mirror;

member

member name

Description

K_CONNECTOR_MIRROR_HOR

horizontal mirror

K_CONNECTOR_MIRROR_VER

vertical mirror

K_CONNECTOR_MIRROR_BOTH

Mirror both horizontally and vertically

Notes

None

Related Data Types and Interfaces

None

error code#

Table 41 VO API error codes

error code

Macro definition

Description

0xa00b8006

K_ERR_VO_NULL_PTR

Parameter null pointer error

0xa00b8001

K_ERR_VO_INVALID_DEVID

Invalid dev id

0xa00b8002

K_ERR_VO_INVALID_CHNID

Invalid chn id

0xa00b8005

K_ERR_VO_UNEXIST

Video cache does not exist

0xa00b8004

K_ERR_VO_EXIST

Video cache exists

0xa00b8003

K_ERR_VO_ILLEGAL_PARAM

Parameter setting is invalid

0xa00b8010

K_ERR_VO_NOTREADY

vo is not ready yet

0xa00b8012

K_ERR_VO_BUSY

System is busy

0xa00b8007

K_ERR_VO_NOT_CONFIG

Configuration not allowed

0xa00b8008

K_ERR_VO_NOT_SUPPORT

Unsupported operation

0xa00b8009

K_ERR_VO_NOT_PERM

Operation not allowed

0xa00b800c

K_ERR_VO_NOMEM

Failed to allocate memory

0xa00b800d

K_ERR_VO_NOBUF

no buff

0xa00b800e

K_ERR_VO_BUF_EMPTY

Buf is empty

0xa00b800f

K_ERR_VO_BUF_FULL

Buf is full

0xa00b8011

K_ERR_VO_BADADDR

wrong address

0xa00b8012

K_ERR_VO_BUSY

System is busy

Comments list
Comments
Log in