mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-11-22 15:38:11 +00:00
embed: introduce display_identify
This commit is contained in:
parent
10396777b8
commit
f4252d755c
2
Makefile
2
Makefile
@ -93,6 +93,8 @@ cstyle: ## run code style check on low-level C code
|
|||||||
|
|
||||||
build: build_boardloader build_bootloader build_firmware build_prodtest build_unix ## build all
|
build: build_boardloader build_bootloader build_firmware build_prodtest build_unix ## build all
|
||||||
|
|
||||||
|
build_embed: build_boardloader build_bootloader build_firmware # build boardloader, bootloader, firmware
|
||||||
|
|
||||||
build_boardloader: ## build boardloader
|
build_boardloader: ## build boardloader
|
||||||
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" $(BOARDLOADER_BUILD_DIR)/boardloader.bin
|
$(SCONS) CFLAGS="$(CFLAGS)" PRODUCTION="$(PRODUCTION)" $(BOARDLOADER_BUILD_DIR)/boardloader.bin
|
||||||
|
|
||||||
|
@ -32,11 +32,26 @@
|
|||||||
#define DISPLAY_MEMORY_PIN 16
|
#define DISPLAY_MEMORY_PIN 16
|
||||||
|
|
||||||
#define CMD(X) (*((__IO uint8_t *)((uint32_t)(DISPLAY_MEMORY_BASE))) = (X))
|
#define CMD(X) (*((__IO uint8_t *)((uint32_t)(DISPLAY_MEMORY_BASE))) = (X))
|
||||||
#define DATA(X) (*((__IO uint8_t *)((uint32_t)(DISPLAY_MEMORY_BASE | (1 << DISPLAY_MEMORY_PIN)))) = (X))
|
#define ADDR (*((__IO uint8_t *)((uint32_t)(DISPLAY_MEMORY_BASE | (1 << DISPLAY_MEMORY_PIN)))))
|
||||||
|
#define DATA(X) (ADDR) = (X)
|
||||||
#define PIXELDATA(X) DATA((X) >> 8); DATA((X) & 0xFF)
|
#define PIXELDATA(X) DATA((X) >> 8); DATA((X) & 0xFF)
|
||||||
|
|
||||||
#define LED_PWM_TIM_PERIOD (10000)
|
#define LED_PWM_TIM_PERIOD (10000)
|
||||||
|
|
||||||
|
static uint32_t __attribute__((unused)) display_identify(void)
|
||||||
|
{
|
||||||
|
uint8_t c;
|
||||||
|
uint32_t id = 0;
|
||||||
|
|
||||||
|
CMD(0x04); // RDDID: Read Display ID
|
||||||
|
c = ADDR; id |= (c << 24);
|
||||||
|
c = ADDR; id |= (c << 16);
|
||||||
|
c = ADDR; id |= (c << 8);
|
||||||
|
c = ADDR; id |= c;
|
||||||
|
|
||||||
|
return id;
|
||||||
|
}
|
||||||
|
|
||||||
static void __attribute__((unused)) display_sleep(void)
|
static void __attribute__((unused)) display_sleep(void)
|
||||||
{
|
{
|
||||||
#if DISPLAY_ILI9341V || DISPLAY_ST7789V
|
#if DISPLAY_ILI9341V || DISPLAY_ST7789V
|
||||||
|
Loading…
Reference in New Issue
Block a user