bf0_hal_ezip.h

Header file of EZIP HAL module.

Author

Sifli software development team

Attention

Defines

HAL_EZIP_NON_CONT_MODE_SUPPORTED

Support EZIP Non-Continuous Addressing Mode

HAL_EZIP_MODE_DATA_TYPE_MASK

low 7bit indicates EZIP data type, EZIP, GZIP or LZ4

HAL_EZIP_MODE_ADDR_TYPE_MASK

bit7 indicates EZIP data addressing type

HAL_EZIP_MODE_ADDR_NON_CONT_TYPE

Non-Continuous Addressing Mode

HAL_EZIP_MODE_ADDR_CONT_TYPE

Continuous Data Addressing Mode

EZIP_PARA_OUT_EPIC
EZIP_PARA_OUT_AHB
EZIP_PARA_MOD_EZIP
EZIP_PARA_MOD_GZIP
EZIP_PARA_MOD_LZ4
EZIP_EZIPA_COLOR_GRAYSCALE

grayscale

EZIP_EZIPA_COLOR_RGB888

truecolor RGB888

EZIP_EZIPA_COLOR_INDEXCOLOR

index-color

EZIP_EZIPA_COLOR_GRAYSCALE_ALPHA

grayscale with alpha

EZIP_EZIPA_COLOR_ARGB8888

truecolor with alpha, ARGB8888

EZIP_EZIPA_COLOR_RGB565

RGB565

EZIP_EZIPA_COLOR_ARGB8565

ARGB8565

EZIP_EZIPA_DISPOSE_OP_NONE

The data in output buffer is left as is and used for next rendering

EZIP_EZIPA_DISPOSE_OP_BACKGROUND

The data in output buffer is cleared to fully transparent black before rendering the next frame

EZIP_EZIPA_DISPOSE_OP_PREVIOUS

The data in output buffer is reverted to the previous contents before rendering the next frame

EZIP_EZIPA_BLEND_OP_SOURCE

all color components of the frame, including alpha, overwrite the current contents of the frame’s output buffer region

EZIP_EZIPA_BLEND_OP_OVER

Update data in output buffer by blending based on its alpha value, using simple OVER operation as described in the “Alpha Channel Processing” section of the PNG specification [PNG-1.2]

Typedefs

typedef struct __FLASH_HandleTypeDef *(*EZIP_FlashHandleQueryCbTypeDef)(uint32_t addr)
typedef struct __EZIP_HandleTypeDef EZIP_HandleTypeDef

EZIP handle structure definition

Enums

enum HAL_EZIP_StateTypeDef

HAL EZIP State structures definition.

Values:

enumerator HAL_EZIP_STATE_RESET

EZIP not yet initialized or disabled

enumerator HAL_EZIP_STATE_READY

Peripheral Initialized and ready for use

enumerator HAL_EZIP_STATE_BUSY

An internal process is ongoing

enumerator HAL_EZIP_STATE_TIMEOUT

Timeout state

enumerator HAL_EZIP_STATE_ERROR

EZIP state error

enumerator HAL_EZIP_STATE_SUSPEND

EZIP process is suspended

enum EZIP_WorkModeTypeDef

EZIP Work Mode

Values:

enumerator HAL_EZIP_MODE_EZIP

EZIP continuous mode

enumerator HAL_EZIP_MODE_GZIP

GZIP mode

enumerator HAL_EZIP_MODE_LZ4

LZ4 mode

enumerator HAL_EZIP_MODE_DATA_TYPE_NUM
enumerator HAL_EZIP_MODE_EZIP_NON_CONT

EZIP non-continuous mode

enumerator HAL_EZIP_MODE_GZIP_NON_CONT

GZIP non-continuous mode

enumerator HAL_EZIP_MODE_LZ4_NON_CONT

LZ4 non-continuous mode

enum EZIP_OutputModeTypeDef

EZIP Output Mode

Values:

enumerator HAL_EZIP_OUTPUT_EPIC

output to EPIC

enumerator HAL_EZIP_OUTPUT_AHB

output to AHB bus

Functions

HAL_StatusTypeDef HAL_EZIP_Init(EZIP_HandleTypeDef *ezip)

EZIP Init.

参数:
  • ezip[in] EZIP handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_EZIP_IRQHandler(EZIP_HandleTypeDef *ezip)

EZIP IRQ Handler.

参数:
  • ezip – EZIP handle

返回值:

None

HAL_StatusTypeDef HAL_EZIP_Decode(EZIP_HandleTypeDef *ezip, EZIP_DecodeConfigTypeDef *config)

Start decoding in polling mode.

参数:
  • ezip[in] EZIP handle

  • config[in] decoding configuration

返回值:

HAL – status

HAL_StatusTypeDef HAL_EZIP_Decode_IT(EZIP_HandleTypeDef *ezip, EZIP_DecodeConfigTypeDef *config)

Start decoding in interrupt mode.

CpltCallback in handle is used to notify the completion

参数:
  • ezip[in] EZIP handle

  • config[in] decoding configuration

返回值:

