mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
drivers/lcd: add debug info to lcd_ll_write_cmd and lcd_ll_read_cmd
This commit is contained in:
parent
ad604fe6e2
commit
a12427fc4c
@ -429,6 +429,14 @@ void lcd_ll_release(lcd_t *dev)
|
|||||||
void lcd_ll_write_cmd(lcd_t *dev, uint8_t cmd, const uint8_t *data,
|
void lcd_ll_write_cmd(lcd_t *dev, uint8_t cmd, const uint8_t *data,
|
||||||
size_t len)
|
size_t len)
|
||||||
{
|
{
|
||||||
|
DEBUG("[%s] command 0x%02x (%u) ", __func__, cmd, len);
|
||||||
|
if (IS_USED(ENABLE_DEBUG) && len) {
|
||||||
|
for (uint8_t i = 0; i < len; i++) {
|
||||||
|
DEBUG("0x%02x ", data[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DEBUG("\n");
|
||||||
|
|
||||||
lcd_ll_cmd_start(dev, cmd, len ? true : false);
|
lcd_ll_cmd_start(dev, cmd, len ? true : false);
|
||||||
if (len) {
|
if (len) {
|
||||||
lcd_ll_write_bytes(dev, false, data, len);
|
lcd_ll_write_bytes(dev, false, data, len);
|
||||||
@ -443,6 +451,13 @@ void lcd_ll_read_cmd(lcd_t *dev, uint8_t cmd, uint8_t *data, size_t len)
|
|||||||
|
|
||||||
lcd_ll_cmd_start(dev, cmd, true);
|
lcd_ll_cmd_start(dev, cmd, true);
|
||||||
lcd_ll_read_bytes(dev, false, data, len);
|
lcd_ll_read_bytes(dev, false, data, len);
|
||||||
|
|
||||||
|
if (IS_USED(ENABLE_DEBUG) && len) {
|
||||||
|
for (uint8_t i = 0; i < len; i++) {
|
||||||
|
DEBUG("0x%02x ", data[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
DEBUG("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
int lcd_init(lcd_t *dev, const lcd_params_t *params)
|
int lcd_init(lcd_t *dev, const lcd_params_t *params)
|
||||||
|
Loading…
Reference in New Issue
Block a user