DRV_ROTT

[English]

DRV_ROTT API Status

API

drv_rott_init()

drv_rott_deinit()

drv_rott_config()

drv_rott_start()

drv_rott_int_enable()

drv_rott_int_cbk_register()

DRV_ROTT API Reference

Header File

Functions

int32_t drv_rott_init(void)

init a rotate device.

rotate硬件加速器初始化,在使用rotate功能前需要调用

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_rott_deinit(void)

deinit a rotate device.

反初始化rotate硬件加速器,对drv_rott_init()进行反向操作

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_rott_config(rott_config_t *p_config)

config rotate parameter

  • ROTT_ONLY_YUV2RGB565, only use yuv data pixel convert to rgb565 pixel, no rotate

    • ROTT_ROTATE90, if rot_input_fmt = RGB565, just rotate; if rot_input_fmt = yuv, not only rotate but convert to rgb565.

    • ROTT_ROTATE170,if rot_input_fmt = RGB565, just rotate; if rot_input_fmt = yuv, not only rotate but convert to rgb565.

参数:

p_config[in] 参考rott_config_t结构体

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_rott_start(void)

start rotate work

开始硬件加速

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_rott_int_enable(rott_int_type_e int_type, bool en)

This API used to config rotate int type and int enable.

参数:
  • int_type[in] int_type include:

           - ROTATE_COMPLETE_INT: rotate complete int
           - ROTATE_WARTERMARK_INT: if enable, wtmk_block need config, and not set 0, you can set wtmk_block by api bk_rott_wartermark_block_config config or rott_config
           - ROTATE_CFG_ERR_INT, the following will trigger cfg err int,like:
                            - picture_xpixel & picture_ypixel be zero while working.
                            - ROTATE_WARTERMARK_INT=1, but wtmk_block=0
                            - block_cnt=0
                            - block_xpixel > picture_xpixel,  block_ypixel > picture_ypixel
    

  • en[in] en enable or disable

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

int32_t drv_rott_int_cbk_register(rott_int_type_e int_type, pfunc_drv_rott_cb_t pfn_cb)

register intrrupt callback function

注册中断回调函数

参数:
  • int_type[in] - ROTATE_COMPLETE_INT = 1 << 0, rotate finish int enable

    • ROTATE_WARTERMARK_INT = 1 << 1, rotate watermark int enable

    • ROTATE_CFG_ERR_INT = 1 << 2, rotate config error int enable

  • pfn_cb[in] 回调函数

返回值:
  • 0 – success [BK_RET_OK]

  • other – fail

返回:

result

Structures

struct rott_config_t

Public Members

rott_mode_e rot_mode

bypass rotating, only use yuv2rgb565 pixel formart convert function

void *input_addr

input data addr

void *output_addr

output data addr

rott_pixel_format_e input_fmt

pixel format, output rgb565 always

rott_input_data_flow_e input_flow

input data convert or not

rott_output_data_flow_e output_flow

output data convert or not

uint16_t picture_xpixel

image width

uint16_t picture_ypixel

image height

uint16_t block_xpixel

the following is optional, but should make sure rott_driver.c’s TABLE_ROTT_BLOCK table is include used x/y pixel image width separated block width , must be devisible by picture_xpixel

uint16_t block_ypixel

image height separated block height, must be devisible by picture_ypixel

uint16_t block_cnt

block counts, must be (picture_xpixel/block_xpixel)*(picture_ypixel/block_ypixel) cnt

uint16_t watermark_blk

if enable watermark enable, you should config watermark_blk, normally defult one-half block cnt

Type Definitions

typedef void (*pfunc_drv_rott_cb_t)(void)

Enumerations

enum rott_int_type_e

Values:

enumerator ROTATE_COMPLETE_INT

rotate finish int enable

enumerator ROTATE_WARTERMARK_INT

rotate watermark int enable.

enumerator ROTATE_CFG_ERR_INT

rotate config error int enable

enum rott_mode_e

Values:

enumerator ROTT_MODE_UNKNOW
enumerator ROTT_ONLY_YUV2RGB565

bypass rotating, only use yuv2rgb565 pixel formart convert function

enumerator ROTT_ROTATE90
enumerator ROTT_ROTATE270
enum rott_input_data_flow_e

Values:

enumerator ROTT_INPUT_NORMAL

input data not flip

enumerator ROTT_INPUT_REVESE_BYTE_BY_BYTE

convert input data revese byte by byte.

enumerator ROTT_INPUT_REVESE_HALFWORD_BY_HALFWORD

convert input data revese halfword by halfword

enum rott_output_data_flow_e

Values:

enumerator ROTT_OUTPUT_NORMAL

output data not flip

enumerator ROTT_OUTPUT_REVESE_HALFWORD_BY_HALFWORD

convert output data reverse halfword by halfword

enum rott_pixel_format_e

rgb lcd input data format, data save in mem is little endian, like VUYY format is [bit31-bit0] is [V U Y Y]

Values:

enumerator PIXEL_FMT_UNKNOW
enumerator PIXEL_FMT_DVP_JPEG
enumerator PIXEL_FMT_DVP_H264
enumerator PIXEL_FMT_UVC_JPEG
enumerator PIXEL_FMT_UVC_H264
enumerator PIXEL_FMT_RGB565

input data format is rgb565(big endian), high pixel is bit[31-16], low pixel is bit[15-0] (PIXEL BIG ENDIAN)

enumerator PIXEL_FMT_RGB565_LE

input data format is rgb565(big endian), high pixel is bit[15-0], low pixel is bit[31-16] (PIXEL little ENDIAN)

enumerator PIXEL_FMT_YUYV

input data is yuyv format, diaplay module internal may convert to rgb565 data

enumerator PIXEL_FMT_UYVY
enumerator PIXEL_FMT_YYUV

input data is yyuv format

enumerator PIXEL_FMT_UVYY

input data is uvyy format

enumerator PIXEL_FMT_VUYY

input data is vuyy format