HAL – status

HAL_StatusTypeDef HAL_EZIP_DeInit(EZIP_HandleTypeDef *ezip)

EZIP Deinit.

参数:
  • ezip[in] EZIP handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_EZIP_CheckReady(EZIP_HandleTypeDef *ezip)

Check if EZIP is idle.

参数:
  • ezip[in] EZIP handle

返回值:

HAL – status

HAL_StatusTypeDef HAL_EZIP_OpenEZIPA(EZIP_HandleTypeDef *ezip, uint8_t *data, EZIP_EZIPAHeaderTypeDef *header, EZIP_EZIPAFrameInfoTypeDef *frame)
HAL_StatusTypeDef HAL_EZIP_CloseEZIPA(EZIP_HandleTypeDef *ezip)
HAL_StatusTypeDef HAL_EZIP_GetNextFrameInfo(EZIP_HandleTypeDef *ezip, EZIP_EZIPAFrameInfoTypeDef *frame)
HAL_StatusTypeDef HAL_EZIP_SuspendEZIPA(EZIP_HandleTypeDef *ezip)
HAL_StatusTypeDef HAL_EZIP_ResumeEZIPA(EZIP_HandleTypeDef *ezip, const uint8_t *data, uint32_t seq_num, uint32_t play_loop_idx)
HAL_StatusTypeDef HAL_EZIP_DecodeFast_Init(EZIP_HandleTypeDef *hezip)
HAL_StatusTypeDef HAL_EZIP_DecodeFast_IT(EZIP_HandleTypeDef *hezip)
struct EZIP_BlockListTypeDef
#include <bf0_hal_ezip.h>

EZIP Block list type for non-continous mode.

Public Members

uint32_t base_addr

block base address

uint32_t block_size

block size in byte

uint32_t block_num

number of blocks

uint32_t block_offset[0]

block offset list, nor: base_addr+offset is absolute address nand: base_addr+offset*block_size is absolute address

struct EZIP_DecodeConfigTypeDef
#include <bf0_hal_ezip.h>

EZIP Decoding Configuration

Public Members

uint8_t *input

input data buffer, must be 32bit aligned, for non continuous work_mode, format is EZIP_BlockListTypeDef

uint8_t *output

output data buffer, must be 32bit aligned

used if output_mode is HAL_EZIP_OUTPUT_AHB

EZIP_WorkModeTypeDef work_mode

work mode

EZIP_OutputModeTypeDef output_mode

output mode

uint16_t start_x

topleft pixel x coordinate of the interested region

starting from 0

uint16_t start_y

topleft pixel y coordinate of the interested region

starting from 0

int16_t width

interested region width

set to -1 if all columns are needed

int16_t height

interested region height

set to -1 if all rows are needed

uint32_t input_data_size

ezip data size in bytes, only valid if data is saved in NAND

struct __EZIP_HandleTypeDef
#include <bf0_hal_ezip.h>

EZIP handle structure definition

Public Members

EZIP_TypeDef *Instance

EZIP register base address.

void (*CpltCallback)(struct __EZIP_HandleTypeDef *ezip)

EZIP processing complete callback.

HAL_EZIP_StateTypeDef State

EZIP state.

uint32_t ErrorCode

EZIP error code.

void *user_data

user_data

EZIP_FlashHandleQueryCbTypeDef flash_handle_query_cb

flash handle query callback

EZIP_TypeDef *RamInstance

EZIP register on RAM.

EZIP_TypeDef *HwInstance

Backup of EZIP register base address.

uint8_t RamInstance_used
uint32_t non_cont_block_start_addr

base address of the blocks, internal used valid if EZIP_NON_CONT_MODE is used

struct EZIP_EZIPAHeaderTypeDef
#include <bf0_hal_ezip.h>

EZIPA header

Public Members

uint32_t frame_num

number of frames

uint32_t play_num

loop number, 0 for infinite loop

uint32_t width

image width in pixel, i.e. width of output buffer

uint32_t height

image height in pixel, i.e. height of output buffer

uint8_t bit_depth
uint8_t color_type

color type, EZIPA Color type

struct EZIP_EZIPAFrameInfoTypeDef

Public Members

uint32_t seq_num

frame sequence number, starting from 0

uint16_t width

frame width, unit: pixel

uint16_t height

frame height, unit: pixel

uint16_t x_offset

x(column) position at which to render the current frame in output buffer, unit: pixel, starting from 0,

uint16_t y_offset

y(row) position at which to render the current frame in output buffer, unit: pixel, starting from 0, relative to the topleft

uint16_t delay_num

Frame delay fraction numerator

uint16_t delay_den

Frame delay fraction denominator, 0 means 100 frame_delay=delay_num/delay_den, unit is second

uint8_t dispose_op

disposal oparation type, EZIPA Dispose Op type, specify how the output buffer should be changed at the end of the delay (before rendering the next frame)

uint8_t blend_op

blending operation type, EZIPA Blend Op type specify whether the frame is to be alpha blended into the current output buffer content, or whether it should completely replace its region in the output buffer.