- 2024-09-28
-
回复了主题帖:
《智能驾驶之激光雷达算法详解》3.基于3D激光点云的目标检测
Jacktang 发表于 2024-9-28 07:48
3D点云的目标检测感觉好难,主要还是算法
是的 数学基础很重要啊
- 2024-09-27
-
发表了主题帖:
《智能驾驶之激光雷达算法详解》3.基于3D激光点云的目标检测
基于激光雷达3D点云的目标检测、多目标跟踪等算法是利用深度学习相关算法进行解决相应问题的,本书的第七章对深度学习进行了基础的讲解,主要是人工神经网络、卷积神经网络、ViT模型等进行了介绍,对于我这种深度学习小白来说,无疑撬开了我对深度学习相关基础的认知,。
激光点云的3D目标检测通常是指在点云中识别车辆、行人等目标,并给出其尺寸、位置和朝向等信息。雷达目标检测的分类方法如下所示:
本书介绍的常用的具有代表性的3D目标检测算法有MLP架构的PointNET网络算法、PointNET++网络算法、PointRCNN网络算法、基于体素的VoxelNet网络算法、PointPillars网络算法、基于深度图的RangeDet网络算法、多视角特征融合的MVF网络算法等。
每种算法有各自的优势和不足,例如: PointRCNN网络是将基于原始点云进行特征提取的方式嵌入二阶段检测架构的一次成功尝试,且该网络模型背后的将车辆位置和朝向问题等效为“分类+回归”问题的思想也被后续许多算法借鉴。但是该网络模型的流程相对比较复杂,在KITTI数据集中,该网络模型对每帧点云进行推理的耗时为0.1秒左右,较难达到实时性要求。
VoxelNet网络结构清晰,且检测性能也有较大提升,然而,由于其引入了3D卷积,VoxelNet 网络模型的推理速度较慢,很难满足智能驾驶感知模块的实时性要求。而PointPillars网络却有较好的实时性和检测性能。
总之,通过对个网络算法的公式、原理推导和图形化说明,让我对这些深度学习网络算法及在3D激光点云的应用有了了解和认识。
-
发表了主题帖:
《智能驾驶之激光雷达算法详解》2.外参标定
本书的第三章、第四章是对标定算法的讲解,第三章着重讲解了激光雷达相对于车体的外参标定算法,将激光雷达外参算法初步分为了三类,①基于道路、标定物特征的雷达动态外参标定。②基于手眼模型的雷达外参标定③基于积累点云特征化的雷达外参标定算法。本章对分别这三个方向选取了比较有代表性的算法分析,如SSAC算法、使用Navy算法求解手眼模型、AESC-MMS算法、DyLESC算法等,让我了解了各算法的原理、概念、流程、公式推导。
第四章是基于激光雷达和相机数据相互融合的外参标定算法的讲解,基于激光雷达数据和相机视觉数据的强互补性进行精确的外参标定,3D雷达和2D相机之间的外参标定分类如下
本章分析的具有代表性的算法分别时基于标定物的L-C静态标定-ILCC算法、无标定物的L-C静态标定-PESC算法、无标定物的L-C动态在线标定-AOCCL算法。总的来说,静态、有标定物的离线标定方法通常可在高精度的标定件中使用;而动态、无标定物的在线标定方法可在自然驾驶场景中使用,并根据离线标定的结果、车辆运动等信息, 实现对离线标定结果的全部参数或部分参数的修正。
- 2024-08-30
-
发表了主题帖:
《智能驾驶之激光雷达算法详解》1.全书质量和目录简要评价
首先非常荣幸能够参与《智能驾驶之激光雷达算法详解》这本书的阅读体验,收到书后第一感觉是本书的分量很足,本书全书均为彩印纸质,文字与图案印刷得极为精细,墨迹均匀饱满,即便是细小的文字也能清晰可辨,阅读体验极佳。
阅读本书目录可知,前两章是激光雷达的基础介绍和空间变换数学基础,三四章是激光雷达的标定讲解,五六章是3D激光点云分割算法讲解,第七章是关于深度学习算法的基础内容,接下面的几章是关于基于3D激光点云的目标检测、路沿检测、多目标跟踪的算法内容,最后几章是干预激光里程计、激光雷达IMU组合定位、SLAM等算法的讲解。从目录的编排和标题的提炼来看,本书层次结构清晰,每章都围绕本章主题讲解了很多相关算法。
每章末尾都有详细的参考文献,更值得一提的是部分算法直接给出了算法源码地址,我们可以对感兴趣的算法直接进行下载学习,能够大大节省读者查找资料的时间。
激光雷达作为现代感知技术的重要组成部分,其算法的发展不仅推动了自动驾驶、机器人导航、三维重建等多个领域的进步,也为我们理解世界提供了新的视角和工具,希望通过接下来的阅读让我对激光雷达算法在智能驾驶方面的应用中有个充分的学习和了解。
- 2024-08-15
-
发表了主题帖:
【瑞萨RA8D1开发板,基于M85内核的图形MCU测评】5.基于LVGL实现PWM占空比,控制电机等
上次已经完成LVGL9.1的移植,本次实现基于LVGL库的电机PWM调制。
本次实验使用LVGL的slider控件,实现比较简单,基于官方例程的仿真效果如下图所示
关键代码如下
static lv_obj_t * label;
static void slider_event_cb(lv_event_t * e)
{
lv_obj_t * slider = lv_event_get_target(e);
/*Refresh the text*/
lv_label_set_text_fmt(label, "%"LV_PRId32, lv_slider_get_value(slider));
lv_obj_align_to(label, slider, LV_ALIGN_OUT_TOP_MID, 0, -15); /*Align top of the slider*/
}
/**
* Create a slider and write its value on a label.
*/
void lv_example_get_started_4(void)
{
/*Create a slider in the center of the display*/
lv_obj_t * slider = lv_slider_create(lv_screen_active());
lv_obj_set_width(slider, 200); /*Set the width*/
lv_obj_center(slider); /*Align to the center of the parent (screen)*/
lv_obj_add_event_cb(slider, slider_event_cb, LV_EVENT_VALUE_CHANGED, NULL); /*Assign an event function*/
/*Create a label above the slider*/
label = lv_label_create(lv_screen_active());
lv_label_set_text(label, "0");
lv_obj_align_to(label, slider, LV_ALIGN_OUT_TOP_MID, 0, -15); /*Align top of the slider*/
}
本次控制的电机为空心杯有刷电机
电机的控制电路原理图为
电机的速度采用进行PWM的调制驱动,PWM的驱动控制和液晶背光控制是一样的,由于手头没有mos管了没法搭建驱动电路,此处采用液晶背光亮度表征电机转速。
在slider_event_cb函数中实现PWM的可调
static void slider_event_cb(lv_event_t * e)
{
lv_obj_t * slider = lv_event_get_target(e);
uint8_t pwm = lv_slider_get_value(slider);
/*Refresh the text*/
lv_label_set_text_fmt(label, "%"LV_PRId32, lv_slider_get_value(slider));
lv_obj_align_to(label, slider, LV_ALIGN_OUT_TOP_MID, 0, -15); /*Align top of the slider*/
/* 避免背光不显示*/
if(pwm<20)
pwm=20;
lcd_set_brightness(pwm);
}
效果如下图,滑动实现屏幕亮度或电机速度的调节
- 2024-08-13
-
回复了主题帖:
共读入围名单: 《智能驾驶之激光雷达算法详解》
个人信息无误,确认可以完成评测计划
- 2024-07-27
-
发表了主题帖:
【瑞萨RA8D1开发板,基于M85内核的图形MCU测评】4.LVGL移植
本帖最后由 镜花水月000 于 2024-7-27 10:48 编辑
本次LVGL移植版本为V9.1 下载地址https://github.com/lvgl/lvgl/releases/tag/v9.1.0
首先将LVGL源文件添加到工程中
添加定时器驱动为lvgl提供时基
配置为1ms中断一次
在回调函数中添加lv_tick_inc(1)
在led_thread中初始化定时器
fsp_err_t err;
err = R_GPT_Open(&g_timer0_ctrl, &g_timer0_cfg);
if (FSP_SUCCESS != err)
{
__BKPT(0);
}
err = R_GPT_Start(&g_timer0_ctrl);
if (FSP_SUCCESS != err)
{
__BKPT(0);
}
添加lvgl线程
线程内存需要给的大一些
添加lv_port_disp.c,主要是LVGL的图形缓存和屏幕的打点函数
/**
* [url=home.php?mod=space&uid=1307177]@File[/url] lv_port_disp_templ.c
*
*/
/*Copy this file as "lv_port_disp.c" and set this value to "1" to enable content*/
#if 1
/*********************
* INCLUDES
*********************/
#include "lv_port_disp.h"
#include <stdbool.h>
#include "hal_data.h"
#include "bsp_lcd.h"
#include "hal_data.h"
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void disp_init(void);
static void disp_flush(lv_display_t * disp, const lv_area_t * area, uint8_t * px_map);
static lv_color_t buf_3_1[MY_DISP_HOR_RES * MY_DISP_VER_RES] BSP_ALIGN_VARIABLE(64) BSP_PLACE_IN_SECTION(".sdram");
static lv_color_t buf_3_2[MY_DISP_HOR_RES * MY_DISP_VER_RES] BSP_ALIGN_VARIABLE(64) BSP_PLACE_IN_SECTION(".sdram");
//static lv_color_t buf_3_1[MY_DISP_HOR_RES * 10] ;
//static lv_color_t buf_3_2[MY_DISP_HOR_RES * 10] ;
/**********************
* STATIC VARIABLES
**********************/
/**********************
* MACROS
**********************/
static lv_display_t * disp_drv;
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_port_disp_init(void)
{
/*-------------------------
* Initialize your display
* -----------------------*/
disp_init();
/*------------------------------------
* Create a display and set a flush_cb
* -----------------------------------*/
disp_drv = lv_display_create(MY_DISP_HOR_RES, MY_DISP_VER_RES);
lv_display_set_flush_cb(disp_drv, disp_flush);
/* Example 1
* One buffer for partial rendering*/
// static lv_color_t buf_1_1[MY_DISP_HOR_RES * 10]; /*A buffer for 10 rows*/
// lv_display_set_buffers(disp, buf_1_1, NULL, sizeof(buf_1_1), LV_DISPLAY_RENDER_MODE_PARTIAL);
/* Example 2
* Two buffers for partial rendering
* In flush_cb DMA or similar hardware should be used to update the display in the background.*/
// static lv_color_t buf_2_1[MY_DISP_HOR_RES * 10];
// static lv_color_t buf_2_2[MY_DISP_HOR_RES * 10];
// lv_display_set_buffers(disp, buf_2_1, buf_2_2, sizeof(buf_2_1), LV_DISPLAY_RENDER_MODE_PARTIAL);
/* Example 3
* Two buffers screen sized buffer for double buffering.
* Both LV_DISPLAY_RENDER_MODE_DIRECT and LV_DISPLAY_RENDER_MODE_FULL works, see their comments*/
lv_display_set_buffers(disp_drv, buf_3_1, buf_3_2, sizeof(buf_3_1), LV_DISPLAY_RENDER_MODE_DIRECT);
}
/**********************
* STATIC FUNCTIONS
**********************/
/*Initialize your display and the required peripherals.*/
static void disp_init(void)
{
/*You code here*/
}
volatile bool disp_flush_enabled = true;
/* Enable updating the screen (the flushing process) when disp_flush() is called by LVGL
*/
void disp_enable_update(void)
{
disp_flush_enabled = true;
}
/* Disable updating the screen (the flushing process) when disp_flush() is called by LVGL
*/
void disp_disable_update(void)
{
disp_flush_enabled = false;
}
/*Flush the content of the internal buffer the specific area on the display.
*`px_map` contains the rendered image as raw pixel map and it should be copied to `area` on the display.
*You can use DMA or any hardware acceleration to do this operation in the background but
*'lv_display_flush_ready()' has to be called when it's finished.*/
static void disp_flush(lv_display_t * disp_drv, const lv_area_t * area, uint8_t * px_map)
{
#if defined(RENESAS_CORTEX_M85)
#if (BSP_CFG_DCACHE_ENABLED)
int32_t size;
/* Invalidate cache - so the HW can access any data written by the CPU */
size = sizeof(fb_background[0]);
SCB_CleanInvalidateDCache_by_Addr(px_map, size);
#endif
#endif
R_GLCDC_BufferChange(&g_display0_ctrl,
(uint8_t *) px_map,
(display_frame_layer_t) 0);
/*IMPORTANT!!!
*Inform the graphics library that you are ready with the flushing*/
lv_display_flush_ready(disp_drv);
}
#else /*Enable this file at the top*/
/*This dummy typedef exists purely to silence -Wpedantic.*/
typedef int keep_pedantic_happy;
#endif
在lv_port_indev.c中添加触摸屏驱动
/**
* @file lv_port_indev_templ.c
*
*/
/*Copy this file as "lv_port_indev.c" and set this value to "1" to enable content*/
#if 1
/*********************
* INCLUDES
*********************/
#include "lv_port_indev.h"
#include "bsp_touch.h"
/*********************
* DEFINES
*********************/
/**********************
* TYPEDEFS
**********************/
/**********************
* STATIC PROTOTYPES
**********************/
static void touchpad_init(void);
static void touchpad_read(lv_indev_t * indev, lv_indev_data_t * data);
static bool touchpad_is_pressed(void);
static void touchpad_get_xy(int32_t * x, int32_t * y);
static void mouse_init(void);
static void mouse_read(lv_indev_t * indev, lv_indev_data_t * data);
static bool mouse_is_pressed(void);
static void mouse_get_xy(int32_t * x, int32_t * y);
static void keypad_init(void);
static void keypad_read(lv_indev_t * indev, lv_indev_data_t * data);
static uint32_t keypad_get_key(void);
static void encoder_init(void);
static void encoder_read(lv_indev_t * indev, lv_indev_data_t * data);
static void encoder_handler(void);
static void button_init(void);
static void button_read(lv_indev_t * indev, lv_indev_data_t * data);
static int8_t button_get_pressed_id(void);
static bool button_is_pressed(uint8_t id);
/**********************
* STATIC VARIABLES
**********************/
lv_indev_t * indev_touchpad;
lv_indev_t * indev_mouse;
lv_indev_t * indev_keypad;
lv_indev_t * indev_encoder;
lv_indev_t * indev_button;
static int32_t encoder_diff;
static lv_indev_state_t encoder_state;
/**********************
* MACROS
**********************/
/**********************
* GLOBAL FUNCTIONS
**********************/
void lv_port_indev_init(void)
{
/**
* Here you will find example implementation of input devices supported by LittelvGL:
* - Touchpad
* - Mouse (with cursor support)
* - Keypad (supports GUI usage only with key)
* - Encoder (supports GUI usage only with: left, right, push)
* - Button (external buttons to press points on the screen)
*
* The `..._read()` function are only examples.
* You should shape them according to your hardware
*/
/*------------------
* Touchpad
* -----------------*/
/*Initialize your touchpad if you have*/
touchpad_init();
/*Register a touchpad input device*/
indev_touchpad = lv_indev_create();
lv_indev_set_type(indev_touchpad, LV_INDEV_TYPE_POINTER);
lv_indev_set_read_cb(indev_touchpad, touchpad_read);
// /*------------------
// * Mouse
// * -----------------*/
// /*Initialize your mouse if you have*/
// mouse_init();
// /*Register a mouse input device*/
// indev_mouse = lv_indev_create();
// lv_indev_set_type(indev_mouse, LV_INDEV_TYPE_POINTER);
// lv_indev_set_read_cb(indev_mouse, mouse_read);
// /*Set cursor. For simplicity set a HOME symbol now.*/
// lv_obj_t * mouse_cursor = lv_image_create(lv_screen_active());
// lv_image_set_src(mouse_cursor, LV_SYMBOL_HOME);
// lv_indev_set_cursor(indev_mouse, mouse_cursor);
// /*------------------
// * Keypad
// * -----------------*/
// /*Initialize your keypad or keyboard if you have*/
// keypad_init();
// /*Register a keypad input device*/
// indev_keypad = lv_indev_create();
// lv_indev_set_type(indev_keypad, LV_INDEV_TYPE_KEYPAD);
// lv_indev_set_read_cb(indev_keypad, keypad_read);
// /*Later you should create group(s) with `lv_group_t * group = lv_group_create()`,
// *add objects to the group with `lv_group_add_obj(group, obj)`
// *and assign this input device to group to navigate in it:
// *`lv_indev_set_group(indev_keypad, group);`*/
// /*------------------
// * Encoder
// * -----------------*/
// /*Initialize your encoder if you have*/
// encoder_init();
// /*Register a encoder input device*/
// indev_encoder = lv_indev_create();
// lv_indev_set_type(indev_encoder, LV_INDEV_TYPE_ENCODER);
// lv_indev_set_read_cb(indev_touchpad, encoder_read);
// /*Later you should create group(s) with `lv_group_t * group = lv_group_create()`,
// *add objects to the group with `lv_group_add_obj(group, obj)`
// *and assign this input device to group to navigate in it:
// *`lv_indev_set_group(indev_encoder, group);`*/
// /*------------------
// * Button
// * -----------------*/
// /*Initialize your button if you have*/
// button_init();
// /*Register a button input device*/
// indev_button = lv_indev_create();
// lv_indev_set_type(indev_button, LV_INDEV_TYPE_BUTTON);
// lv_indev_set_read_cb(indev_button, button_read);
// /*Assign buttons to points on the screen*/
// static const lv_point_t btn_points[2] = {
// {10, 10}, /*Button 0 -> x:10; y:10*/
// {40, 100}, /*Button 1 -> x:40; y:100*/
// };
// lv_indev_set_button_points(indev_button, btn_points);
}
/**********************
* STATIC FUNCTIONS
**********************/
/*------------------
* Touchpad
* -----------------*/
/*Initialize your touchpad*/
static void touchpad_init(void)
{
/*Your code comes here*/
}
/*Will be called by the library to read the touchpad*/
static void touchpad_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
{
static int32_t last_x = 0;
static int32_t last_y = 0;
/*Save the pressed coordinates and the state*/
if(touchpad_is_pressed())
{
// touchpad_get_xy(&last_x, &last_y);
last_x=touchInfo.x[0];
last_y=touchInfo.y[0];
data->state = LV_INDEV_STATE_PR;
}
else {
data->state = LV_INDEV_STATE_REL;
}
/*Set the last pressed coordinates*/
data->point.x = last_x;
data->point.y = last_y;
}
/*Return true is the touchpad is pressed*/
static bool touchpad_is_pressed(void)
{
/*Your code comes here*/
/*Your code comes here*/
if(touchInfo.flag == 1)
return true;
else
return false;
}
/*Get the x and y coordinates if the touchpad is pressed*/
static void touchpad_get_xy(int32_t * x, int32_t * y)
{
/*Your code comes here*/
(*x) = 0;
(*y) = 0;
}
/*------------------
* Mouse
* -----------------*/
/*Initialize your mouse*/
static void mouse_init(void)
{
/*Your code comes here*/
}
/*Will be called by the library to read the mouse*/
static void mouse_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
{
/*Get the current x and y coordinates*/
mouse_get_xy(&data->point.x, &data->point.y);
/*Get whether the mouse button is pressed or released*/
if(mouse_is_pressed()) {
data->state = LV_INDEV_STATE_PR;
}
else {
data->state = LV_INDEV_STATE_REL;
}
}
/*Return true is the mouse button is pressed*/
static bool mouse_is_pressed(void)
{
/*Your code comes here*/
return false;
}
/*Get the x and y coordinates if the mouse is pressed*/
static void mouse_get_xy(int32_t * x, int32_t * y)
{
/*Your code comes here*/
(*x) = 0;
(*y) = 0;
}
/*------------------
* Keypad
* -----------------*/
/*Initialize your keypad*/
static void keypad_init(void)
{
/*Your code comes here*/
}
/*Will be called by the library to read the mouse*/
static void keypad_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
{
static uint32_t last_key = 0;
/*Get the current x and y coordinates*/
mouse_get_xy(&data->point.x, &data->point.y);
/*Get whether the a key is pressed and save the pressed key*/
uint32_t act_key = keypad_get_key();
if(act_key != 0) {
data->state = LV_INDEV_STATE_PR;
/*Translate the keys to LVGL control characters according to your key definitions*/
switch(act_key) {
case 1:
act_key = LV_KEY_NEXT;
break;
case 2:
act_key = LV_KEY_PREV;
break;
case 3:
act_key = LV_KEY_LEFT;
break;
case 4:
act_key = LV_KEY_RIGHT;
break;
case 5:
act_key = LV_KEY_ENTER;
break;
}
last_key = act_key;
}
else {
data->state = LV_INDEV_STATE_REL;
}
data->key = last_key;
}
/*Get the currently being pressed key. 0 if no key is pressed*/
static uint32_t keypad_get_key(void)
{
/*Your code comes here*/
return 0;
}
/*------------------
* Encoder
* -----------------*/
/*Initialize your encoder*/
static void encoder_init(void)
{
/*Your code comes here*/
}
/*Will be called by the library to read the encoder*/
static void encoder_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
{
data->enc_diff = encoder_diff;
data->state = encoder_state;
}
/*Call this function in an interrupt to process encoder events (turn, press)*/
static void encoder_handler(void)
{
/*Your code comes here*/
encoder_diff += 0;
encoder_state = LV_INDEV_STATE_REL;
}
/*------------------
* Button
* -----------------*/
/*Initialize your buttons*/
static void button_init(void)
{
/*Your code comes here*/
}
/*Will be called by the library to read the button*/
static void button_read(lv_indev_t * indev_drv, lv_indev_data_t * data)
{
static uint8_t last_btn = 0;
/*Get the pressed button's ID*/
int8_t btn_act = button_get_pressed_id();
if(btn_act >= 0) {
data->state = LV_INDEV_STATE_PR;
last_btn = btn_act;
}
else {
data->state = LV_INDEV_STATE_REL;
}
/*Save the last pressed button's ID*/
data->btn_id = last_btn;
}
/*Get ID (0, 1, 2 ..) of the pressed button*/
static int8_t button_get_pressed_id(void)
{
uint8_t i;
/*Check to buttons see which is being pressed (assume there are 2 buttons)*/
for(i = 0; i < 2; i++) {
/*Return the pressed button's ID*/
if(button_is_pressed(i)) {
return i;
}
}
/*No button pressed*/
return -1;
}
/*Test if `id` button is pressed or not*/
static bool button_is_pressed(uint8_t id)
{
/*Your code comes here*/
return false;
}
#else /*Enable this file at the top*/
/*This dummy typedef exists purely to silence -Wpedantic.*/
typedef int keep_pedantic_happy;
#endif
添加lv_conf.h配置LVGL
/**
* @file lv_conf.h
* Configuration file for v9.1.0
*/
/*
* Copy this file as `lv_conf.h`
* 1. simply next to the `lvgl` folder
* 2. or any other places and
* - define `LV_CONF_INCLUDE_SIMPLE`
* - add the path as include path
*/
/* clang-format off */
#if 1 /*Set it to "1" to enable content*/
#ifndef LV_CONF_H
#define LV_CONF_H
/*If you need to include anything here, do it inside the `__ASSEMBLY__` guard */
#if 0 && defined(__ASSEMBLY__)
#include "my_include.h"
#endif
/*====================
COLOR SETTINGS
*====================*/
#define MY_DISP_HOR_RES 800
#define MY_DISP_VER_RES 480
/*Color depth: 8 (A8), 16 (RGB565), 24 (RGB888), 32 (XRGB8888)*/
#define LV_COLOR_DEPTH 16
/*=========================
STDLIB WRAPPER SETTINGS
*=========================*/
/* Possible values
* - LV_STDLIB_BUILTIN: LVGL's built in implementation
* - LV_STDLIB_CLIB: Standard C functions, like malloc, strlen, etc
* - LV_STDLIB_MICROPYTHON: MicroPython implementation
* - LV_STDLIB_RTTHREAD: RT-Thread implementation
* - LV_STDLIB_CUSTOM: Implement the functions externally
*/
#define LV_USE_STDLIB_MALLOC LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_STRING LV_STDLIB_BUILTIN
#define LV_USE_STDLIB_SPRINTF LV_STDLIB_BUILTIN
#if LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN
/*Size of the memory available for `lv_malloc()` in bytes (>= 2kB)*/
#define LV_MEM_SIZE (128 * 1024U) /*[bytes]*/
/*Size of the memory expand for `lv_malloc()` in bytes*/
#define LV_MEM_POOL_EXPAND_SIZE 0
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
#define LV_MEM_ADR 0 /*0: unused*/
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
#if LV_MEM_ADR == 0
#undef LV_MEM_POOL_INCLUDE
#undef LV_MEM_POOL_ALLOC
#endif
#endif /*LV_USE_STDLIB_MALLOC == LV_STDLIB_BUILTIN*/
/*====================
HAL SETTINGS
*====================*/
/*Default display refresh, input device read and animation step period.*/
#define LV_DEF_REFR_PERIOD 33 /*[ms]*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
*(Not so important, you can adjust it to modify default sizes and spaces)*/
#define LV_DPI_DEF 130 /*[px/inch]*/
/*customize tick-get */
//#if defined(__PERF_COUNTER__) && __PERF_COUNTER__
// #define LV_GLOBAL_INIT(__GLOBAL_PTR) \
// do { \
// lv_global_init((lv_global_t *)(__GLOBAL_PTR)); \
// extern uint32_t perfc_tick_get(void); \
// (__GLOBAL_PTR)->tick_state.tick_get_cb = perfc_tick_get; \
// } while(0)
//#endif
/*=================
* OPERATING SYSTEM
*=================*/
/*Select an operating system to use. Possible options:
* - LV_OS_NONE
* - LV_OS_PTHREAD
* - LV_OS_FREERTOS
* - LV_OS_CMSIS_RTOS2
* - LV_OS_RTTHREAD
* - LV_OS_WINDOWS
* - LV_OS_CUSTOM */
#define LV_USE_OS LV_OS_FREERTOS
#if LV_USE_OS == LV_OS_CUSTOM
#define LV_OS_CUSTOM_INCLUDE <stdint.h>
#endif
/*========================
* RENDERING CONFIGURATION
*========================*/
/*Align the stride of all layers and images to this bytes*/
#define LV_DRAW_BUF_STRIDE_ALIGN 1
/*Align the start address of draw_buf addresses to this bytes*/
#define LV_DRAW_BUF_ALIGN 4
/* If a widget has `style_opa < 255` (not `bg_opa`, `text_opa` etc) or not NORMAL blend mode
* it is buffered into a "simple" layer before rendering. The widget can be buffered in smaller chunks.
* "Transformed layers" (if `transform_angle/zoom` are set) use larger buffers
* and can't be drawn in chunks. */
/*The target buffer size for simple layer chunks.*/
#define LV_DRAW_LAYER_SIMPLE_BUF_SIZE (24 * 1024) /*[bytes]*/
#define LV_USE_DRAW_SW 1
#if LV_USE_DRAW_SW == 1
/* Set the number of draw unit.
* > 1 requires an operating system enabled in `LV_USE_OS`
* > 1 means multiply threads will render the screen in parallel */
#define LV_DRAW_SW_DRAW_UNIT_CNT 1
/* Use Arm-2D to accelerate the sw render */
#define LV_USE_DRAW_ARM2D_SYNC 1
/* Enable native helium assembly to be compiled */
#define LV_USE_NATIVE_HELIUM_ASM 0
/* 0: use a simple renderer capable of drawing only simple rectangles with gradient, images, texts, and straight lines only
* 1: use a complex renderer capable of drawing rounded corners, shadow, skew lines, and arcs too */
#define LV_DRAW_SW_COMPLEX 1
#if LV_DRAW_SW_COMPLEX == 1
/*Allow buffering some shadow calculation.
*LV_DRAW_SW_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
*Caching has LV_DRAW_SW_SHADOW_CACHE_SIZE^2 RAM cost*/
#define LV_DRAW_SW_SHADOW_CACHE_SIZE 0
/* Set number of maximally cached circle data.
* The circumference of 1/4 circle are saved for anti-aliasing
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
* 0: to disable caching */
#define LV_DRAW_SW_CIRCLE_CACHE_SIZE 4
#endif
#define LV_USE_DRAW_SW_ASM LV_DRAW_SW_ASM_NONE
#if LV_USE_DRAW_SW_ASM == LV_DRAW_SW_ASM_CUSTOM
#define LV_DRAW_SW_ASM_CUSTOM_INCLUDE ""
#endif
#endif
/* Use NXP's VG-Lite GPU on iMX RTxxx platforms. */
#define LV_USE_DRAW_VGLITE 0
#if LV_USE_DRAW_VGLITE
/* Enable blit quality degradation workaround recommended for screen's dimension > 352 pixels. */
#define LV_USE_VGLITE_BLIT_SPLIT 0
#if LV_USE_OS
/* Enable VGLite draw async. Queue multiple tasks and flash them once to the GPU. */
#define LV_USE_VGLITE_DRAW_ASYNC 1
#endif
/* Enable VGLite asserts. */
#define LV_USE_VGLITE_ASSERT 0
#endif
/* Use NXP's PXP on iMX RTxxx platforms. */
#define LV_USE_DRAW_PXP 0
#if LV_USE_DRAW_PXP
/* Enable PXP asserts. */
#define LV_USE_PXP_ASSERT 0
#endif
/* Use Renesas Dave2D on RA platforms. */
#define LV_USE_DRAW_DAVE2D 0
/* Draw using cached SDL textures*/
#define LV_USE_DRAW_SDL 0
/* Use VG-Lite GPU. */
#define LV_USE_DRAW_VG_LITE 0
#if LV_USE_DRAW_VG_LITE
/* Enable VG-Lite custom external 'gpu_init()' function */
#define LV_VG_LITE_USE_GPU_INIT 0
/* Enable VG-Lite assert. */
#define LV_VG_LITE_USE_ASSERT 0
/* VG-Lite flush commit trigger threshold. GPU will try to batch these many draw tasks. */
#define LV_VG_LITE_FLUSH_MAX_COUNT 8
/* Enable border to simulate shadow
* NOTE: which usually improves performance,
* but does not guarantee the same rendering quality as the software. */
#define LV_VG_LITE_USE_BOX_SHADOW 0
/* VG-Lite gradient image maximum cache number.
* NOTE: The memory usage of a single gradient image is 4K bytes.
*/
#define LV_VG_LITE_GRAD_CACHE_SIZE 32
#endif
/*=======================
* FEATURE CONFIGURATION
*=======================*/
/*-------------
* Logging
*-----------*/
/*Enable the log module*/
#define LV_USE_LOG 0
#if LV_USE_LOG
/*How important log should be added:
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
*LV_LOG_LEVEL_INFO Log important events
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
*LV_LOG_LEVEL_USER Only logs added by the user
*LV_LOG_LEVEL_NONE Do not log anything*/
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
/*1: Print the log with 'printf';
*0: User need to register a callback with `lv_log_register_print_cb()`*/
#define LV_LOG_PRINTF 1
/*1: Enable print timestamp;
*0: Disable print timestamp*/
#define LV_LOG_USE_TIMESTAMP 1
/*1: Print file and line number of the log;
*0: Do not print file and line number of the log*/
#define LV_LOG_USE_FILE_LINE 1
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
#define LV_LOG_TRACE_MEM 1
#define LV_LOG_TRACE_TIMER 1
#define LV_LOG_TRACE_INDEV 1
#define LV_LOG_TRACE_DISP_REFR 1
#define LV_LOG_TRACE_EVENT 1
#define LV_LOG_TRACE_OBJ_CREATE 1
#define LV_LOG_TRACE_LAYOUT 1
#define LV_LOG_TRACE_ANIM 1
#define LV_LOG_TRACE_CACHE 1
#endif /*LV_USE_LOG*/
/*-------------
* Asserts
*-----------*/
/*Enable asserts if an operation is failed or an invalid data is found.
*If LV_USE_LOG is enabled an error message will be printed on failure*/
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/
/*Add a custom handler when assert happens e.g. to restart the MCU*/
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
#define LV_ASSERT_HANDLER while(1); /*Halt by default*/
/*-------------
* Debug
*-----------*/
/*1: Draw random colored rectangles over the redrawn areas*/
#define LV_USE_REFR_DEBUG 0
/*1: Draw a red overlay for ARGB layers and a green overlay for RGB layers*/
#define LV_USE_LAYER_DEBUG 0
/*1: Draw overlays with different colors for each draw_unit's tasks.
*Also add the index number of the draw unit on white background.
*For layers add the index number of the draw unit on black background.*/
#define LV_USE_PARALLEL_DRAW_DEBUG 0
/*-------------
* Others
*-----------*/
#define LV_ENABLE_GLOBAL_CUSTOM 0
#if LV_ENABLE_GLOBAL_CUSTOM
/*Header to include for the custom 'lv_global' function"*/
#define LV_GLOBAL_CUSTOM_INCLUDE <stdint.h>
#endif
/*Default cache size in bytes.
*Used by image decoders such as `lv_lodepng` to keep the decoded image in the memory.
*If size is not set to 0, the decoder will fail to decode when the cache is full.
*If size is 0, the cache function is not enabled and the decoded mem will be released immediately after use.*/
#define LV_CACHE_DEF_SIZE 0
/*Default number of image header cache entries. The cache is used to store the headers of images
*The main logic is like `LV_CACHE_DEF_SIZE` but for image headers.*/
#define LV_IMAGE_HEADER_CACHE_DEF_CNT 0
/*Number of stops allowed per gradient. Increase this to allow more stops.
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
#define LV_GRADIENT_MAX_STOPS 2
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
* 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */
#define LV_COLOR_MIX_ROUND_OFS 0
/* Add 2 x 32 bit variables to each lv_obj_t to speed up getting style properties */
#define LV_OBJ_STYLE_CACHE 0
/* Add `id` field to `lv_obj_t` */
#define LV_USE_OBJ_ID 0
/* Use lvgl builtin method for obj ID */
#define LV_USE_OBJ_ID_BUILTIN 0
/*Use obj property set/get API*/
#define LV_USE_OBJ_PROPERTY 0
/* VG-Lite Simulator */
/*Requires: LV_USE_THORVG_INTERNAL or LV_USE_THORVG_EXTERNAL */
#define LV_USE_VG_LITE_THORVG 0
#if LV_USE_VG_LITE_THORVG
/*Enable LVGL's blend mode support*/
#define LV_VG_LITE_THORVG_LVGL_BLEND_SUPPORT 0
/*Enable YUV color format support*/
#define LV_VG_LITE_THORVG_YUV_SUPPORT 0
/*Enable 16 pixels alignment*/
#define LV_VG_LITE_THORVG_16PIXELS_ALIGN 1
/*Buffer address alignment*/
#define LV_VG_LITE_THORVG_BUF_ADDR_ALIGN 64
/*Enable multi-thread render*/
#define LV_VG_LITE_THORVG_THREAD_RENDER 0
#endif
/*=====================
* COMPILER SETTINGS
*====================*/
/*For big endian systems set to 1*/
#define LV_BIG_ENDIAN_SYSTEM 0
/*Define a custom attribute to `lv_tick_inc` function*/
#define LV_ATTRIBUTE_TICK_INC
/*Define a custom attribute to `lv_timer_handler` function*/
#define LV_ATTRIBUTE_TIMER_HANDLER
/*Define a custom attribute to `lv_display_flush_ready` function*/
#define LV_ATTRIBUTE_FLUSH_READY
/*Required alignment size for buffers*/
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 4
/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default).
* E.g. __attribute__((aligned(4)))*/
#define LV_ATTRIBUTE_MEM_ALIGN __attribute__((aligned(4)))
/*Attribute to mark large constant arrays for example font's bitmaps*/
#define LV_ATTRIBUTE_LARGE_CONST
/*Compiler prefix for a big array declaration in RAM*/
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
/*Place performance critical functions into a faster memory (e.g RAM)*/
#define LV_ATTRIBUTE_FAST_MEM
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
*should also appear on LVGL binding API such as Micropython.*/
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/
/*Prefix all global extern data with this*/
#define LV_ATTRIBUTE_EXTERN_DATA
/* Use `float` as `lv_value_precise_t` */
#define LV_USE_FLOAT 0
/*==================
* FONT USAGE
*===================*/
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
*https://fonts.google.com/specimen/Montserrat*/
#define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 0
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_MONTSERRAT_18 0
#define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0
#define LV_FONT_MONTSERRAT_24 1
#define LV_FONT_MONTSERRAT_26 0
#define LV_FONT_MONTSERRAT_28 0
#define LV_FONT_MONTSERRAT_30 0
#define LV_FONT_MONTSERRAT_32 0
#define LV_FONT_MONTSERRAT_34 0
#define LV_FONT_MONTSERRAT_36 0
#define LV_FONT_MONTSERRAT_38 0
#define LV_FONT_MONTSERRAT_40 0
#define LV_FONT_MONTSERRAT_42 0
#define LV_FONT_MONTSERRAT_44 0
#define LV_FONT_MONTSERRAT_46 0
#define LV_FONT_MONTSERRAT_48 0
/*Demonstrate special features*/
#define LV_FONT_MONTSERRAT_28_COMPRESSED 3 /*bpp = 3*/
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/
#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/
/*Pixel perfect monospace fonts*/
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/*Optionally declare custom fonts here.
*You can use these fonts as default font too and they will be available globally.
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
#define LV_FONT_CUSTOM_DECLARE
/*Always set a default font*/
#define LV_FONT_DEFAULT &lv_font_montserrat_16
/*Enable handling large font and/or fonts with a lot of characters.
*The limit depends on the font size, font face and bpp.
*Compiler error will be triggered if a font needs it.*/
#define LV_FONT_FMT_TXT_LARGE 0
/*Enables/disables support for compressed fonts.*/
#define LV_USE_FONT_COMPRESSED 0
/*Enable drawing placeholders when glyph dsc is not found*/
#define LV_USE_FONT_PLACEHOLDER 1
/*=================
* TEXT SETTINGS
*=================*/
/**
* Select a character encoding for strings.
* Your IDE or editor should have the same character encoding
* - LV_TXT_ENC_UTF8
* - LV_TXT_ENC_ASCII
*/
#define LV_TXT_ENC LV_TXT_ENC_UTF8
/*Can break (wrap) texts on these chars*/
#define LV_TXT_BREAK_CHARS " ,.;:-_)]}"
/*If a word is at least this long, will break wherever "prettiest"
*To disable, set to a value <= 0*/
#define LV_TXT_LINE_BREAK_LONG_LEN 0
/*Minimum number of characters in a long word to put on a line before a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
/*Minimum number of characters in a long word to put on a line after a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
*The direction will be processed according to the Unicode Bidirectional Algorithm:
*https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
#define LV_USE_BIDI 0
#if LV_USE_BIDI
/*Set the default direction. Supported values:
*`LV_BASE_DIR_LTR` Left-to-Right
*`LV_BASE_DIR_RTL` Right-to-Left
*`LV_BASE_DIR_AUTO` detect texts base direction*/
#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO
#endif
/*Enable Arabic/Persian processing
*In these languages characters should be replaced with an other form based on their position in the text*/
#define LV_USE_ARABIC_PERSIAN_CHARS 0
/*==================
* WIDGETS
*================*/
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
#define LV_WIDGETS_HAS_DEFAULT_VALUE 1
#define LV_USE_ANIMIMG 1
#define LV_USE_ARC 1
#define LV_USE_BAR 1
#define LV_USE_BUTTON 1
#define LV_USE_BUTTONMATRIX 1
#define LV_USE_CALENDAR 1
#if LV_USE_CALENDAR
#define LV_CALENDAR_WEEK_STARTS_MONDAY 0
#if LV_CALENDAR_WEEK_STARTS_MONDAY
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
#else
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
#endif
#define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
#define LV_USE_CALENDAR_HEADER_ARROW 1
#define LV_USE_CALENDAR_HEADER_DROPDOWN 1
#endif /*LV_USE_CALENDAR*/
#define LV_USE_CANVAS 1
#define LV_USE_CHART 1
#define LV_USE_CHECKBOX 1
#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/
#define LV_USE_IMAGE 1 /*Requires: lv_label*/
#define LV_USE_IMAGEBUTTON 1
#define LV_USE_KEYBOARD 1
#define LV_USE_LABEL 1
#if LV_USE_LABEL
#define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/
#define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
#define LV_LABEL_WAIT_CHAR_COUNT 3 /*The count of wait chart*/
#endif
#define LV_USE_LED 1
#define LV_USE_LINE 1
#define LV_USE_LIST 1
#define LV_USE_MENU 1
#define LV_USE_MSGBOX 1
#define LV_USE_ROLLER 1 /*Requires: lv_label*/
#define LV_USE_SCALE 1
#define LV_USE_SLIDER 1 /*Requires: lv_bar*/
#define LV_USE_SPAN 1
#if LV_USE_SPAN
/*A line text can contain maximum num of span descriptor */
#define LV_SPAN_SNIPPET_STACK_SIZE 64
#endif
#define LV_USE_SPINBOX 1
#define LV_USE_SPINNER 1
#define LV_USE_SWITCH 1
#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/
#if LV_USE_TEXTAREA != 0
#define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
#endif
#define LV_USE_TABLE 1
#define LV_USE_TABVIEW 1
#define LV_USE_TILEVIEW 1
#define LV_USE_WIN 1
/*==================
* THEMES
*==================*/
/*A simple, impressive and very complete theme*/
#define LV_USE_THEME_DEFAULT 1
#if LV_USE_THEME_DEFAULT
/*0: Light mode; 1: Dark mode*/
#define LV_THEME_DEFAULT_DARK 0
/*1: Enable grow on press*/
#define LV_THEME_DEFAULT_GROW 1
/*Default transition time in [ms]*/
#define LV_THEME_DEFAULT_TRANSITION_TIME 80
#endif /*LV_USE_THEME_DEFAULT*/
/*A very simple theme that is a good starting point for a custom theme*/
#define LV_USE_THEME_SIMPLE 1
/*A theme designed for monochrome displays*/
#define LV_USE_THEME_MONO 1
/*==================
* LAYOUTS
*==================*/
/*A layout similar to Flexbox in CSS.*/
#define LV_USE_FLEX 1
/*A layout similar to Grid in CSS.*/
#define LV_USE_GRID 1
/*====================
* 3RD PARTS LIBRARIES
*====================*/
/*File system interfaces for common APIs */
/*API for fopen, fread, etc*/
#define LV_USE_FS_STDIO 0
#if LV_USE_FS_STDIO
#define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for open, read, etc*/
#define LV_USE_FS_POSIX 0
#if LV_USE_FS_POSIX
#define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for CreateFile, ReadFile, etc*/
#define LV_USE_FS_WIN32 0
#if LV_USE_FS_WIN32
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
#define LV_USE_FS_FATFS 0
#if LV_USE_FS_FATFS
#define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for memory-mapped file access. */
#define LV_USE_FS_MEMFS 0
#if LV_USE_FS_MEMFS
#define LV_FS_MEMFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#endif
/*API for LittleFs. */
#define LV_USE_FS_LITTLEFS 0
#if LV_USE_FS_LITTLEFS
#define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#endif
/*LODEPNG decoder library*/
#define LV_USE_LODEPNG 0
/*PNG decoder(libpng) library*/
#define LV_USE_LIBPNG 0
/*BMP decoder library*/
#define LV_USE_BMP 0
/* JPG + split JPG decoder library.
* Split JPG is a custom format optimized for embedded systems. */
#define LV_USE_TJPGD 0
/* libjpeg-turbo decoder library.
* Supports complete JPEG specifications and high-performance JPEG decoding. */
#define LV_USE_LIBJPEG_TURBO 0
/*GIF decoder library*/
#define LV_USE_GIF 0
#if LV_USE_GIF
/*GIF decoder accelerate*/
#define LV_GIF_CACHE_DECODE_DATA 0
#endif
/*Decode bin images to RAM*/
#define LV_BIN_DECODER_RAM_LOAD 0
/*RLE decompress library*/
#define LV_USE_RLE 0
/*QR code library*/
#define LV_USE_QRCODE 0
/*Barcode code library*/
#define LV_USE_BARCODE 0
/*FreeType library*/
#define LV_USE_FREETYPE 0
#if LV_USE_FREETYPE
/*Let FreeType to use LVGL memory and file porting*/
#define LV_FREETYPE_USE_LVGL_PORT 0
/*Cache count of the glyphs in FreeType. It means the number of glyphs that can be cached.
*The higher the value, the more memory will be used.*/
#define LV_FREETYPE_CACHE_FT_GLYPH_CNT 256
#endif
/* Built-in TTF decoder */
#define LV_USE_TINY_TTF 0
#if LV_USE_TINY_TTF
/* Enable loading TTF data from files */
#define LV_TINY_TTF_FILE_SUPPORT 0
#endif
/*Rlottie library*/
#define LV_USE_RLOTTIE 0
/*Enable Vector Graphic APIs*/
#define LV_USE_VECTOR_GRAPHIC 0
/* Enable ThorVG (vector graphics library) from the src/libs folder */
#define LV_USE_THORVG_INTERNAL 0
/* Enable ThorVG by assuming that its installed and linked to the project */
#define LV_USE_THORVG_EXTERNAL 0
/*Use lvgl built-in LZ4 lib*/
#define LV_USE_LZ4_INTERNAL 0
/*Use external LZ4 library*/
#define LV_USE_LZ4_EXTERNAL 0
/*FFmpeg library for image decoding and playing videos
*Supports all major image formats so do not enable other image decoder with it*/
#define LV_USE_FFMPEG 0
#if LV_USE_FFMPEG
/*Dump input information to stderr*/
#define LV_FFMPEG_DUMP_FORMAT 0
#endif
/*==================
* OTHERS
*==================*/
/*1: Enable API to take snapshot for object*/
#define LV_USE_SNAPSHOT 1
/*1: Enable system monitor component*/
#define LV_USE_SYSMON 1
#if LV_USE_SYSMON
/*Get the idle percentage. E.g. uint32_t my_get_idle(void);*/
#define LV_SYSMON_GET_IDLE lv_timer_get_idle
/*1: Show CPU usage and FPS count
* Requires `LV_USE_SYSMON = 1`*/
#define LV_USE_PERF_MONITOR 1
#if LV_USE_PERF_MONITOR
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
/*0: Displays performance data on the screen, 1: Prints performance data using log.*/
#define LV_USE_PERF_MONITOR_LOG_MODE 0
#endif
/*1: Show the used memory and the memory fragmentation
* Requires `LV_USE_STDLIB_MALLOC = LV_STDLIB_BUILTIN`
* Requires `LV_USE_SYSMON = 1`*/
#define LV_USE_MEM_MONITOR 1
#if LV_USE_MEM_MONITOR
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
#endif
#endif /*LV_USE_SYSMON*/
/*1: Enable the runtime performance profiler*/
#define LV_USE_PROFILER 0
#if LV_USE_PROFILER
/*1: Enable the built-in profiler*/
#define LV_USE_PROFILER_BUILTIN 1
#if LV_USE_PROFILER_BUILTIN
/*Default profiler trace buffer size*/
#define LV_PROFILER_BUILTIN_BUF_SIZE (16 * 1024) /*[bytes]*/
#endif
/*Header to include for the profiler*/
#define LV_PROFILER_INCLUDE "lvgl/src/misc/lv_profiler_builtin.h"
/*Profiler start point function*/
#define LV_PROFILER_BEGIN LV_PROFILER_BUILTIN_BEGIN
/*Profiler end point function*/
#define LV_PROFILER_END LV_PROFILER_BUILTIN_END
/*Profiler start point function with custom tag*/
#define LV_PROFILER_BEGIN_TAG LV_PROFILER_BUILTIN_BEGIN_TAG
/*Profiler end point function with custom tag*/
#define LV_PROFILER_END_TAG LV_PROFILER_BUILTIN_END_TAG
#endif
/*1: Enable Monkey test*/
#define LV_USE_MONKEY 0
/*1: Enable grid navigation*/
#define LV_USE_GRIDNAV 0
/*1: Enable lv_obj fragment*/
#define LV_USE_FRAGMENT 0
/*1: Support using images as font in label or span widgets */
#define LV_USE_IMGFONT 0
/*1: Enable an observer pattern implementation*/
#define LV_USE_OBSERVER 1
/*1: Enable Pinyin input method*/
/*Requires: lv_keyboard*/
#define LV_USE_IME_PINYIN 0
#if LV_USE_IME_PINYIN
/*1: Use default thesaurus*/
/*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
/*Set the maximum number of candidate panels that can be displayed*/
/*This needs to be adjusted according to the size of the screen*/
#define LV_IME_PINYIN_CAND_TEXT_NUM 6
/*Use 9 key input(k9)*/
#define LV_IME_PINYIN_USE_K9_MODE 1
#if LV_IME_PINYIN_USE_K9_MODE == 1
#define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3
#endif /*LV_IME_PINYIN_USE_K9_MODE*/
#endif
/*1: Enable file explorer*/
/*Requires: lv_table*/
#define LV_USE_FILE_EXPLORER 0
#if LV_USE_FILE_EXPLORER
/*Maximum length of path*/
#define LV_FILE_EXPLORER_PATH_MAX_LEN (128)
/*Quick access bar, 1:use, 0:not use*/
/*Requires: lv_list*/
#define LV_FILE_EXPLORER_QUICK_ACCESS 1
#endif
/*==================
* DEVICES
*==================*/
/*Use SDL to open window on PC and handle mouse and keyboard*/
#define LV_USE_SDL 0
#if LV_USE_SDL
#define LV_SDL_INCLUDE_PATH <SDL2/SDL.h>
#define LV_SDL_RENDER_MODE LV_DISPLAY_RENDER_MODE_DIRECT /*LV_DISPLAY_RENDER_MODE_DIRECT is recommended for best performance*/
#define LV_SDL_BUF_COUNT 1 /*1 or 2*/
#define LV_SDL_FULLSCREEN 0 /*1: Make the window full screen by default*/
#define LV_SDL_DIRECT_EXIT 1 /*1: Exit the application when all SDL windows are closed*/
#define LV_SDL_MOUSEWHEEL_MODE LV_SDL_MOUSEWHEEL_MODE_ENCODER /*LV_SDL_MOUSEWHEEL_MODE_ENCODER/CROWN*/
#endif
/*Use X11 to open window on Linux desktop and handle mouse and keyboard*/
#define LV_USE_X11 0
#if LV_USE_X11
#define LV_X11_DIRECT_EXIT 1 /*Exit the application when all X11 windows have been closed*/
#define LV_X11_DOUBLE_BUFFER 1 /*Use double buffers for endering*/
/*select only 1 of the following render modes (LV_X11_RENDER_MODE_PARTIAL preferred!)*/
#define LV_X11_RENDER_MODE_PARTIAL 1 /*Partial render mode (preferred)*/
#define LV_X11_RENDER_MODE_DIRECT 0 /*direct render mode*/
#define LV_X11_RENDER_MODE_FULL 0 /*Full render mode*/
#endif
/*Driver for /dev/fb*/
#define LV_USE_LINUX_FBDEV 0
#if LV_USE_LINUX_FBDEV
#define LV_LINUX_FBDEV_BSD 0
#define LV_LINUX_FBDEV_RENDER_MODE LV_DISPLAY_RENDER_MODE_PARTIAL
#define LV_LINUX_FBDEV_BUFFER_COUNT 0
#define LV_LINUX_FBDEV_BUFFER_SIZE 60
#endif
/*Use Nuttx to open window and handle touchscreen*/
#define LV_USE_NUTTX 0
#if LV_USE_NUTTX
#define LV_USE_NUTTX_LIBUV 0
/*Use Nuttx custom init API to open window and handle touchscreen*/
#define LV_USE_NUTTX_CUSTOM_INIT 0
/*Driver for /dev/lcd*/
#define LV_USE_NUTTX_LCD 0
#if LV_USE_NUTTX_LCD
#define LV_NUTTX_LCD_BUFFER_COUNT 0
#define LV_NUTTX_LCD_BUFFER_SIZE 60
#endif
/*Driver for /dev/input*/
#define LV_USE_NUTTX_TOUCHSCREEN 0
#endif
/*Driver for /dev/dri/card*/
#define LV_USE_LINUX_DRM 0
/*Interface for TFT_eSPI*/
#define LV_USE_TFT_ESPI 0
/*Driver for evdev input devices*/
#define LV_USE_EVDEV 0
/*Driver for libinput input devices*/
#define LV_USE_LIBINPUT 0
#if LV_USE_LIBINPUT
#define LV_LIBINPUT_BSD 0
/*Full keyboard support*/
#define LV_LIBINPUT_XKB 0
#if LV_LIBINPUT_XKB
/*"setxkbmap -query" can help find the right values for your keyboard*/
#define LV_LIBINPUT_XKB_KEY_MAP { .rules = NULL, .model = "pc101", .layout = "us", .variant = NULL, .options = NULL }
#endif
#endif
/*Drivers for LCD devices connected via SPI/parallel port*/
#define LV_USE_ST77350
#define LV_USE_ST77890
#define LV_USE_ST77960
#define LV_USE_ILI93410
#define LV_USE_GENERIC_MIPI (LV_USE_ST7735 | LV_USE_ST7789 | LV_USE_ST7796 | LV_USE_ILI9341)
/* LVGL Windows backend */
#define LV_USE_WINDOWS 0
/*==================
* EXAMPLES
*==================*/
/*Enable the examples to be built with the library*/
#define LV_BUILD_EXAMPLES 1
/*===================
* DEMO USAGE
====================*/
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#define LV_USE_DEMO_WIDGETS 1
/*Demonstrate the usage of encoder and keyboard*/
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
/*Benchmark your system*/
#define LV_USE_DEMO_BENCHMARK 1
/*Render test for each primitives. Requires at least 480x272 display*/
#define LV_USE_DEMO_RENDER 0
/*Stress test for LVGL*/
#define LV_USE_DEMO_STRESS 0
/*Music player demo*/
#define LV_USE_DEMO_MUSIC 0
#if LV_USE_DEMO_MUSIC
#define LV_DEMO_MUSIC_SQUARE 0
#define LV_DEMO_MUSIC_LANDSCAPE 0
#define LV_DEMO_MUSIC_ROUND 0
#define LV_DEMO_MUSIC_LARGE 0
#define LV_DEMO_MUSIC_AUTO_PLAY 0
#endif
/*Flex layout demo*/
#define LV_USE_DEMO_FLEX_LAYOUT 0
/*Smart-phone like multi-language demo*/
#define LV_USE_DEMO_MULTILANG 0
/*Widget transformation demo*/
#define LV_USE_DEMO_TRANSFORM 0
/*Demonstrate scroll settings*/
#define LV_USE_DEMO_SCROLL 0
/*Vector graphic demo*/
#define LV_USE_DEMO_VECTOR_GRAPHIC 0
/*--END OF LV_CONF_H--*/
#endif /*LV_CONF_H*/
#endif /*End of "Content enable"*/
/*====================
COLOR SETTINGS
*====================*/
添加lvgl的文件路径
添加LVGL的benchmark demo
接下来编写lvgl_thread
/* lvgl_thread entry function */
/* pvParameters contains TaskHandle_t */
void lvgl_thread_entry(void* pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
lv_init();
lv_port_disp_init();
lv_port_indev_init();
lv_demo_benchmark();
/* TODO: add your own code here */
while(1)
{
lv_task_handler();
// lv_obj_invalidate(lv_screen_active());
vTaskDelay(10);
}
}
下载运行,由于代码没有优化,运行帧数比较低。开硬件加速后程序会卡死,原因未知。[localvideo]f67c08cf2378af634956749a1ebf7a7f[/localvideo]
- 2024-07-26
-
发表了主题帖:
【瑞萨RA8D1开发板,基于M85内核的图形MCU测评】3.RGB-LCD
由于LVGL不支持RGB666,触摸的I2C和j-link串口冲突,所以上个贴子中的硬件设计需要重新设计一下
在移植LVGL之前首先进行RGB LCD驱动的编写,本次实验所用屏幕为反客4.3寸800*480分辨率RGB屏幕
本次实验实在点灯工程的基础上进行的,由于实验设置的屏幕色彩模式为RGB565,并采用双缓存,所以内部RAM空间不足,需要使用外部SDRAM,先进行外部SDRAM的驱动配置,此处参考官方程序即可,下面为IO配置
Sdram文件添加到工程中
接下来进行GLCDC接口的时钟配置
然后进行GLCDC的IO口设置,色彩模式RGB565
Stacks添加GLCDC
设置属性
添加LCD背光的PWM驱动
配置完成后点击代码生成,在工程中添加LCD驱动的。下面为部分驱动代码
static uint16_t *lcd_current_working_buffer = (uint16_t *) &fb_background[0];
static uint8_t lcd_framebuffer[LCD_BUF_SIZE] BSP_ALIGN_VARIABLE(64) BSP_PLACE_IN_SECTION(".sdram");
static void bsp_lcd_backlight_init(void);
/**
* [url=home.php?mod=space&uid=159083]@brief[/url] 初始化
*
* @param 无
* @retval 无
*/
void bsp_lcd_init (void)
{
fsp_err_t err;
// Open the GLCDC driver
err = R_GLCDC_Open(&g_display0_ctrl, &g_display0_cfg);
//printf("err1 %d\r\n",err);
err = R_GLCDC_Start(&g_display0_ctrl);
//printf("err2 %d\r\n",err);
bsp_lcd_backlight_init();
}
/**
* @brief 初始化
*
* @param 无
* @retval 无
*/
static void bsp_lcd_backlight_init(void)
{
/* 初始化 GPT 模块 */
R_GPT_Open(&g_timer_gpt6_ctrl, &g_timer_gpt6_cfg);
/* 启动 GPT 定时器 */
R_GPT_Start(&g_timer_gpt6_ctrl);
/* 重新设置占空比为 80% */
lcd_set_brightness(100);
}
/** 自定义函数:设置PWM占空比
@param duty 占空比范围:0~100 %
*/
void lcd_set_brightness(uint8_t duty)
{
timer_info_t info;
uint32_t current_period_counts;
uint32_t duty_cycle_counts;
if (duty > 100)
duty = 100; //限制占空比范围:0~100
/* 获得GPT的信息 */
R_GPT_InfoGet(&g_timer_gpt6_ctrl, &info);
/* 获得计时器一个周期需要的计数次数 */
current_period_counts = info.period_counts;
/* 根据占空比和一个周期的计数次数计算GTCCR寄存器的值 */
duty_cycle_counts = (uint32_t)(((uint64_t) current_period_counts * duty) / 100);
/* 最后调用FSP库函数设置占空比 */
R_GPT_DutyCycleSet(&g_timer_gpt6_ctrl, duty_cycle_counts, GPT_IO_PIN_GTIOCA);
}
/**
* @brief 设置显示缓存
* @param index:缓存区索引 1.第一缓存数组 2.第二缓存数组
* @retval 无
*/
static void lcd_set_display_buffer(uint8_t index)
{
/* 更改图层的帧缓冲区指针 */
R_GLCDC_BufferChange(&g_display0_ctrl, (uint8_t*)fb_background[index - 1], DISPLAY_FRAME_LAYER_1);
}
/**
* @brief 设置当前使用的缓存
* @param index:缓存区索引 1.第一缓存数组 2.第二缓存数组
* @retval 无
*/
static void lcd_set_working_buffer(uint8_t index)
{
if (index >= 1 && index <= 2)
{
lcd_current_working_buffer = (uint16_t *)fb_background[index - 1];
}
}
///**
// * @brief 使能双buffer
// * @retval 无
// */
//static void lcd_enable_double_buffer(void)
//{
// lcd_set_working_buffer(1);
// lcd_set_display_buffer(1);
//}
/**
* @brief lcd清屏
* @param color:RGB565 颜色
* @retval 无
*/
void lcd_clear(uint16_t color)
{
for (uint32_t i = 0; i < (LCD_WIDTH * LCD_HEIGHT); i++)
{
lcd_current_working_buffer[i] = color;
}
}
/**
* @brief lcd切换帧缓冲区
* @retval 无
*/
void lcd_swap_buffer(void)
{
if (lcd_current_working_buffer == (uint16_t *)fb_background[0])
{
lcd_set_working_buffer(2);
lcd_set_display_buffer(2);
}
else
{
lcd_set_working_buffer(1);
lcd_set_display_buffer(1);
}
}
/**
* @brief lcd清平
* @param color:RGB565 颜色
* @retval 无
*/
void lcd_draw_pixel(uint32_t x, uint32_t y, uint16_t color)
{
// Verify pixel is within LCD range
if ((x <= LCD_WIDTH) && (y <= LCD_HEIGHT))
{
switch (g_screen_rotation)
{
case ROTATION_ZERO:
{
lcd_current_working_buffer[(y * LCD_WIDTH) + x] = color;
break;
}
case ROTATION_180:
{
lcd_current_working_buffer[((LCD_HEIGHT - y) * LCD_WIDTH) + (LCD_WIDTH - x)] = color;
break;
}
default:
{
lcd_current_working_buffer[(y * LCD_WIDTH) + x] = color;
break;
}
}
}
else
{
printf("draw pixel outof range:%d,%d", x, y);
}
}
/**
* @brief 填充数组
* @param x_start:
* @param y_start:
* @param x_end:
* @param y_end:
* @param pcolor:
* @retval 无
*/
void lcd_fill_array(uint16_t x_start, uint16_t y_start, uint16_t x_end, uint16_t y_end, void *pcolor)
{
uint16_t *pixel = NULL;
uint16_t cycle_y, x_offset = 0;
pixel = (uint16_t *)pcolor;
for (cycle_y = y_start; cycle_y <= y_end;)
{
for (x_offset = 0; x_start + x_offset <= x_end; x_offset++)
{
lcd_draw_pixel(x_start + x_offset, cycle_y, *pixel++);
}
cycle_y++;
}
}
void lcd_fill_rectangle(uint16_t x_start, uint16_t y_start, uint16_t x_end, uint16_t y_end, uint16_t pixcolor)
{
uint16_t cycle_y, x_offset = 0;
for (cycle_y = y_start; cycle_y <= y_end;)
{
for (x_offset = 0; x_start + x_offset <= x_end; x_offset++)
{
lcd_draw_pixel(x_start + x_offset, cycle_y, pixcolor);
}
cycle_y++;
}
}
在LED线程中测试一下
void led_thread_entry(void* pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
bsp_dwt_init();
bsp_led_init();
bsp_uart3_init();
bsp_sdram_init();
bsp_lcd_init();
lcd_clear(BLACK);
lcd_fill_rectangle(100,100,200,400,RED);
lcd_fill_rectangle(200,100,300,400,GREEN);
lcd_fill_rectangle(300,100,400,400,BLUE);
while(1)
{
led_toggle();
vTaskDelay(20);
}
}
拍照有些失真,屏幕的实际观感效果还是很不错的。下一步移植LVGL_V9.1
- 2024-07-17
-
回复了主题帖:
【瑞萨RA8D1开发板,基于M85内核的图形MCU测评】2.扩展板设计
Maker_kun 发表于 2024-7-16 13:42
这个扩展板有点东西
- 2024-07-15
-
发表了主题帖:
【瑞萨RA8D1开发板,基于M85内核的图形MCU测评】2.扩展板设计
CPKCOR-RA8D1B板上使用224BGA封装的RA8D1,它集成了高性能 CM85 内核和大内存,以及丰富的外设集,包括带并行 RGB 和 MIPI-DSI 接口的高分辨率 TFT-LCD 控制器、2D 绘图引擎、16 位摄像头接口和多个外部内存接口。CPKCOR-RA8D1B板上有两个80管脚的高密度板对板连接器,可根据客户要求进行不同功能的扩展。本次体验为了方便后面的图形测试等,需要进行扩展板的设计。
板子的资料中已经给出扩展板设计样例,本次扩展板主要参考样例进行设计。
接下来进行扩展板的设计
BTB引脚引出
全速USB设计
用户按键
相机接口
MIPI接口
RGB-LCD接口
WIFI扩展
8.RS485扩展
9.CAN接口扩展
10.IO接口2.54mm扩展
最终的PCB设计如下图
扩展板至此初步设计完成,进行PCB的打样,接下来等待PCB的到来进行焊接调试。
- 2024-07-09
-
回复了主题帖:
【瑞萨RA8D1开发板,基于M85内核的图形MCU测评】1.基于MDK的环境搭建,FreeRTOS移....
秦天qintian0303 发表于 2024-7-9 07:17
MDK能直接启动Renesas RA进行配置吗?
可以的
- 2024-07-06
-
发表了主题帖:
【瑞萨RA8D1开发板,基于M85内核的图形MCU测评】1.基于MDK的环境搭建,FreeRTOS移....
首先感谢论坛给我这次RA8D1测评的机会,瑞萨电子 RA8D1 MCU 系列是业界首款基于 Arm® Cortex®-M85 (CM85) 内核的 32 位图形微控制器 (MCU),能够在 480 MHz 频率下实现超过 3000 CoreMark 分数的突破性性能,可支持高分辨率显示和视觉 AI 应用的卓越图形功能。测评板子也十分漂亮,IO接口十分丰富。RA8D1开发是支持e2studio和MDK两种IDE平台的,本次进行MDK的环境搭建。
下载开发资源,瑞萨RA8D1软件包下载git下载地址https://github.com/renesas/fsp/releases
RA8D1的MDK开发环境搭需要的软件包如下
安装比较简单,默认安装即可,然后进行工程搭建测试。本次实验目的是实现基于FreeRTOS下的led点灯和串口测试。
首先打开Renesas RA Smart Configurator 5.4.0,选择芯片
点击next
选择FreeRTOS
首先进行时钟设置,由原理图可知外部晶振为24MHz,工程默认是20MHz,需要更改一下
接下来配置LED接口,并创建led线程,由原理图可知LED的引脚为PA01。
IO配置如下
进行FreeRTOS线程创建,先、添加内存管理heap4
创建led Thread,配置如下
然后点击创建工程,生成工程如下
打开工程,生成的目录如下
编译一下
先写个LED闪烁,1秒2次,
void led_thread_entry(void *pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
/* TODO: add your own code here */
while (1)
{
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_10_PIN_01, BSP_IO_LEVEL_LOW);
vTaskDelay(100);
R_IOPORT_PinWrite(&g_ioport_ctrl, BSP_IO_PORT_10_PIN_01, BSP_IO_LEVEL_HIGH);
vTaskDelay(400);
}
}
配置一下烧录设置,首先添加下载算法
默认下载算法空间有问题,下载会提示错误
修改一下配置
修改如下
设置完成 烧录,点灯成功
接下来添加串口线程并进行printf重定向测试,由原理图可知串口3和板载的JLink的串口相连
通过MDK打开图形化配置
设置串口时钟
配置串口3引脚
增加UART3_Thread
配置串口3
点击生成代码
编译一下,提示有错误
这是没有添加回调函数造成的,现在添加一下回调函数,先写个串口回环测试
#include "uart3_thread.h"
/* uart3_thread entry function */
/* pvParameters contains TaskHandle_t */
void uart3_thread_entry(void *pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
fsp_err_t err = FSP_SUCCESS;
err = R_SCI_B_UART_Open (&g_uart3_ctrl, &g_uart3_cfg);
assert(FSP_SUCCESS == err);
/* TODO: add your own code here */
while (1)
{
vTaskDelay(1000);
}
}
/* 发送完成标志 */
volatile bool uart_send_complete_flag = false;
/* 串口中断回调 */
void uart3_callback (uart_callback_args_t * p_args)
{
switch (p_args->event)
{
case UART_EVENT_RX_CHAR:
{
/* 把串口接收到的数据发送回去 */
R_SCI_B_UART_Write(&g_uart3_ctrl, (uint8_t *)&(p_args->data), 1);
break;
}
case UART_EVENT_TX_COMPLETE:
{
uart_send_complete_flag = true;
break;
}
default:
break;
}
}
烧录测试
Printf重定向,打印测试
int fputc(int ch, FILE *f)
{
(void)f;
R_SCI_B_UART_Write(&g_uart3_ctrl, (uint8_t *)&ch, 1);
while(uart_send_complete_flag == false);
uart_send_complete_flag = false;
return ch;
}
void uart3_thread_entry(void *pvParameters)
{
FSP_PARAMETER_NOT_USED(pvParameters);
fsp_err_t err = FSP_SUCCESS;
/* 初始化串口3 */
err = R_SCI_B_UART_Open (&g_uart3_ctrl, &g_uart3_cfg);
assert(FSP_SUCCESS == err);
/* TODO: add your own code here */
while (1)
{
printf("CPU : RA8D1BH, 主频: %dMHz\r\n", SystemCoreClock / 1000000);
vTaskDelay(1000);
}
}
至此,环境搭建测试结束
总结:瑞萨的MDK环境搭建还是非常简单的,图形化配置也十分的方便好用,而且STACKS图形化配置的设计更加直观。
- 2024-06-26
-
回复了主题帖:
测评入围名单: 瑞萨RA8D1开发板,基于M85内核的图形MCU
个人信息无误,确认可以完成测评分享计划
- 2024-02-19
-
回复了主题帖:
2024开工大吉,你期待测评中心,能有哪些板卡或书籍等?
模拟电子电路
- 2024-01-18
-
回复了主题帖:
【STM32MP135F-DK】裸机printf测试
镜花水月000 发表于 2024-1-18 20:10
现在补上0.0
[localvideo]18f365a5d9129db4ab332012ebd4f784[/localvideo]
-
回复了主题帖:
【STM32MP135F-DK】裸机printf测试
Jacktang 发表于 2024-1-13 20:48
测试效果如果整个视频,看看蓝色LED不同的闪烁就更完美
现在补上0.0
- 2024-01-13
-
发表了主题帖:
【STM32MP135F-DK】裸机printf测试
在上一贴点亮LED工程的基础上,本贴进行串口printf的裸机测试。工程参考自官网例程
使能串口4
huart4.Instance = UART4;
huart4.Init.BaudRate = 115200;
huart4.Init.WordLength = UART_WORDLENGTH_8B;
huart4.Init.StopBits = UART_STOPBITS_1;
huart4.Init.Parity = UART_PARITY_NONE;
huart4.Init.Mode = UART_MODE_TX_RX;
huart4.Init.HwFlowCtl = UART_HWCONTROL_NONE;
huart4.Init.OverSampling = UART_OVERSAMPLING_8;
huart4.Init.OneBitSampling = UART_ONE_BIT_SAMPLE_DISABLE;
huart4.Init.ClockPrescaler = UART_PRESCALER_DIV1;
huart4.AdvancedInit.AdvFeatureInit = UART_ADVFEATURE_NO_INIT;
if (HAL_UART_Init(&huart4) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetTxFifoThreshold(&huart4, UART_TXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_SetRxFifoThreshold(&huart4, UART_RXFIFO_THRESHOLD_1_8) != HAL_OK)
{
Error_Handler();
}
if (HAL_UARTEx_DisableFifoMode(&huart4) != HAL_OK)
{
Error_Handler();
}
移植官方的printf重定向和测试函数
PUTCHAR_PROTOTYPE
{
/* Place your implementation of fputc here */
/* e.g. write a character to the UART4 and Loop until the end of transmission */
HAL_UART_Transmit(&huart4, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
GETCHAR_PROTOTYPE
{
uint8_t ch = 0;
/* Clear the Overrun flag just before receiving the first character */
__HAL_UART_CLEAR_OREFLAG(&huart4);
HAL_UART_Receive(&huart4, (uint8_t *)&ch, 1, 0xFFFF);
HAL_UART_Transmit(&huart4, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
void Test_Validation_Menu(void)
{
int menu_option = 0;
uint8_t stop_test = 0;
char menu_select[5];
char menu1[] ="Test1";
char menu2[] ="Test2";
char menu3[] ="Test3";
char menu_init[] ="MENU0";
uint8_t duration = 0;
do
{
printf("\r\n Select the test options:\r\n");
printf("\r\n Test1: Fast Toggle LED");
printf("\r\n Test2: Slow Toggle LED");
printf("\r\n Test3: Exit \r\n");
strcpy(menu_select, menu_init);
menu_option=0;
duration=0;
menu_option = Serial_Scanf(menu_select,5);
/* CASE 'Test1' selected */
if(strncmp(menu_select, menu1, menu_option) == 0)
{
printf("\r\n ** Start Fast Toggle Test : see LED_GREEN!\r\n");
while(duration < 50)
{
/* Toggle LED_GREEN for error */
BSP_LED_Toggle(LED_GREEN);
HAL_Delay(100);
duration++;
}
printf("\r\n ** Fast Toggle Test is Finished!\r\n");
}
/* CASE 'Test2' selected */
else if(strncmp(menu_select, menu2, menu_option) == 0)
{
printf("\r\n ** Start Slow Toggle Test : see LED_GREEN!\r\n");
while(duration < 10)
{
/* Toggle LED_GREEN for error */
BSP_LED_Toggle(LED_GREEN);
HAL_Delay(500);
duration++;
}
printf("\r\n ** Slow Toggle Test is Finished!\r\n");
}
/* CASE 'Exit' selected */
else if(strncmp(menu_select, menu3, menu_option) == 0)
{
printf("\n\r >> Getchar = Test finished successfully. ** \n\r");
stop_test=1;
}
/* CASE wrong selection */
else
{
printf("\r\n !! INVALID CHOICE\r\n");
}
} while (stop_test != 1);
}
/* USER CODE END 4 */
最后下载测试,下载方法见我上一贴
下面是测试效果,可以看到输入不同的指令,蓝色LED会有不同的闪烁现象。
- 2023-12-17
-
回复了主题帖:
【STM32MP135F-DK】2.Bare Metal SD卡的烧录方法和注意事项
Jacktang 发表于 2023-12-16 20:54
烧录的SD卡一定不要有任何的数据和文件系统,这个是成功运行的关键,这个提醒一定要收藏哈
-
发表了主题帖:
【STM32MP135F-DK】3.Bare Metal 点亮LED
1.打开STM32CubeMX,选择MP13 Bare Metal
2.使能外部晶振和DDR
3.配置时钟
4.STM32MP135F-DK开发板的蓝灯对应的是PA14,所以配置一下PA14
5.创建工程
6.修改.ld文件SYSRAM_BASE改为DDR_BASE
7.加入USE_DDR宏定义
8.配置签名文件的路径
../../../../ImageHeader/postbuild_STM32MP13.sh"${gnu_tools_for_stm32_compiler_path}" "${BuildArtifactFileBaseName}"
官方的ImageHeader我复制到了我的工程目录下,如有不同请更改路径配置
9.写入一段点灯代码,我实现的功能是满闪1次快闪2次,先屏蔽掉SystemClock_Config函数的Error_Handler(),因为会进入错误造成死循环,为什么时钟会错误,原因未知,不知道是不是官方的bug,还没搞清楚如何仿真我这里先忽略这个问题。
10.编译,如图所示显示编译成功,已经生成了.stm32烧录文件
11.打开官方的tsv文件,更改为我的固件
12.烧录下载,具体烧录方法见我上一帖
13.重启运行,点灯成功!
总结:
STM32CubeMX生成的工程文件需要注意一下工程配置,这个相对于我们用的MCU会繁琐一些。
2.目前STM32CubeMX生成的工程文件,时钟配置函数会进入错误,原因未知,希望有了解的小伙伴可以交流一下。
3.目前感觉裸机运行烧录调试不如我们用的MCU灵活,每次烧录感觉太慢了,可能是之前用习惯像MDK、IAR这种IDE的原因,不过官方后期可能会支持IAR,但可能不会支持MDK。
4.下面附上我的工程,欢迎小伙伴们一起交流学习。
- 2023-12-16
-
发表了主题帖:
【STM32MP135F-DK】2.Bare Metal SD卡的烧录方法和注意事项
之前的实验能够下载,但是芯片没有运行起来,经过进一步的学习得知STM32MP135在进行裸机开发时,SD卡必须进行格式化,而且不能有任何的文件系统和数据,下面是我的SD卡格式化方法,用到的工具是DiskGenius。
1.由于之前已经烧录完linux镜像,所以先删除SD卡的所有分区 。并保存
2.清除扇区内的所有数据,这个过程比较漫长一些,需要耐心等待。
3,重新烧录一下官方的裸机SD卡启动例程的固件SD_Ext_Loader,将boot模式选择UART BOOT0/1/2 to OFF,复位,然后连接烧录软件。
4.烧录完成后,断开连接,boot模式选择SD卡启动BOOT0 and BOOT2 to ON and BOOT1 to OFF,然后重新上电
5.重启,发现裸机实验终于成功运行,板载的蓝色LED也终于闪烁起来。
STM32MP135裸机烧录总结:
STM32MP135裸机SD启动直接使用官方固件包的SD_Ext_Loader固件,官方固件可以直接烧录测试。
烧录的SD卡一定不要有任何的数据和文件系统,这个是成功运行的关键
下面附上官方裸跑应用程序的回放连接
https://www.bilibili.com/video/BV1ti4y1e7ZN/?spm_id_from=444.41.list.card_archive.click&vd_source=64646941942975ed03a089b692ab5128