HPM SDK
HPMicro Software Development Kit
hpm_panel.h File Reference
#include <stdint.h>
#include <string.h>
#include <stdbool.h>

Go to the source code of this file.

Data Structures

struct  hpm_panel_timing
 
struct  hpm_panel_hw_interface
 
struct  hpm_panel_funcs
 
struct  hpm_panel_state
 
struct  hpm_panel
 

Typedefs

typedef struct hpm_panel hpm_panel_t
 
typedef struct hpm_panel_timing hpm_panel_timing_t
 
typedef enum hpm_panel_mipi_format hpm_panel_mipi_format
 
typedef struct hpm_panel_hw_interface hpm_panel_hw_interface_t
 
typedef struct hpm_panel_funcs hpm_panel_funcs_t
 
typedef enum hpm_panel_if_type hpm_panel_if_type_t
 
typedef enum hpm_panel_mem_type hpm_panel_mem_type_t
 
typedef enum hpm_panel_state_power hpm_panel_power_state_t
 
typedef struct hpm_panel_state hpm_panel_state_t
 

Enumerations

enum  hpm_panel_mipi_format { HPM_PANEL_MIPI_FORMAT_RGB888 , HPM_PANEL_MIPI_FORMAT_RGB666 , HPM_PANEL_MIPI_FORMAT_RGB666_PACKED , HPM_PANEL_MIPI_FORMAT_RGB565 }
 
enum  hpm_panel_if_type { HPM_PANEL_IF_TYPE_RGB , HPM_PANEL_IF_TYPE_LVDS_SINGLE , HPM_PANEL_IF_TYPE_LVDS_SPLIT , HPM_PANEL_IF_TYPE_MIPI }
 
enum  hpm_panel_mem_type { HPM_PANEL_MEM_TYPE_NONCACHEABLE = 0 , HPM_PANEL_MEM_TYPE_CACHEABLE , HPM_PANEL_MEM_TYPE_MAX , HPM_PANEL_MEM_TYPE_UNKNOWN }
 
enum  hpm_panel_state_power { HPM_PANEL_STATE_POWER_OFF , HPM_PANEL_STATE_POWER_ON }
 

Functions

hpm_panel_thpm_panel_find_device_default (void)
 Find default panel. More...
 
hpm_panel_thpm_panel_find_device (const char *name)
 Find panel for name. More...
 
const char * hpm_panel_get_name (hpm_panel_t *panel)
 Get panel name. More...
 
const hpm_panel_timing_thpm_panel_get_timing (hpm_panel_t *panel)
 Get panel timing. More...
 
hpm_panel_if_type_t hpm_panel_get_if_type (hpm_panel_t *panel)
 Get panel interface type. More...
 
void hpm_panel_register_interface (hpm_panel_t *panel, hpm_panel_hw_interface_t *hw_if)
 Register platform level hardware interface. More...
 
void hpm_panel_reset (hpm_panel_t *panel)
 Reset the panel. More...
 
void hpm_panel_init (hpm_panel_t *panel)
 Initialize the panel. More...
 
void hpm_panel_power_on (hpm_panel_t *panel)
 Power on the panel. More...
 
void hpm_panel_power_off (hpm_panel_t *panel)
 Power off the panel. More...
 
void hpm_panel_set_backlight (hpm_panel_t *panel, uint16_t percent)
 Set backlight value. More...
 
uint8_t hpm_panel_get_backlight (hpm_panel_t *panel)
 Get backlight value. More...
 
void hpm_panel_delay_ms (uint32_t ms)
 Delay specified milliseconds. More...
 
void hpm_panel_delay_us (uint32_t us)
 Delay specified microseconds. More...
 
void * hpm_panel_memory_alloc (hpm_panel_mem_type_t type, uint32_t size)
 Allocate panel memory of a specified type. More...
 
void hpm_panel_memory_free (void *addr)
 Free panel memory. More...
 
hpm_panel_mem_type_t hpm_panel_memory_get_type (void *addr)
 Get panel memory type. More...
 
int hpm_panel_memory_register (hpm_panel_mem_type_t type, void *addr, uint32_t size)
 Register panel memory block to panel subsystem. More...
 

Typedef Documentation

◆ hpm_panel_funcs_t

◆ hpm_panel_hw_interface_t

◆ hpm_panel_if_type_t

◆ hpm_panel_mem_type_t

◆ hpm_panel_mipi_format

◆ hpm_panel_power_state_t

◆ hpm_panel_state_t

◆ hpm_panel_t

typedef struct hpm_panel hpm_panel_t

◆ hpm_panel_timing_t

Enumeration Type Documentation

◆ hpm_panel_if_type

