| /documentation/3.kernel/thread-comm/ |
| A D | thread-comm.md | 47 …a structure that contains important parameters related to mailbox and it plays an important role i… 215 static char mb_str1[] = "I'm a mail!"; 283 /* Initialize a mailbox */ 327 thread1: try to recv a mail 328 thread1: get a mail from mailbox, the content:I'm a mail! 329 msh >thread1: try to recv a mail 332 thread1: try to recv a mail 334 thread1: try to recv a mail 352 …or such a message structure, it contains a pointer pointing to data `data_ptr` and a variable `dat… 815 …a mailbox as a confirmation flag, while the second type of message uses a semaphore as a confirmat… [all …]
|
| /documentation/3.kernel/thread-sync/ |
| A D | thread-sync.md | 320 t1 release a dynamic semaphore. 322 t1 release a dynamic semaphore. 324 t1 release a dynamic semaphore. 326 t1 release a dynamic semaphore. 328 t1 release a dynamic semaphore. 330 t1 release a dynamic semaphore. 332 t1 release a dynamic semaphore. 334 t1 release a dynamic semaphore. 336 t1 release a dynamic semaphore. 410 /* Pause for a while */ [all …]
|
| /documentation/ |
| A D | Doxyfile | 6 # All text after a double hash (##) is considered a comment and is placed in 9 # All text after a single hash (#) is considered a comment and will be ignored. 29 # The PROJECT_NAME tag is a single word (or a sequence of words surrounded by 44 # for a project that appears at the top of each page and should give viewer a 142 # doxygen will generate a detailed section even if there is only a brief 221 # to treat a multi-line C++ comment block as a detailed description. Set this 266 # alias to insert a newline as if a physical newline was in the original file. 410 # (for instance a group of public functions) to be put as a subgroup of that 439 # When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or 772 # Note that if you run doxygen from a directory containing a file called [all …]
|
| /documentation/6.components/posix/ |
| A D | README.md | 253 | EINVAL | Join a thread with a detached state | 516 | EDEADLK | Mutexes mutex do not call this function repeatedly for a thread with a nested lock | 549 | EPERM | This function is called repeatedly by a thread when the mutex is not a nested lock | 624 /* Initialize a mutex */ 744 ## Send a Conditional Semaphore 783 /* Statically initialize a mutex and a condition variable */ 860 pthread_cond_signal(&cond); /* send a Signal to wake up a thread */ 1188 ## Create a Barrier 1358 …e corresponds to a semaphore control block. Before creating a semaphore, you need to define a sem_… 1688 ## Create or Open a Message Queue [all …]
|
| /documentation/3.kernel/thread/ |
| A D | thread.md | 95 The five states of a thread in RT-Thread are shown in the following table: 137 …a real-time system, with clear priorities, if a program in a thread is stuck in an infinite loop, … 182 >In RT-Thread, a thread does not actually have a running state; the ready state and the running sta… 206 …a dynamic thread and `rt_thread_init()` to initialize a static thread. The difference between a dy… 212 To become an executable object, a thread must be created by the kernel of the operating system. You… 258 The initialization of a thread can be done using the following function interface, to initialize a … 402 When you need other control over a thread, such as dynamically changing the priority of a thread, y… 421 •RT_THREAD_CTRL_CHANGE_PRIORITY:dynamically change the priority of a thread; 468 | hook | Represents a user-defined hook function pointer | 523 /* Thread 2 has a higher priority to preempt thread 1 and get executed */ [all …]
|
| /documentation/3.kernel/memory/ |
| A D | memory.md | 43 …a simple memory allocation algorithm. Initially, it is a large piece of memory. When a memory bloc… 53 Each memory block (whether it is an allocated memory block or a free memory block) contains a data … 71 Each memory block (whether it is an allocated memory block or a free memory block) contains a data … 166 Allocate a memory block of user-specified size from the memory heap. The function interface is as f… 238 When allocating memory blocks, user can set a hook function. The function interface called is as fo… 267 When releasing memory, user can set a hook function, the function interface called is as follows: 297 This is an example of a memory heap application. This program creates a dynamic thread that dynamic… 442 …a memory pool, a memory pool object is created first and then a memory heap is allocated from the … 528 To allocate a memory block from the specified memory pool, use the following interface: 589 /* Trying to apply for a memory block 50 times, when no memory block is available, [all …]
|
| /documentation/6.components/network/ |
| A D | network.md | 176 ## Create a Socket 202 /* Create a socket, type is SOCKET_STREAM,TCP type */ 229 ## Establishing a TCP Connection 514 * This is a tcp client routine 607 /* Print the recv function returns a warning message with a value of 0 */ 645 /* Print the send function returns a warning message with a value of 0 */ 651 MSH_CMD_EXPORT(tcpclient, a tcp client sample); 654 When running the example, first open a network debugging assistant on your computer and open a TCP … 680 got a 'q' or 'Q',close the socket. 694 * This is a udp client routine [all …]
|
| /documentation/4.tool/scons/ |
| A D | scons.md | 75 …ator` directory , you can use the following command to generate a project for vs2012 or a project … 90 …ation on multi-core computers. In general, a cpu core can support 2 threads. Use the `scons -j4` … 155 Split the string str into a list list. 159 …a method (function) of RT-Thread based on the SCons extension. DefineGroup is used to define a com… 191 Below we will use a few SConscript as an example to explain how to use the scons tool. 217 …a python for loop that walks through all the subdirectories of the BSP and runs the SConscript fil… 265 The next line uses the `Split()` function to split a file string into a list, the effect of which … 271 * `CPPPATH = [cwd]:` Save the current path to a list variable CPPPATH. 427 menu "hello module" # create a "hello module" menu 487 `rtconfig.py` is a RT-Thread standard compiler configuration file that controls most of the compila… [all …]
|
| /documentation/6.components/filesystem/ |
| A D | README.md | 58 2. Initialize a specific type of file system. 59 3. Create a block device on the memory. 89 ## Register a Storage Device as a Block Device 160 ## Unmount a file system 260 To rename a file, use the `rename()` function: 381 | mode | create a pattern | 443 | dirent | read successfully and return to a structure pointer to a directory entry | 801 ## Create a Directory Example 813 /* create a directory */ 817 /* fail to create a directory */ [all …]
|
| /documentation/3.kernel/timer/ |
| A D | timer.md | 75 …mer refers to triggering an event after a certain specified time from a specified moment, for exam… 79 …** is a type of system interface provided by the operating system. It is built on the basis of the… 85 …a one-shot timer, which only triggers a timer event for onetime after startup, and then the timer … 117 …a new task has created Timer4 with 300 ticks, so the Timer4's timeout is equal to rt_tick add 300,… 145 …a data structure based on a parallel linked list, which is simple to implement, and the time compl… 183 When dynamically creating a timer, the following function interface can be used: 238 When creating a timer statically , the timer can be initialized by using `rt_timer_init` interface.… 261 When a static timer does not need to be used again, you can use the following function interface: 339 #define RT_TIMER_CTRL_SET_ONESHOT 0x2 /* Set the timer as a oneshot timer. */ 340 #define RT_TIMER_CTRL_SET_PERIODIC 0x3 /* Set the timer as a periodic timer */ [all …]
|
| /documentation/6.components/utest/ |
| A D | utest.md | 5 …a unit testing framework developed by RT-Thread. The original intention of designing utest is to m… 9 …a single test performed to achieve a specific test objective. It is a specification that includes … 13 The test code for a function, specifically through the API provided by the utest framework, is a te… 27 To enable uniform test case code, the test framework utest provides a common API interface for test… 40 | uassert_not_null(value)| If the value is a non-null value, the test passes, otherwise the test fa… 41 | uassert_int_equal(a, b)| If the values of a and b are equal, the test passes, otherwise the test … 42 | uassert_int_not_equal(a, b)| If the values of a and b are not equal, the test passes, otherwise t… 43 | uassert_str_equal(a, b) | If the string a and the string b are the same, the test passes, othe… 44 | uassert_str_not_equal(a, b)| If the string a and the string b are not the same, the test passes, … 265 * The utest framework is a sequential execution of all **test units** in the *testcase* function [all …]
|
| /documentation/3.kernel/interrupt/ |
| A D | interrupt.md | 30 …a Cortex-M4 or Cortex-M7 with a floating point unit, the control register is also used to indicate… 212 /* create a semaphore to respond to Bottom Half events */ 238 Let's take a look at how Top Half is handled in demo_nw_isr and how Bottom Half is opened, as in th… 249 /* Release nw_bh_sem, send a signal to demo_nw_thread, ready to start Bottom Half */ 283 | param | param is passed as a parameter to the interrupt service routine | 290 …a kind of runtime environment that requires special attention. It runs in a non-threaded execution… 365 a = a + value; 370 …ck, you need to ensure that the interrupt is turned off for a very short time, such as a = a + val… 375 a = a + value; 380 … locks to protect semaphore internal variables, so for operations such as a = a + value;, it is mo… [all …]
|
| /documentation/6.components/finsh/ |
| A D | finsh.md | 3 …a keyboard. How did people interact with computers at the time? The earliest computers used a punc… 11 … a set of operation interfaces for users to call from the command line. It is mainly used to debug… 17 When using a serial port to connect a device to a control terminal, the execution flow of the FinSH… 44 The command can be either a built-in command in RT-Thread or an executable file. 184 | size | The maximum number of messages a mailbox can hold | 293 The custom msh command can be run in msh mode. To export a command to msh mode, you can use the fol… 315 …a command with parameters, the function's input parameters are `int argc` and `char**argv`. Argc r… 339 The following example defines a `hello` function and exports it as a command in C-Style mode: 350 In a similar way, you can also export a variable that can be accessed through the following interfa… 362 The following example defines a `dummy` variable and exports it to a variable command in C-Style mo… [all …]
|
| /documentation/6.components/device-driver/ofw/ |
| A D | dtc.md | 5 Device Tree Compiler, dtc, takes as input a device-tree in a given format and outputs a device-tree… 6 …ally, the input format is "dts" (device-tree source), a human readable source format, and creates … 12 When you have a DTB or FDT file from firmware or another runtime system, you might want to convert … 27 This will generate a dummpy.dts in the current directory. If a file with the same name already exis… 28 To avoid overwriting, you can specify a different output name: 40 Before generating a DTB, you may want to review the basics of DTS syntax and structure: [DeviceTree… 83 /* When there is a calculation, please use "()" to include them */ 100 intc_a: intc-a { 186 For a vendor-specific variant (Vendor A):
|
| /documentation/6.components/at/ |
| A D | at.md | 421 ### Create a Response Structure 433 | != NULL | Successful, return a pointer to the response structure | 438 ### Delete a Response Structure 468 ### Send a Command and Receive a Response 478 | ... | Enter the command data list, a variable parameter | 585 | ... | Parsing the parameter list as a variable parameter | 593 ### Parse Response Data for a Row with Specified Keyword 604 | ... | Parsing the parameter list as a variable parameter | 610 This function is used to get a row of data containing a keyword in the AT Server response data and … 659 MAC=12:34:56:78:9a:bc\r\n [all …]
|
| /documentation/6.components/dlmodule/ |
| A D | README.md | 14 * `.so` is a dynamic library compiled with `.so` as a suffix; it can be loaded and resided in memor… 55 … the dynamic module is linked. The same is the PIC method, and is linked in a shared library (part… 57 …ully compiled, whether the corresponding dynamic module file needs to be copied to a unified place; 96 | md5 | Generate md5 code for a file | 98 | ymodem | Download a file to the file system through the serial port using the YModem protocol | 120 After compiling successfully, it will generate a `hello.mo` file in the `rtthread-apps/hello` direc… 130 …ile system. Under msh, you can simply execute the `hello.mo` dynamic module as a `hello` command: 171 … memory, and if it is loaded correctly, returns a pointer to the module. This function does not cr… 215 This function uses `name` to find out if there is already a dynamic module loaded in the system. 228 This function returns a pointer of the dynamic module in the calling context. [all …]
|
| /documentation/2.quick-start/ |
| A D | quick-start.md | 3 …e an RT-Thread compatible hardware module, or want to test out their ideas, a complete RT-Thread s… 5 …a complete integrated development environment (IDE) from ARM. It includes an efficient C/C++ compi… 7 …s the opportunity to run object code directly on the computer without using a real hardware enviro… 9 What will follow is a demonstration of RT-Thread running on a simulated STM32F103 microcontroller t… 13 …ion version, version 5.14 and above) needs to be installed. This version is a relatively new versi… 21 This example is a zip file, unzip it. The directory structure after decompression is as shown below: 40 In the directory, there is a file with the name "project.uvprojx", which is an MDK5 project file in… 86 # Example of a Marquee 88 …orld in every programming language programmers learn. So we will start with a marquee in the follo… 94 **Example of a Marquee** [all …]
|
| /documentation/7.contribution/ |
| A D | coding_style_en.md | 5 document is a guide for RT-Thread developers. Please obey it as you develop. 13 have descriptive names. For example, the port of a chip should be composed of 27 To avoid include the same header file for multiple times, you need to define a 139 There should be a space before parentheses when it's not a function call. For 152 In expressions, there should be a space between most binary and ternary 160 This is a bad practice. 165 In RT-Thread, rt_kprintf is a commonly used logging routine. In RT-Thread 166 rt_kprintf is implemented as a polling, non-interrupting string output. It is 173 Logging should be off by default and can be turned on by a switch (e.g. a 174 variable or a macro). When logging, it should be easy to understand and easy to [all …]
|
| /documentation/0.doxygen/example/ |
| A D | INDEX.md | 5 …o a hierarchical structure by using doxygen's [subpage mechanism][2]. To define a page, we use `@p… 7 …reeview on the left side of the browser. Each sub-chapter is organized into a hierarchical structu… 15 There are several ways to mark a comment block as a detailed description. We prefer JavaDoc-style (… 23 When you want to put documentation after members, we prefer a Qt style, like this: 35 This article provide an <a href="https://github.com/RT-Thread/rt-thread/blob/master/documentation/0… 62 $ lsb_release -a 88 …locally (in Ubuntu environment), you can enter the html directory and start a local HTML server th… 103 …ss the created html web pages. If it is a local access, then `<IP>` should be replaced by `localho… 115 There is a script can help you write comments more easily.You can copy the code to your setting.jso… 145 … Comment Blocks][5] extension can auto complete "*" at the start of line when you start a new line.
|
| /documentation/6.components/device-driver/uart/ |
| A D | uart.md | 93 An example of using a uart device in **interrupt receive mode and polling mode** as follows: 249 | The actual size of the written data | If it is a character device, the return size is in bytes; | 355 | Read the actual size of the data | If it is a character device, the return size is in bytes. | 412 3. Set the receive callback function of the uart device, then send the string and create a read dat… 413 …a character data. If there is no data, it will hang and wait for the semaphore. When the uart devi… 423 * Program list: This is a uart device usage routine 497 /* Create a serial thread */ 527 * Program list: This is a uart device DMA receive usage routine 617 msg_pool, /* a pool for storing messages */ 618 sizeof(struct rx_msg), /* The maximum length of a message*/ [all …]
|
| /documentation/6.components/device-driver/framework/ |
| A D | device.md | 23 * The device driver creates a device instance with hardware access capabilities based on the device… 40 …a kind of objects and is included in the scope of the object manager. Each device object is derive… 92 A block device transfers one data block at a time, for example 512 bytes data at a time. This data … 96 …a write operation with a large amount of data, the device driver must first divide the data into m… 141 When a dynamically created device is no longer needed, it can be destroyed using the following func… 184 … used to output a character string to the serial terminal: when the output character is `\n` , it … 242 /* register a character device */ 284 >When a device has been successfully initialized, calling this interface will not repeat initializa… 334 >Device interfaces `rt_device_open()` and `rt_device_close()` need to used in pairs. Open a device… 380 | Actual Size of the Data Read | If it is a character device, the return size is in bytes. If it is… [all …]
|
| /documentation/6.components/pm/ |
| A D | pm.md | 23 …nents adopt a layered design idea, separating architecture and chip-related parts, and extracting … 69 | PM_SLEEP_MODE_DEEP | 3 | Deep sleep mode, CPU stops, only a few low power peripheral work… 92 …a new mode of operation may lead to changes in CPU frequency. If peripherals and CPUs share a part… 128 …a lower level of power mode is requested, it will not be accessible. Only after releasing (unlocki… 194 If the system needs to enter a specified level of low power consumption, it can be achieved by call… 203 ## Protect a stage or process 205 In special cases, for example, the system is not allowed to enter a lower power mode at a certain s… 243 …/* The following three interfaces are used to start a low-power timer after cardiac arrest to comp… 260 /* Register a PM device */ 282 - **timer_start**: Start a low-power timer, and the input parameter is the latest next task readine… [all …]
|
| /documentation/6.components/device-driver/adc/ |
| A D | adc.md | 5 An ADC (analog-to-digital converter) is a hardware device that converts continuously changing analo… 13 …a certain amount of time for the analog signals obtained by sampling to be converted into digital … 15 …a numerically continuous analog quantity into a digital quantity is called quantization. Digital s… 23 …als and real ADC device numerical points’ values.An ADC with a high resolution might have a low pr… 27 …DC device to complete conversion from an analog to a digital signal. For example, an ADC device wi… 56 In a nutshell, the names of the ADC devices are registered as adc0, adc1, and so on. What follows i… 185 To read data from a channel of an ADC device, you can use the command `adc read` followed by the ch… 193 To close a channel of an ADC device, you can use the command `adc disable` followed by the channel … 216 …* Program function: The voltage value is sampled by the ADC device and converted to a numerical va…
|
| /documentation/6.components/device-driver/pwm/ |
| A D | pwm.md | 5 …a method of digitally encoding the level of an analog signal. The frequency of the square wave is … 9 …a simple schematic diagram of PWM. Assuming that the timer works in a up-counter mode. When the co… 11 One of the common PWM control scenarios is to adjust the brightness of a light or screen. The brigh… 73 The output frequency of the PWM is determined by the period. For example, the time of a period is 0… 165 To set the period and duty cycle of a channel of a PWM device, use the command `pwm_set pwm1 1 5000… 172 To enable a channel of the PWM device, use the command `pwm_enable pwm1 1`. The first parameter is … 179 To disable a channel of the PWM device, use the command `pwm_disable pwm1 1`. The first parameter i… 188 The following sample code is a PWM device usage sample . The main steps of the sample code are as … 194 5. Connect the PWM channel to a LED, and you can see that the LED changes from dark to bright gradu…
|
| /documentation/env/ |
| A D | env.md | 54 Scons is a compile building tool used by RT-Thread to compile RT-Threads using the scons related co… 89 Menuconfig is a graphical configuration tool that RT-Thread uses to configure and tailor the entire… 102 - Value, string type: After pressing the Enter key, a dialog box will appear, and the configuration… 110 …ides a package management platform where the officially available or developer-supplied packages a… 114 As a part of Env, the `package` tool provides developers with management functions such as download… 132 --wizard create a new package with wizard 155 - **update**: if the selected package has a latest update on the server and the version is selected… 156 - **delete**: if a software package is not needed, deselect it in menuconfig and then use `pkgs --… 199 Old project here refers to the development that has been going on for a while, and there is a modif… 246 …o upgrade the Env script itself and the list of packages. You cannot select a recently updated pac… [all …]
|