46 lines
975 B
C
46 lines
975 B
C
/* FreeRTOS */
|
|
#include "FreeRTOS.h"
|
|
#include "task.h"
|
|
|
|
/* SDK drivers */
|
|
#include "fsl_lpspi.h"
|
|
|
|
/* Board */
|
|
#include "board.h"
|
|
#include "clock_config.h"
|
|
#include "peripherals.h"
|
|
#include "pin_mux.h"
|
|
|
|
/* LCD */
|
|
#include "app_impl_lcd.h"
|
|
|
|
int app_lcd_impl_init(void *handle) {
|
|
CLOCK_EnableClock(kCLOCK_Lpspi4);
|
|
|
|
lpspi_master_config_t spi_cfg;
|
|
LPSPI_MasterGetDefaultConfig(&spi_cfg);
|
|
|
|
spi_cfg.baudRate = 24000000UL;
|
|
|
|
LPSPI_MasterInit(LPSPI4, &spi_cfg, CLOCK_GetClockRootFreq(kCLOCK_LpspiClkRoot));
|
|
|
|
return 0;
|
|
}
|
|
|
|
epd_ret_t app_lcd_impl_write_command(void *handle, uint8_t *command, uint32_t len) {
|
|
/* 02 - 00 - CMD - 00 - DATA0 - ... - DATAN */
|
|
|
|
return EPD_OK;
|
|
}
|
|
|
|
epd_ret_t app_lcd_impl_write_data(void *handle, const uint8_t *data, uint32_t len) {
|
|
/* 02 - 00 - CMD(2C) - 00 - DATA0 - ... - DATAN */
|
|
|
|
return EPD_OK;
|
|
}
|
|
|
|
epd_ret_t app_lcd_impl_delay(void *handle, uint32_t msec) {
|
|
vTaskDelay(pdMS_TO_TICKS(msec));
|
|
|
|
return EPD_OK;
|
|
} |