From f97f87fdcd6e391b7ee4d471246ea4358d8e9611 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 17 May 2021 16:17:20 +0200 Subject: [PATCH] docs link fixes --- docs/get-started/quick-overview.md | 4 +-- docs/intro/index.md | 4 +-- docs/layouts/flex.md | 2 +- docs/layouts/grid.md | 2 +- docs/overview/display.md | 2 +- docs/overview/event.md | 2 +- docs/overview/file-system.md | 2 +- docs/overview/image.md | 4 +-- docs/overview/object.md | 2 +- docs/overview/style.md | 18 ++++++------ docs/overview/timer.md | 2 +- docs/porting/os.md | 8 +++--- docs/porting/task-handler.md | 6 ++-- docs/widgets/extra/chart.md | 2 +- docs/widgets/extra/colorwheel.md | 2 +- docs/widgets/obj.md | 2 +- examples/widgets/chart/index.rst | 32 +++++++++++++++++++-- examples/widgets/chart/lv_example_chart_4.c | 2 +- examples/widgets/slider/index.rst | 2 +- examples/widgets/table/index.rst | 2 +- 20 files changed, 64 insertions(+), 38 deletions(-) diff --git a/docs/get-started/quick-overview.md b/docs/get-started/quick-overview.md index 8f4b86b70..3d066b54e 100644 --- a/docs/get-started/quick-overview.md +++ b/docs/get-started/quick-overview.md @@ -72,7 +72,7 @@ bool my_touchpad_read(lv_indev_t * indev, lv_indev_data_t * data) /*`touchpad_is_pressed` and `touchpad_get_xy` needs to be implemented by you*/ if(touchpad_is_pressed()) { data->state = LV_INDEV_STATE_PRESSED; - touchpad_get_xy(&data->point.x, &data->point.y); + touchpad_get_xy(&data->point.x, &data->point.y); } else { data->state = LV_INDEV_STATE_RELEASED; } @@ -82,7 +82,7 @@ bool my_touchpad_read(lv_indev_t * indev, lv_indev_data_t * data) - Call `lv_timer_handler()` periodically every few milliseconds in the main `while(1)` loop or in an Operation system task. It will redraw the screen if required, handle input devices, animation etc. -For a more detailed guide go to the [Porting](/porting/index.html) section. +For a more detailed guide go to the [Porting](/porting/index) section. ## Learn the basics diff --git a/docs/intro/index.md b/docs/intro/index.md index f7111db79..57fc45a20 100644 --- a/docs/intro/index.md +++ b/docs/intro/index.md @@ -58,8 +58,8 @@ It's not mandatory but we highly appreciate it if you write a few words about yo Although you can get LVGL for free there is a huge work behind it. It's created by a group of volunteers who made it available for you in their free time. -To make the LVGL project sustainable, please consider [Contributing](/contributing/index) to the project. -You can choose from [many ways of contributions](/contributing/index) such as simply writing a tweet about you are using LVGL, fixing bugs, translating the documentation, or even becoming a maintainer. +To make the LVGL project sustainable, please consider [Contributing](/CONTRIBUTING) to the project. +You can choose from [many ways of contributions](/CONTRIBUTING) such as simply writing a tweet about you are using LVGL, fixing bugs, translating the documentation, or even becoming a maintainer. ## Repository layout All repositories of the LVGL project are hosted n GitHub: https://github.com/lvgl diff --git a/docs/layouts/flex.md b/docs/layouts/flex.md index 14f2d1a75..30989d5da 100644 --- a/docs/layouts/flex.md +++ b/docs/layouts/flex.md @@ -99,7 +99,7 @@ You can force Flex to put an item into a new line with `lv_obj_add_flag(child, L ```eval_rst -.. include:: ../../../examples/layouts/flex/index.rst +.. include:: ../../examples/layouts/flex/index.rst ``` diff --git a/docs/layouts/grid.md b/docs/layouts/grid.md index 6b41656dc..251930125 100644 --- a/docs/layouts/grid.md +++ b/docs/layouts/grid.md @@ -96,7 +96,7 @@ The columns will be placed from right to left. ```eval_rst -.. include:: ../../../examples/layouts/grid/index.rst +.. include:: ../../examples/layouts/grid/index.rst ``` diff --git a/docs/overview/display.md b/docs/overview/display.md index b049c931f..4edf4c346 100644 --- a/docs/overview/display.md +++ b/docs/overview/display.md @@ -51,7 +51,7 @@ Be sure not to confuse displays and screens: Screens can be considered the highest level containers which have no parent. The screen's size is always equal to its display and size their position is (0;0). Therefore, the screens coordinates can't be changed, i.e. `lv_obj_set_pos()`, `lv_obj_set_size()` or similar functions can't be used on screens. -A screen can be created from any object type but, the two most typical types are the [Base object](/widgets/obj) and the [Image](/widgets/img) (to create a wallpaper). +A screen can be created from any object type but, the two most typical types are the [Base object](/widgets/obj) and the [Image](/widgets/core/img) (to create a wallpaper). To create a screen, use `lv_obj_t * scr = lv__create(NULL, copy)`. `copy` can be an other screen to copy it. diff --git a/docs/overview/event.md b/docs/overview/event.md index 5b942e983..5bf75bee1 100644 --- a/docs/overview/event.md +++ b/docs/overview/event.md @@ -146,7 +146,7 @@ lv_event_send(mbox, LV_EVENT_VALUE_CHANGED, &btn_id); `lv_event_t` is the only parameter passed to event callback and it contains all the data about the event. The following values can be get from it: - `lv_event_get_code(e)` get the event code - `lv_event_get_target(e)` get the object to which the event is sent -- `lv_event_get_original_target(e)` get the object to which the event is sent originally sent (different from `lv_event_get_target` if [event bubbling](event-bubbling) is enabled) +- `lv_event_get_original_target(e)` get the object to which the event is sent originally sent (different from `lv_event_get_target` if [event bubbling](#event-bubbling) is enabled) - `lv_event_get_user_data(e)` get the pointer passed as the last parameter of `lv_obj_add_event_cb`. - `lv_event_get_param(e)` get the parameter passed as the last parameter of `lv_event_send` diff --git a/docs/overview/file-system.md b/docs/overview/file-system.md index fddc975cd..58ab74c56 100644 --- a/docs/overview/file-system.md +++ b/docs/overview/file-system.md @@ -96,7 +96,7 @@ lv_fs_dir_close(&dir); ## Use drivers for images -[Image](/widgets/img) objects can be opened from files too (besides variables stored in the flash). +[Image](/widgets/core/img) objects can be opened from files too (besides variables stored in the flash). To initialize the image, the following callbacks are required: - open diff --git a/docs/overview/image.md b/docs/overview/image.md index 52d2eec75..305787d2c 100644 --- a/docs/overview/image.md +++ b/docs/overview/image.md @@ -108,11 +108,11 @@ static lv_img_dsc_t my_img_dsc = { If the color format is `LV_IMG_CF_TRUE_COLOR_ALPHA` you can set `data_size` like `80 * 60 * LV_IMG_PX_SIZE_ALPHA_BYTE`. -Another (possibly simpler) option to create and display an image at run-time is to use the [Canvas](/widgets/canvas) object. +Another (possibly simpler) option to create and display an image at run-time is to use the [Canvas](/widgets/core/canvas) object. ### Use images -The simplest way to use an image in LVGL is to display it with an [lv_img](/widgets/img) object: +The simplest way to use an image in LVGL is to display it with an [lv_img](/widgets/core/img) object: ```c lv_obj_t * icon = lv_img_create(lv_scr_act(), NULL); diff --git a/docs/overview/object.md b/docs/overview/object.md index c85162f58..d9b58782d 100644 --- a/docs/overview/object.md +++ b/docs/overview/object.md @@ -5,7 +5,7 @@ # Objects In the LVGL the **basic building blocks** of a user interface are the objects, also called *Widgets*. -For example a [Button](/widgets/core/btn), [Label](/widgets/core/label), [Image](/widgets/core/img), [List](/widgets/core/list), [Chart](/widgets/extra/chart) or [Text area](/widgets/core/textarea). +For example a [Button](/widgets/core/btn), [Label](/widgets/core/label), [Image](/widgets/core/img), [List](/widgets/extra/list), [Chart](/widgets/extra/chart) or [Text area](/widgets/core/textarea). Check all the [Object types](/widgets/index) here. diff --git a/docs/overview/style.md b/docs/overview/style.md index 29c01547e..d49c528db 100644 --- a/docs/overview/style.md +++ b/docs/overview/style.md @@ -104,7 +104,7 @@ The following predefined parts exist in LVGL: - `LV_PART_CUSTOM_FIRST` Custom parts can be added from here. -For example a [Slider](/widgets/slider) has three parts: +For example a [Slider](/widgets/core/slider) has three parts: - Background - Indiactor - Knob @@ -327,19 +327,17 @@ void new_theme_apply_cb(lv_theme_t * th, lv_obj_t * obj) ## API ```eval_rst -.. doxygenfile:: lv_obj_style.h - :project: lvgl - -.. doxygenfile:: lv_obj_style_dec.h - :project: lvgl - .. doxygenfile:: lv_style.h :project: lvgl - -.. doxygenfile:: lv_style_dec.h - :project: lvgl .. doxygenfile:: lv_theme.h :project: lvgl +.. doxygenfile:: lv_obj_style_gen.h + :project: lvgl + +.. doxygenfile:: lv_style_gen.h + :project: lvgl + + ``` diff --git a/docs/overview/timer.md b/docs/overview/timer.md index ed30c5a4c..37cb18539 100644 --- a/docs/overview/timer.md +++ b/docs/overview/timer.md @@ -5,7 +5,7 @@ # Timers LVGL has a built-in timer system. You can register a function to have it be called periodically. The timers are handled and called in `lv_timer_handler()`, which needs to be called periodically every few milliseconds. -See [Porting](/porting/timer-handler) for more information. +See [Porting](/porting/task-handler) for more information. The timers are non-preemptive, which means a timer cannot interrupt another timer. Therefore, you can call any LVGL related function in a timer. diff --git a/docs/porting/os.md b/docs/porting/os.md index f21d78cbc..fc10e6c37 100644 --- a/docs/porting/os.md +++ b/docs/porting/os.md @@ -8,14 +8,14 @@ LVGL is **not thread-safe** by default. However, in the following conditions it's valid to call LVGL related functions: - In *events*. Learn more in [Events](/overview/event). -- In *lv_tasks*. Learn more in [Tasks](/overview/task). +- In *lv_timer*. Learn more in [Timers](/overview/timter). ## Tasks and threads -If you need to use real tasks or threads, you need a mutex which should be invoked before the call of `lv_task_handler` and released after it. +If you need to use real tasks or threads, you need a mutex which should be invoked before the call of `lv_timer_handler` and released after it. Also, you have to use the same mutex in other tasks and threads around every LVGL (`lv_...`) related function calls and codes. This way you can use LVGL in a real multitasking environment. Just make use of a mutex to avoid the concurrent calling of LVGL functions. ## Interrupts -Try to avoid calling LVGL functions from the interrupts (except `lv_tick_inc()` and `lv_disp_flush_ready()`). But, if you need to do this you have to disable the interrupt which uses LVGL functions while `lv_task_handler` is running. -It's a better approach to set a flag or some value and periodically check it in an `lv_task`. +Try to avoid calling LVGL functions from the interrupts (except `lv_tick_inc()` and `lv_disp_flush_ready()`). But, if you need to do this you have to disable the interrupt which uses LVGL functions while `lv_timer_handler` is running. +It's a better approach to set a flag or some value and periodically check it in an `lv_timer`. diff --git a/docs/porting/task-handler.md b/docs/porting/task-handler.md index c52e2675b..0133cdb4f 100644 --- a/docs/porting/task-handler.md +++ b/docs/porting/task-handler.md @@ -4,7 +4,7 @@ ``` # Task Handler -To handle the tasks of LVGL you need to call `lv_task_handler()` periodically in one of the followings: +To handle the tasks of LVGL you need to call `lv_timer_handler()` periodically in one of the followings: - *while(1)* of *main()* function - timer interrupt periodically (low priority then `lv_tick_inc()`) - an OS task periodically @@ -14,10 +14,10 @@ The timing is not critical but it should be about 5 milliseconds to keep the sys Example: ```c while(1) { - lv_task_handler(); + lv_timer_handler(); my_delay_ms(5); } ``` -To learn more about task visit the [Tasks](/overview/task) section. +To learn more about timers visit the [Timer](/overview/timer) section. diff --git a/docs/widgets/extra/chart.md b/docs/widgets/extra/chart.md index d1a537ba1..46e202cbd 100644 --- a/docs/widgets/extra/chart.md +++ b/docs/widgets/extra/chart.md @@ -137,7 +137,7 @@ Learn more about [Keys](/overview/indev). ```eval_rst -.. include:: ../../../examples/widgets/lv_example_chart/index.rst +.. include:: ../../../examples/widgets/chart/index.rst ``` diff --git a/docs/widgets/extra/colorwheel.md b/docs/widgets/extra/colorwheel.md index 9c9b02a16..fd1326020 100644 --- a/docs/widgets/extra/colorwheel.md +++ b/docs/widgets/extra/colorwheel.md @@ -46,7 +46,7 @@ Learn more about [Keys](/overview/indev). ```eval_rst -.. include:: ../../../examples/widgets/lv_example_colorwheel/index.rst +.. include:: ../../../examples/widgets/colorwheel/index.rst ``` diff --git a/docs/widgets/obj.md b/docs/widgets/obj.md index 0626429a2..55f719a47 100644 --- a/docs/widgets/obj.md +++ b/docs/widgets/obj.md @@ -21,7 +21,7 @@ The Base object can be directly used as a simple widgets. It nothing else than a ### Coordinates -Here only a small subset of cooridnate settings is described. To see all the features of LVGL (padding, cooridnates in styles, layouts, etc) visit the [Coordinates](overview/coord) page. +Here only a small subset of cooridnate settings is described. To see all the features of LVGL (padding, cooridnates in styles, layouts, etc) visit the [Coordinates](/overview/coords) page. #### Size The object size can be modified on individual axes with `lv_obj_set_width(obj, new_width)` and `lv_obj_set_height(obj, new_height)`, or both axes can be modified at the same time with `lv_obj_set_size(obj, new_width, new_height)`. diff --git a/examples/widgets/chart/index.rst b/examples/widgets/chart/index.rst index 4d331205e..99c5e78b4 100644 --- a/examples/widgets/chart/index.rst +++ b/examples/widgets/chart/index.rst @@ -4,10 +4,38 @@ C Line Chart """""""""" -.. lv_example:: lv_ex_widgets/lv_ex_chart/lv_ex_chart_1 +.. lv_example:: widgets/chart/lv_example_chart_1 :language: c + + +Faded area line chart with custom division lines +""""""""""""""""""""""""""""""""""""""""""""""""""" -.. lv_example:: lv_ex_widgets/lv_ex_chart/lv_ex_chart_2 +.. lv_example:: widgets/chart/lv_example_chart_2 + :language: c + +Axis ticks and labels with scrolling +"""""""""""""""""""""""""""""""""""" + +.. lv_example:: widgets/chart/lv_example_chart_3 + :language: c + +Show the value of the pressed points +"""""""""""""""""""""""""""""""""""""" + +.. lv_example:: widgets/chart/lv_example_chart_4 + :language: c + +Display 1000 data points with zooming and scrolling +""""""""""""""""""""""""""""""""""""""""""""""""""" + +.. lv_example:: widgets/chart/lv_example_chart_5 + :language: c + + Show cursor on the clicked point +""""""""""""""""""""""""""""""""""" + +.. lv_example:: widgets/chart/lv_example_chart_6 :language: c diff --git a/examples/widgets/chart/lv_example_chart_4.c b/examples/widgets/chart/lv_example_chart_4.c index d447523df..838669819 100644 --- a/examples/widgets/chart/lv_example_chart_4.c +++ b/examples/widgets/chart/lv_example_chart_4.c @@ -54,7 +54,7 @@ static void event_cb(lv_event_t * e) } /** - * Add ticks and labels to the axis and demonstrate scrolling + * Show the value of the pressed points */ void lv_example_chart_4(void) { diff --git a/examples/widgets/slider/index.rst b/examples/widgets/slider/index.rst index 376bf69be..6d496094e 100644 --- a/examples/widgets/slider/index.rst +++ b/examples/widgets/slider/index.rst @@ -14,7 +14,7 @@ Slider with custom style :language: c Slider with extended drawer -""""""""""""""""""""""""" +"""""""""""""""""""""""""""" .. lv_example:: widgets/slider/lv_example_slider_3 :language: c diff --git a/examples/widgets/table/index.rst b/examples/widgets/table/index.rst index 2eb18efb1..edbe74094 100644 --- a/examples/widgets/table/index.rst +++ b/examples/widgets/table/index.rst @@ -8,7 +8,7 @@ Simple table :language: c Lightweighted list from table -""""""""""""""""""""""" +"""""""""""""""""""""""""""""" .. lv_example:: widgets/table/lv_example_table_2 :language: c