mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/st77xx: add st7735 compatibility headers
If a board definition already used the ST7735 driver, `st7735*.h` header files and `ST7735_*` macros were used in the board definitions to define the default configuration parameter set. For backward compatibility these header files are kept and the `ST7735_*` macros are mapped to the `ST77XX_*` macros if they are defined.
This commit is contained in:
parent
b5a7101f5e
commit
1c2cce7c66
57
drivers/st77xx/include/st7735.h
Normal file
57
drivers/st77xx/include/st7735.h
Normal file
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Koen Zandberg
|
||||
* 2021 Francisco Molina
|
||||
* 2023 Gunar Schorcht
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#if !DOXYGEN /* hide from documentation */
|
||||
|
||||
/**
|
||||
* @defgroup drivers_st7735 ST7735 display driver head files for backward compatibility
|
||||
* @ingroup drivers_display
|
||||
*
|
||||
* @brief Header file for the ST7735 display controller for backward compatibility
|
||||
*
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
*
|
||||
* @author Koen Zandberg <koen@bergzand.net>
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
*
|
||||
* If a board definition already used the ST7735 driver, the `st7735.h`
|
||||
* header file and `ST7735_*` macros are used. This file is kept for
|
||||
* backward compatibility.
|
||||
*/
|
||||
|
||||
#ifndef ST7735_H
|
||||
#define ST7735_H
|
||||
|
||||
#include "lcd.h"
|
||||
#include "st77xx.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @name ST7735 display rotation modes
|
||||
* @{
|
||||
*/
|
||||
#define ST7735_ROTATION_VERT ST77XX_ROTATION_VERT /**< Vertical mode */
|
||||
#define ST7735_ROTATION_VERT_FLIP ST77XX_ROTATION_VERT_FLIP /**< Flipped vertical */
|
||||
#define ST7735_ROTATION_HORZ ST77XX_ROTATION_HORZ /**< Horizontal mode */
|
||||
#define ST7735_ROTATION_HORZ_FLIP ST77XX_ROTATION_HORZ_FLIP /**< Horizontal flipped */
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* ST7735_H */
|
||||
/** @} */
|
||||
#endif /* !DOXYGEN */
|
45
drivers/st77xx/include/st7735_params.h
Normal file
45
drivers/st77xx/include/st7735_params.h
Normal file
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Koen Zandberg <koen@bergzand.net>
|
||||
* 2021 Francisco Molina
|
||||
* 2023 Gunar Schorcht
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#if !DOXYGEN /* hide from documentation */
|
||||
/**
|
||||
* @ingroup drivers_st7735
|
||||
*
|
||||
* @{
|
||||
* @file
|
||||
* @brief Header file for ST7735 configuration for backward compatibility
|
||||
*
|
||||
* @author Koen Zandberg <koen@bergzand.net>
|
||||
* @author Francisco Molina <francois-xavier.molina@inria.fr>
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
*
|
||||
* If a board definition already used the ST7735 driver, the `st7735_params.h`
|
||||
* header file and `ST7735_*` macros are used. This file is kept for
|
||||
* backward compatibility.
|
||||
*/
|
||||
|
||||
#ifndef ST7735_PARAMS_H
|
||||
#define ST7735_PARAMS_H
|
||||
|
||||
#include "board.h"
|
||||
#include "lcd.h"
|
||||
#include "st7735.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ST7735_PARAMS_H */
|
||||
/** @} */
|
||||
#endif /* DOXYGEN */
|
@ -31,6 +31,65 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if !DOXYGEN /* hide from documentation */
|
||||
/**
|
||||
* @name Mapping of former ST7735 configuration parameters for backward compatibility
|
||||
*
|
||||
* If a board definition already used the ST7735 driver, `ST7735_*` macros were
|
||||
* used in the board definitions to define the default configuration parameter
|
||||
* set. For backward compatibility these symbols are mapped to the `ST77XX_*`
|
||||
* macros if they are defined.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#ifdef ST7735_PARAM_SPI
|
||||
#define ST77XX_PARAM_SPI ST7735_PARAM_SPI
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_SPI_CLK
|
||||
#define ST77XX_PARAM_SPI_CLK ST7735_PARAM_SPI_CLK
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_CS
|
||||
#define ST77XX_PARAM_CS ST7735_PARAM_CS
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_DCX
|
||||
#define ST77XX_PARAM_DCX ST7735_PARAM_DCX
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_RST
|
||||
#define ST77XX_PARAM_RST ST7735_PARAM_RST
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_SPI_MODE
|
||||
#define ST77XX_PARAM_SPI_MODE ST7735_PARAM_SPI_MODE
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_RGB
|
||||
#define ST77XX_PARAM_RGB ST7735_PARAM_RGB
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_INVERTED
|
||||
#define ST77XX_PARAM_INVERTED ST7735_PARAM_INVERTED
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_NUM_LINES
|
||||
#define ST77XX_PARAM_NUM_LINES ST7735_PARAM_NUM_LINES
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_RGB_CHANNELS
|
||||
#define ST77XX_PARAM_RGB_CHANNELS ST7735_PARAM_RGB_CHANNELS
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_ROTATION
|
||||
#define ST77XX_PARAM_ROTATION ST7735_PARAM_ROTATION
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_OFFSET_X
|
||||
#define ST77XX_PARAM_OFFSET_X ST7735_PARAM_OFFSET_X
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_OFFSET_Y
|
||||
#define ST77XX_PARAM_OFFSET_Y ST7735_PARAM_OFFSET_Y
|
||||
#endif
|
||||
#ifdef ST7735_PARAMS
|
||||
#define ST77XX_PARAMS ST7735_PARAMS
|
||||
#endif
|
||||
#ifdef ST7735_PARAM_SCREEN_IDS
|
||||
#define ST77XX_PARAM_SCREEN_IDS ST7735_PARAM_SCREEN_IDS
|
||||
#endif
|
||||
|
||||
#endif /* !DOXYGEN */
|
||||
|
||||
/**
|
||||
* @name Set default configuration parameters for the ST77xx
|
||||
* @{
|
||||
|
Loading…
Reference in New Issue
Block a user