2017-10-18 14:09:10 +02:00
|
|
|
/**
|
2019-02-10 11:06:47 +01:00
|
|
|
* @file lv_hal.h
|
2017-10-18 14:09:10 +02:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2019-02-10 11:06:47 +01:00
|
|
|
#ifndef LV_HAL_H
|
|
|
|
#define LV_HAL_H
|
2017-10-18 14:09:10 +02:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*********************
|
|
|
|
* INCLUDES
|
|
|
|
*********************/
|
|
|
|
#include "lv_hal_disp.h"
|
|
|
|
#include "lv_hal_indev.h"
|
2017-11-19 21:16:53 +01:00
|
|
|
#include "lv_hal_tick.h"
|
2017-10-18 14:09:10 +02:00
|
|
|
|
|
|
|
/*********************
|
|
|
|
* DEFINES
|
|
|
|
*********************/
|
2021-05-15 00:23:16 +02:00
|
|
|
/**
|
|
|
|
* Same as Android's DIP. (Different name is chosen to avoid mistype between LV_DPI and LV_DIP)
|
|
|
|
* 1 dip is 1 px on a 160 DPI screen
|
|
|
|
* 1 dip is 2 px on a 320 DPI screen
|
|
|
|
* https://stackoverflow.com/questions/2025282/what-is-the-difference-between-px-dip-dp-and-sp
|
|
|
|
*/
|
|
|
|
#define _LV_DPX_CALC(dpi, n) ((n) == 0 ? 0 :LV_MAX((( (dpi) * (n) + 80) / 160), 1)) /*+80 for rounding*/
|
|
|
|
#define LV_DPX(n) _LV_DPX_CALC(lv_disp_get_dpi(NULL), n)
|
2017-10-18 14:09:10 +02:00
|
|
|
|
|
|
|
/**********************
|
|
|
|
* TYPEDEFS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* GLOBAL PROTOTYPES
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
/**********************
|
|
|
|
* MACROS
|
|
|
|
**********************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
2021-03-15 02:03:27 +08:00
|
|
|
} /*extern "C"*/
|
2017-10-18 14:09:10 +02:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|