mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
drivers/ili9341: use ztimer instead of xtimer
This commit is contained in:
parent
a4dd3c0147
commit
bac1f8c82d
@ -12,7 +12,8 @@ config MODULE_ILI9341
|
||||
depends on TEST_KCONFIG
|
||||
select MODULE_PERIPH_SPI
|
||||
select MODULE_PERIPH_GPIO
|
||||
select MODULE_XTIMER
|
||||
select MODULE_ZTIMER
|
||||
select MODULE_ZTIMER_MSEC
|
||||
|
||||
menuconfig KCONFIG_USEMODULE_ILI9341
|
||||
bool "Configure ILI9341 driver"
|
||||
|
@ -1,3 +1,4 @@
|
||||
FEATURES_REQUIRED += periph_spi
|
||||
FEATURES_REQUIRED += periph_gpio
|
||||
USEMODULE += xtimer
|
||||
USEMODULE += ztimer
|
||||
USEMODULE += ztimer_msec
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include <string.h>
|
||||
#include "byteorder.h"
|
||||
#include "periph/spi.h"
|
||||
#include "xtimer.h"
|
||||
#include "ztimer.h"
|
||||
#include "kernel_defines.h"
|
||||
|
||||
#include "ili9341.h"
|
||||
@ -101,16 +101,16 @@ int ili9341_init(ili9341_t *dev, const ili9341_params_t *params)
|
||||
if (gpio_is_valid(dev->params->rst_pin)) {
|
||||
gpio_init(dev->params->rst_pin, GPIO_OUT);
|
||||
gpio_clear(dev->params->rst_pin);
|
||||
xtimer_msleep(120);
|
||||
ztimer_sleep(ZTIMER_MSEC, 120);
|
||||
gpio_set(dev->params->rst_pin);
|
||||
}
|
||||
xtimer_msleep(120);
|
||||
ztimer_sleep(ZTIMER_MSEC, 120);
|
||||
|
||||
/* Acquire once at release at the end */
|
||||
_ili9341_spi_acquire(dev);
|
||||
/* Soft Reset */
|
||||
_write_cmd(dev, ILI9341_CMD_SWRESET, NULL, 0);
|
||||
xtimer_msleep(120);
|
||||
ztimer_sleep(ZTIMER_MSEC, 120);
|
||||
|
||||
/* Display off */
|
||||
_write_cmd(dev, ILI9341_CMD_DISPOFF, NULL, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user