2021-04-27 12:29:25 +08:00
|
|
|
/**
|
|
|
|
* @file main.c
|
2021-06-20 12:25:46 +08:00
|
|
|
* @brief
|
|
|
|
*
|
2021-04-27 12:29:25 +08:00
|
|
|
* Copyright (c) 2021 Bouffalolab team
|
2021-06-20 12:25:46 +08:00
|
|
|
*
|
2021-04-27 12:29:25 +08:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2021-06-20 12:25:46 +08:00
|
|
|
*
|
2021-04-27 12:29:25 +08:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2021-06-20 12:25:46 +08:00
|
|
|
*
|
2021-04-27 12:29:25 +08:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2021-06-20 12:25:46 +08:00
|
|
|
*
|
2021-06-04 17:51:00 +08:00
|
|
|
* Note:
|
2021-06-20 12:25:46 +08:00
|
|
|
*
|
|
|
|
* This Case is currently based on BL706_AVB development board with ili9341 controller screen.
|
2021-06-04 17:51:00 +08:00
|
|
|
* If you use other hardware platforms, please modify the pin Settings by yourself
|
2021-06-20 12:25:46 +08:00
|
|
|
*
|
2021-06-04 17:51:00 +08:00
|
|
|
* Your should Short connect func1 and func2 jump cap on 706_AVB Board,and Plug the screen into the HD13 interface
|
|
|
|
* Then the hardware for lvgl case testing is available.
|
2021-06-20 12:25:46 +08:00
|
|
|
*
|
|
|
|
*
|
2021-06-04 17:51:00 +08:00
|
|
|
*/
|
2021-10-19 20:04:23 +08:00
|
|
|
#include "bflb_platform.h"
|
2021-04-27 12:29:25 +08:00
|
|
|
#include "hal_spi.h"
|
|
|
|
#include "hal_gpio.h"
|
|
|
|
#include "hal_dma.h"
|
2021-06-04 17:51:00 +08:00
|
|
|
|
|
|
|
#include "xpt2046.h"
|
|
|
|
#include "lv_port_disp.h"
|
|
|
|
#include "lv_port_indev.h"
|
2021-04-27 12:29:25 +08:00
|
|
|
#include "lvgl.h"
|
|
|
|
#include "lv_examples.h"
|
|
|
|
|
|
|
|
/* lvgl log cb */
|
|
|
|
void lv_log_print_g_cb(lv_log_level_t level, const char *path, uint32_t line, const char *name, const char *str)
|
|
|
|
{
|
2021-06-20 12:25:46 +08:00
|
|
|
switch (level) {
|
|
|
|
case LV_LOG_LEVEL_ERROR:
|
|
|
|
MSG("ERROR: ");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LV_LOG_LEVEL_WARN:
|
|
|
|
MSG("WARNING: ");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LV_LOG_LEVEL_INFO:
|
|
|
|
MSG("INFO: ");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case LV_LOG_LEVEL_TRACE:
|
|
|
|
MSG("TRACE: ");
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
break;
|
2021-06-04 17:51:00 +08:00
|
|
|
}
|
2021-06-20 12:25:46 +08:00
|
|
|
|
|
|
|
MSG("%s- ", name);
|
|
|
|
MSG(" %s\r\n,", str);
|
2021-04-27 12:29:25 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(void)
|
|
|
|
{
|
|
|
|
bflb_platform_init(0);
|
|
|
|
|
|
|
|
lv_log_register_print_cb(lv_log_print_g_cb);
|
2021-06-20 12:25:46 +08:00
|
|
|
|
2021-04-27 12:29:25 +08:00
|
|
|
lv_init();
|
|
|
|
lv_port_disp_init();
|
2021-06-04 17:51:00 +08:00
|
|
|
lv_port_indev_init();
|
2021-06-20 12:25:46 +08:00
|
|
|
|
2021-04-27 12:29:25 +08:00
|
|
|
lv_demo_benchmark();
|
|
|
|
|
2021-07-06 17:33:29 +08:00
|
|
|
BL_CASE_SUCCESS;
|
|
|
|
|
2021-06-20 12:25:46 +08:00
|
|
|
while (1) {
|
2021-04-27 12:29:25 +08:00
|
|
|
lv_task_handler();
|
2021-06-20 12:25:46 +08:00
|
|
|
}
|
2021-04-27 12:29:25 +08:00
|
|
|
}
|