Skip to content

Commit

Permalink
sys: add interface for generic display device
Browse files Browse the repository at this point in the history
  • Loading branch information
aabadie committed Jan 16, 2020
1 parent 5ead5ff commit e3fb86e
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
1 change: 1 addition & 0 deletions makefiles/pseudomodules.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ PSEUDOMODULES += cortexm_fpu
PSEUDOMODULES += cpu_check_address
PSEUDOMODULES += devfs_%
PSEUDOMODULES += dhcpv6_%
PSEUDOMODULES += disp_dev
PSEUDOMODULES += ecc_%
PSEUDOMODULES += emb6_router
PSEUDOMODULES += event_%
Expand Down
62 changes: 62 additions & 0 deletions sys/include/disp_dev.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2019 Inria
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @defgroup sys_disp_dev Display device generic API
* @ingroup sys
* @brief Define the generic API of a display device
* @{
*
* @author Alexandre Abadie <alexandre.abadie@inria.fr>
*/

#ifndef DISP_DEV_H
#define DISP_DEV_H

#ifdef __cplusplus
extern "C" {
#endif

/**
* @brief Forward declaration for display device struct
*/
typedef struct disp_dev disp_dev_t;

/**
* @brief Generic type for a display driver
*/
typedef struct {
/**
* @brief Map an area to display on the device
*
* @param[in] dev Pointer to the display device
* @param[in] x1 Left coordinate
* @param[in] x2 Right coordinate
* @param[in] y1 Top coordinate
* @param[in] y2 Bottom coordinate
* @param[in] color Array of color to map to the display
*/
void (*map)(disp_dev_t *dev,
uint16_t x1, uint16_t x2,
uint16_t y1, uint16_t y2,
const uint16_t *color);
} disp_dev_driver_t;

/**
* @brief Generic type for a display device
*/
struct disp_dev {
const disp_dev_driver_t *driver; /**< Pointer to driver of the display device */
};

#ifdef __cplusplus
}
#endif

#endif /* DISP_DEV_H */
/** @} */

0 comments on commit e3fb86e

Please # to comment.