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:
parent
8306838424
commit
a73ff74b5a
@ -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 */
|
||||
|
@ -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");
|
||||
|
Loading…
Reference in New Issue
Block a user