mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
19919: drivers/st77xx: introduce rotation defines r=benpicco a=gschorcht ### Contribution description The PR introduces counterclockwise rotations for the definition of parameter `ST77XX_PARAM_ROTATION`. It is more intuitive and universal to use `ST77XX_ROTATION_{0,90,180,270}` instead of `ST77XX_ROTATION_{ST77XX_ROTATION_{VERT,VERT_FLIP,HORZ,HORZ_FLIP}`, especially because the orientation of the display may vary with respect to the orientation of the board. ### Testing procedure `tests/drivers/st77xx` should still work, for example: ``` BOARD=adafruit-pybadge make -C tests/drivers/st77xx flash ``` ``` BOARD=esp32s3-usb-otg make -j8 -C tests/drivers/st77xx flash ``` ### Issues/PRs references 19931: boards: fix documentation for GD32V boards and doxygen 1.9.4 r=benpicco a=gschorcht ### Contribution description This PR fixes some small problems in documentation of `sipeed-longan-nano`, `sipeed-longan-nano-tft` and `seeedstudio-gd32` for doxygen 1.9.4 that is used on `doc.riot-os.org`. Doxygen version 1.9.4 doesn't like anymore - single double quotes as symbol for the inches unit in the text - line breaks in `[]()` to avoid exhausting the 100 characters per line. See https://doc.riot-os.org/group__boards__sipeed__longan__nano.html for example. Doxygen 1.9.1 which is part of `riot-docker` container didn't have theses problems 😟 ### Testing procedure Documentation should be fixed. ### Issues/PRs references 19935: boards/nucleo64: fix SPI Arduino mapping for most boards r=benpicco a=maribu ### Contribution description Before, the Arduino SPI mapping for all Nucleo-64 boards was incorrect. With this, the situation improves to the following: - [x] nucleo-f030r8 - [ ] nucleo-f070rb - No SPI buses provided. - [x] nucleo-f072rb - [x] nucleo-f091rc - [x] nucleo-f103rb - [ ] nucleo-f302r8 - No SPI bus at D11, D12, D13 provided - [x] nucleo-f303re - [x] nucleo-f334r8 - [x] nucleo-f401re - [x] nucleo-f410rb - [x] nucleo-f411re - [x] nucleo-f446re - [x] nucleo-g070rb - [x] nucleo-g071rb - [x] nucleo-g431rb - [x] nucleo-g474re - [x] nucleo-l053r8 - [x] nucleo-l073rz - [x] nucleo-l152re - No SPI bus at D11, D12, D13 provided - [x] nucleo-l452re - [x] nucleo-l476rg - [x] nucleo-wl55jc The remaining offenders still need to be fixed, but that is better done one PR at a time. ### Testing procedure - Check if the SPI device provided in the given `boards/<BOARD_NAME>/incude/periph_conf.h` is indeed `SPI_DEV(0)`, or in `periph_conf.h` the correct SPI dev is found - this should be fine for all boards above, except for the unchecked ones or: - run https://github.com/RIOT-OS/RIOT/pull/19932: The SPI test should pass now ### Issues/PRs references Bug found in https://github.com/RIOT-OS/RIOT/pull/19932#issuecomment-1726305437 Co-authored-by: Gunar Schorcht <gunar@schorcht.net> Co-authored-by: Marian Buschsieweke <marian.buschsieweke@posteo.net>
This commit is contained in:
commit
ec69cfde6f
@ -76,7 +76,7 @@ extern "C" {
|
||||
#define ST77XX_PARAM_RGB_CHANNELS (128U) /**< Number of screen rgb channel (height) */
|
||||
#define ST77XX_PARAM_RGB (1) /**< RGB configuration */
|
||||
#define ST77XX_PARAM_INVERTED (0) /**< Inversion configuration */
|
||||
#define ST77XX_PARAM_ROTATION (ST77XX_ROTATION_HORZ_FLIP) /**< Rotation mode */
|
||||
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_90 /**< Rotation mode */
|
||||
#define LCD_SCREEN_WIDTH (ST77XX_PARAM_NUM_LINES) /**< LCD screen width */
|
||||
#define LCD_SCREEN_HEIGHT (ST77XX_PARAM_RGB_CHANNELS) /**< LCD screen height */
|
||||
/** @} */
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include "periph/gpio.h"
|
||||
#include "periph/adc.h"
|
||||
#include "periph_conf.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@ -43,7 +44,9 @@ extern "C" {
|
||||
/**
|
||||
* @brief SPI_DEV(1) is connected to D11/D12/D13
|
||||
*/
|
||||
#define ARDUINO_SPI_D11D12D13 SPI_DEV(1)
|
||||
#if !defined(ARDUINO_SPI_D11D12D13) && defined(SPI_NUMOF)
|
||||
#define ARDUINO_SPI_D11D12D13 SPI_DEV(0)
|
||||
#endif
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
@ -99,7 +99,7 @@
|
||||
#define ST77XX_PARAM_INVERTED 1 /**< Inverted mode enable */
|
||||
#define ST77XX_PARAM_NUM_LINES 240U /**< Number of lines */
|
||||
#define ST77XX_PARAM_RGB_CHANNELS 135U /**< Number of columns */
|
||||
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_HORZ /**< Rotation */
|
||||
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_270 /**< Rotation */
|
||||
#define ST77XX_PARAM_OFFSET_X 40 /**< X offset */
|
||||
#define ST77XX_PARAM_OFFSET_Y 52 /**< Y offset */
|
||||
#endif
|
||||
|
@ -159,7 +159,7 @@
|
||||
#define ST77XX_PARAM_RST LCD_RST
|
||||
#define ST77XX_PARAM_NUM_LINES 240
|
||||
#define ST77XX_PARAM_RGB_CHANNELS 240
|
||||
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_VERT
|
||||
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_0
|
||||
#define ST77XX_PARAM_INVERTED 1
|
||||
#define ST77XX_PARAM_RGB 1
|
||||
|
||||
|
@ -7,8 +7,7 @@
|
||||
|
||||
## Overview
|
||||
|
||||
The [Seedstudio GD32 RISC-V Dev Board]
|
||||
(https://wiki.seeedstudio.com/SeeedStudio-GD32-RISC-V-Dev-Board/) is a
|
||||
The [Seedstudio GD32 RISC-V Dev Board](https://wiki.seeedstudio.com/SeeedStudio-GD32-RISC-V-Dev-Board/) is a
|
||||
development board for the GigaDevice GD32VF103VBT6 MCU with the following
|
||||
on-board components:
|
||||
|
||||
@ -147,11 +146,10 @@ All other pins are either not broken out or have no special usage.
|
||||
|
||||
## Flashing the Device
|
||||
|
||||
The board is flashed via a JTAG interface with OpenOCD (at least [release version 0.12.0]
|
||||
(https://github.com/openocd-org/openocd/tree/9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c)).
|
||||
The board is flashed via a JTAG interface with OpenOCD (at least
|
||||
[release version 0.12.0](https://github.com/openocd-org/openocd/tree/9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c)).
|
||||
By default, an FTDI adapter according to the configuration defined in
|
||||
[`interface/openocd-usb.cfg`]
|
||||
(https://github.com/openocd-org/openocd/blob/9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c/tcl/interface/ftdi/openocd-usb.cfg)
|
||||
[`interface/openocd-usb.cfg`](https://github.com/openocd-org/openocd/blob/9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c/tcl/interface/ftdi/openocd-usb.cfg)
|
||||
is assumed.
|
||||
```
|
||||
BOARD=seeedstudio-gd32 make -C examples/hello-world flash
|
||||
|
@ -12,7 +12,7 @@ that is equipped with a TFT display with the following on-board components:
|
||||
- USB Type C
|
||||
- TF card slot
|
||||
- 3 user LEDs
|
||||
- 0.96" TFT display 160 x 80 pixel
|
||||
- 0.96 inches TFT display 160 x 80 pixel
|
||||
|
||||
@image html "https://media-cdn.seeedstudio.com/media/catalog/product/cache/7f7f32ef807b8c2c2215b49801c56084/1/1/114992425_1.jpg" "Sipeed Longan Nano" width=600
|
||||
|
||||
|
@ -16,11 +16,11 @@ on-board components:
|
||||
- USB Type C
|
||||
- TF card slot
|
||||
- 3 user LEDs
|
||||
- 0.96" TFT display 160 x 80 pixel (optional)
|
||||
- 0.96 inches TFT display 160 x 80 pixel (optional)
|
||||
|
||||
@image html "https://media-cdn.seeedstudio.com/media/catalog/product/cache/7f7f32ef807b8c2c2215b49801c56084/1/1/114992425_1.jpg" "Sipeed Longan Nano" width=600
|
||||
@image html "https://wiki.sipeed.com/hardware/assets/Longan/nano/Longan_nano.124.jpg" "Sipeed Longan Nano" width=600
|
||||
|
||||
## Hardware:
|
||||
## Hardware
|
||||
|
||||
| MCU | GD32VF103CBT6 | Supported |
|
||||
|:----------- |:-------------------------------------- | --------- |
|
||||
@ -173,11 +173,10 @@ BOARD=sipeed-longan-nano-tft make -C examples/hello-world flash
|
||||
|
||||
### Using an external debug adapter
|
||||
|
||||
The board can also be flashed via a JTAG interface with OpenOCD (at least [release version 0.12.0]
|
||||
(https://github.com/openocd-org/openocd/tree/9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c)).
|
||||
The board can also be flashed via a JTAG interface with OpenOCD (at least
|
||||
[release version 0.12.0](https://github.com/openocd-org/openocd/tree/9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c)).
|
||||
By default, an FTDI adapter according to the configuration defined in
|
||||
[`interface/openocd-usb.cfg`]
|
||||
(https://github.com/openocd-org/openocd/blob/9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c/tcl/interface/ftdi/openocd-usb.cfg)
|
||||
[`interface/openocd-usb.cfg`](https://github.com/openocd-org/openocd/blob/9ea7f3d647c8ecf6b0f1424002dfc3f4504a162c/tcl/interface/ftdi/openocd-usb.cfg)
|
||||
is assumed.
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
PROGRAMMER=openocd BOARD=sipeed-longan-nano make -C examples/hello-world flash
|
||||
|
@ -81,7 +81,7 @@ extern "C" {
|
||||
#define ST77XX_PARAM_INVERTED 1 /**< Inverted mode enable */
|
||||
#define ST77XX_PARAM_NUM_LINES 160U /**< Number of lines */
|
||||
#define ST77XX_PARAM_RGB_CHANNELS 80U /**< Number of columns */
|
||||
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_HORZ /**< Rotation mode */
|
||||
#define ST77XX_PARAM_ROTATION ST77XX_ROTATION_270 /**< Rotation mode */
|
||||
#define ST77XX_PARAM_OFFSET_Y 25 /**< Vertical offset */
|
||||
#endif
|
||||
|
||||
|
@ -322,6 +322,34 @@ extern "C" {
|
||||
|
||||
/**
|
||||
* @name ST77xx display rotation modes
|
||||
*
|
||||
* @note Using a rotation mode may require the definition of
|
||||
* @ref ST77XX_PARAM_OFFSET_X or @ref ST77XX_PARAM_OFFSET_Y.
|
||||
*
|
||||
* Usually the dimension of an LCD is defined by W x H (width x height) in
|
||||
* pixels, where width is the smaller dimension than height, e.g. 240 x 320
|
||||
* (W x H). The height is then used as parameter @ref ST77XX_PARAM_NUM_LINES
|
||||
* and the width as parameter @ref ST77XX_PARAM_RGB_CHANNELS. So vertical
|
||||
* orientation means no rotation. Vertical orientation is given when the
|
||||
* connector is shown at the bottom of the display.
|
||||
*
|
||||
* For example, the ST7789 controller supports 320 gate outputs and 240 source
|
||||
* outputs (RGB channels). A display with a size of 240 x 320 (W x H) pixels
|
||||
* can be used by setting `ST77XX_PARAM_NUM_LINES=320` and
|
||||
* `ST77XX_PARAM_RGB_CHANNELS=240`.
|
||||
*
|
||||
* However, if the ST7789 is used with a display of 240 x 240 (W x H) pixels
|
||||
* and a rotation is used, an offset must be defined for X or Y because the
|
||||
* origin of the image will change. For example, in the case of
|
||||
* @ref ST77XX_ROTATION_90 an offset for X would have to be defined by
|
||||
* `ST77XX_PARAM_OFFSET_X=80` and in the case of @ref ST77XX_ROTATION_180
|
||||
* an offset for Y would have to be defined by `ST77XX_PARAM_OFFSET_X=80`.
|
||||
*
|
||||
* Using the correct offset on rotation can be even more difficult if the
|
||||
* display size in both dimensions is smaller than the size supported by
|
||||
* the controller. In this case, the origin can deviate from 0, 0 even
|
||||
* without rotation.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
#define ST77XX_ROTATION_VERT 0 /**< Vertical mode */
|
||||
@ -331,6 +359,14 @@ extern "C" {
|
||||
LCD_MADCTL_MX /**< Horizontal mode */
|
||||
#define ST77XX_ROTATION_HORZ_FLIP LCD_MADCTL_MV | \
|
||||
LCD_MADCTL_MY /**< Horizontal flipped */
|
||||
|
||||
#define ST77XX_ROTATION_0 0 /**< 0 deg counterclockwise */
|
||||
#define ST77XX_ROTATION_90 LCD_MADCTL_MV | \
|
||||
LCD_MADCTL_MY /**< 90 deg counterclockwise */
|
||||
#define ST77XX_ROTATION_180 LCD_MADCTL_MX | \
|
||||
LCD_MADCTL_MY /**< 180 deg counterclockwise */
|
||||
#define ST77XX_ROTATION_270 LCD_MADCTL_MV | \
|
||||
LCD_MADCTL_MX /**< 270 deg counterclockwise */
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user