1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

tests/drivers/st77xx: read ID and status

This commit is contained in:
Gunar Schorcht 2023-09-22 10:22:16 +02:00
parent 8306838424
commit a73ff74b5a
2 changed files with 14 additions and 0 deletions

View File

@ -35,6 +35,7 @@ extern "C" {
*/
#define LCD_CMD_SWRESET 0x01 /**< Software reset */
#define LCD_CMD_RDDIDIF 0x04 /**< Read display ID */
#define LCD_CMD_RDDST 0x09 /**< Read display status */
#define LCD_CMD_SLPIN 0x10 /**< Enter sleep mode */
#define LCD_CMD_SLPOUT 0x11 /**< Sleep out */
#define LCD_CMD_NORON 0x13 /**< Normal display mode on */

View File

@ -25,6 +25,7 @@
#include "ztimer.h"
#include "board.h"
#include "lcd.h"
#include "lcd_internal.h"
#include "riot_logo.h"
@ -54,6 +55,18 @@ int main(void)
return 1;
}
#if MODULE_LCD_PARALLEL
if (gpio_is_valid(st77xx_params[0].rdx_pin)) {
uint8_t data[4];
lcd_read_cmd(&dev, LCD_CMD_RDDIDIF, data, 3);
printf("lcd ID: %02x %02x %02x\n", data[0], data[1], data[2]);
lcd_read_cmd(&dev, LCD_CMD_RDDST, data, 4);
printf("lcd status: %02x %02x %02x %02x\n", data[0], data[1], data[2], data[3]);
}
#endif
puts("lcd TFT display filling map");
lcd_fill(&dev, 0, dev.params->lines, 0, dev.params->rgb_channels, 0x0000);
puts("lcd TFT display map filled");