Enumerator
HPM_PANEL_IF_TYPE_RGB 
HPM_PANEL_IF_TYPE_LVDS_SINGLE 
HPM_PANEL_IF_TYPE_LVDS_SPLIT 
HPM_PANEL_IF_TYPE_MIPI 

◆ hpm_panel_mem_type

Enumerator
HPM_PANEL_MEM_TYPE_NONCACHEABLE 
HPM_PANEL_MEM_TYPE_CACHEABLE 
HPM_PANEL_MEM_TYPE_MAX 
HPM_PANEL_MEM_TYPE_UNKNOWN 

◆ hpm_panel_mipi_format

Enumerator
HPM_PANEL_MIPI_FORMAT_RGB888 
HPM_PANEL_MIPI_FORMAT_RGB666 
HPM_PANEL_MIPI_FORMAT_RGB666_PACKED 
HPM_PANEL_MIPI_FORMAT_RGB565 

◆ hpm_panel_state_power

Enumerator
HPM_PANEL_STATE_POWER_OFF 
HPM_PANEL_STATE_POWER_ON 

Function Documentation

◆ hpm_panel_delay_ms()

void hpm_panel_delay_ms ( uint32_t  ms)

Delay specified milliseconds.

Parameters
[in]msexpected delay interval in milliseconds

◆ hpm_panel_delay_us()

void hpm_panel_delay_us ( uint32_t  us)

Delay specified microseconds.

Parameters
[in]usexpected delay interval in microseconds

◆ hpm_panel_find_device()

hpm_panel_t* hpm_panel_find_device ( const char *  name)

Find panel for name.

Parameters
[in]nameof panel
Returns
pointer of panel instance

◆ hpm_panel_find_device_default()

hpm_panel_t* hpm_panel_find_device_default ( void  )

Find default panel.

Returns
pointer of panel instance

◆ hpm_panel_get_backlight()

uint8_t hpm_panel_get_backlight ( hpm_panel_t panel)

Get backlight value.

Parameters
[in]panelpointer of panel instance
Returns
percent of backlight [0 - 100]

◆ hpm_panel_get_if_type()

hpm_panel_if_type_t hpm_panel_get_if_type ( hpm_panel_t panel)

Get panel interface type.

Parameters
[in]panelpointer of panel instance
Returns
panel interface type hpm_panel_if_type_t

◆ hpm_panel_get_name()

const char* hpm_panel_get_name ( hpm_panel_t panel)

Get panel name.

Parameters
panelpointer of panel instance
Returns
panel name

◆ hpm_panel_get_timing()

const hpm_panel_timing_t* hpm_panel_get_timing ( hpm_panel_t panel)

Get panel timing.

Parameters
panelpointer of panel instance
Returns
pointer of timing

◆ hpm_panel_init()

void hpm_panel_init ( hpm_panel_t panel)

Initialize the panel.

Parameters
[in]panelpointer of panel instance

◆ hpm_panel_memory_alloc()

void* hpm_panel_memory_alloc ( hpm_panel_mem_type_t  type,
uint32_t  size 
)

Allocate panel memory of a specified type.

Parameters
[in]typememory type
[in]sizememory size

◆ hpm_panel_memory_free()

void hpm_panel_memory_free ( void *  addr)

Free panel memory.

Parameters
[in]addrmemory address

◆ hpm_panel_memory_get_type()

hpm_panel_mem_type_t hpm_panel_memory_get_type ( void *  addr)

Get panel memory type.

Parameters
[in]addrmemory address
Returns
memory type

◆ hpm_panel_memory_register()

int hpm_panel_memory_register ( hpm_panel_mem_type_t  type,
void *  addr,
uint32_t  size 
)

Register panel memory block to panel subsystem.

Parameters
[in]typememory block type
[in]addrmemory block address
[in]sizememory block size
Returns
0: success, other: failed

◆ hpm_panel_power_off()

void hpm_panel_power_off ( hpm_panel_t panel)

Power off the panel.

Parameters
[in]panelpointer of panel instance

◆ hpm_panel_power_on()

void hpm_panel_power_on ( hpm_panel_t panel)

Power on the panel.

Parameters
[in]panelpointer of panel instance

◆ hpm_panel_register_interface()

void hpm_panel_register_interface ( hpm_panel_t panel,
hpm_panel_hw_interface_t hw_if 
)

Register platform level hardware interface.

Parameters
[in]panelpointer of panel instance
[in]hw_ifpointer of hardware interface

◆ hpm_panel_reset()

void hpm_panel_reset ( hpm_panel_t panel)

Reset the panel.

Parameters
[in]panelpointer of panel instance

◆ hpm_panel_set_backlight()

void hpm_panel_set_backlight ( hpm_panel_t panel,
uint16_t  percent 
)

Set backlight value.

Parameters
[in]panelpointer of panel instance
[in]percentpercent of backlight [0 - 100]