Add st7789 lcd driver

This commit is contained in:
Thomas Klaehn
2020-03-29 10:25:17 +02:00
parent 7a5a5930aa
commit 67a28afd24
9 changed files with 4815 additions and 16 deletions

View File

@@ -1,30 +1,33 @@
#include <string.h>
#include "app_util_platform.h"
#include "board.h"
#include "nrf_gpio.h"
#include "nrf_delay.h"
#include "boards.h"
#include "app_error.h"
#include <string.h>
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_log_default_backends.h"
#include "board.h"
#include "driver.h"
#include "delay.h"
const char buffer[] = "Hello world!\r\n";
int main(void)
{
unsigned int i = 0;
unsigned int cnt = 0;
APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
NRF_LOG_DEFAULT_BACKENDS_INIT();
drv_open(&led_1);
drv_write(&led_1, "1", 1);
drv_open(&spi_0);
drv_open(&lcd);
// APP_ERROR_CHECK(NRF_LOG_INIT(NULL));
// NRF_LOG_DEFAULT_BACKENDS_INIT();
// NRF_LOG_INFO("SPI example started.");
NRF_LOG_INFO("SPI example started.");
while(1) {
drv_write(&spi_0, buffer, sizeof(buffer));
// NRF_LOG_FLUSH();
char c = (i++ % 2) + 0x30;
char c = (cnt++ % 2) + 0x30;
drv_write(&led_1, &c, 1);
delay_ms(200);
NRF_LOG_FLUSH();
nrf_delay_ms(200);
}
}