Skip to content

Commit d246102

Browse files
snikolajmysterywolf
authored andcommitted
docs fixes half done
1 parent b31a3e5 commit d246102

File tree

8 files changed

+92
-92
lines changed

8 files changed

+92
-92
lines changed

documentation/at/at.md

Lines changed: 46 additions & 44 deletions
Large diffs are not rendered by default.

documentation/device/adc/adc.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
## An Introduction to ADC
44

5-
ADC is a hardware device that converts continuously changing analog signals to discrete digital signals such as temperature, pressure, sound, or images signals, etc. Digital signals are easier to be stored, processed, and transmitted.
6-
This can be achieved by using an analog-to-digital converter device and it is widely used in various platforms. According to history, ADC was first used to convert wireless signals to digital signals, for example, television signals, or signals from long-short broadcast stations.
5+
An ADC (analog-to-digital converter) is a hardware device that converts continuously changing analog signals to discrete digital signals. Usually, these analog signals include temperature, pressure, sound, video and many other types of signals. Converting them is important, as digital signals are easier to store, process, and transmit. This conversion can be achieved by using an ADC device which is commonly integrated in various platforms. Historically, ADCs were first used to convert received wireless signals to digital signals, for example, television signals, or signals from long-short broadcast stations.
76

87
### Conversion Process
98

10-
As shown in the figure below, the analog-to-digital conversion generally involves steps of sampling, holding, quantifying, and encoding. In actual circuits, some processes are combined, such as sampling and holding, and quantization and encoding are implemented simultaneously in the conversion process.
9+
As shown in the figure below, the analog-to-digital conversion generally involves steps of sampling, holding, quantifying, and encoding. In actual circuits, some processes are combined, such as sampling and holding, while quantization and encoding are implemented simultaneously in the conversion process.
1110

1211
![ADC Conversion Process](figures/adc-p.png)
1312

@@ -17,15 +16,15 @@ The process of converting a numerically continuous analog quantity into a digita
1716

1817
### Resolution
1918

20-
Resolution is represented as binary (or decimal) numbers. Generally, it comes with 8 bits, 12 bits, 16 bits, etc. Higher bits means higher resolution, thus, more accuracy in conversion of analog to digital signals.
19+
Resolution is represented as binary (or decimal) numbers. Generally, it comes in 8 bits, 10 bits, 12 bits, 16 bits, etc. A larger resolution, in bits, means more accuracy in the conversion of analog to digital signals.
2120

2221
### Precision
2322

24-
Precision means maximum error values between analog signals and real ADC device numerical points’ values.The deviation is measured from the output values to the liner maximum values. However, precision and resolution are used for different purposes and different concepts.
23+
Precision is the maximum error value between analog signals and real ADC device numerical points’ values.An ADC with a high resolution might have a low precision, meaning that factors like noise can affect the numerical ADC reading more than small changes in the input signal.
2524

2625
### Conversion Rate
2726

28-
The conversion rate is the reciprocal of time taken for an ADC device to complete conversion from analog to digital signals. For example, an ADC device with a conversion rate of 1MHz means ADC conversion time is 1 microsecond.
27+
The conversion rate is the reciprocal of time taken for an ADC device to complete conversion from an analog to a digital signal. For example, an ADC device with a conversion rate of 1MHz means that the ADC conversion time is 1 microsecond.
2928

3029
## Access ADC Device
3130

@@ -40,7 +39,7 @@ The application accesses the ADC hardware through the ADC device management inte
4039

4140
### Find ADC Devices
4241

43-
The application gets the device handler based on the ADC device name to operate the ADC device. Following is the interface function to find the devices,
42+
The application gets the device handler based on the ADC device name to operate the ADC device. Following is the interface function to find the devices:
4443

4544
```c
4645
rt_device_t rt_device_find(const char* name);
@@ -53,7 +52,8 @@ rt_device_t rt_device_find(const char* name);
5352
| Device handle | Finding the corresponding device will return to the corresponding device handle |
5453
| RT_NULL | No device found
5554
|
56-
In a nutshell, the names of the ADC devices are registered as adc0, adc1, and so on. Following is the example how to use it
55+
56+
In a nutshell, the names of the ADC devices are registered as adc0, adc1, and so on. What follows is an example on how to use it
5757
5858
```c
5959
#define ADC_DEV_NAME "adc1" /* ADC device name */
@@ -64,7 +64,7 @@ adc_dev = (rt_adc_device_t)rt_device_find(ADC_DEV_NAME);
6464

6565
### Enable ADC Channel
6666

67-
It is required to enable ADC device with the following interface function before reading and operating the ADC device,
67+
It is required to enable the ADC device with the following interface function before reading and operating the ADC device.
6868

6969
```c
7070
rt_err_t rt_adc_enable(rt_adc_device_t dev, rt_uint32_t channel);
@@ -129,9 +129,9 @@ rt_kprintf("the voltage is :%d.%02d \n", vol / 100, vol % 100);
129129

130130
The calculation formula of the actual voltage value is: `sampling value * reference voltage/(1 << resolution digit)`. In the above example, variable *vol* was enlarged 100 times, so finally the integer part of voltage is obtained through *vol / 100*, and the decimal part of voltage is obtained through *vol % 100*.
131131

132-
### Close the ADC Channel
132+
### Disabling the ADC Channel
133133

134-
Use the following function can close the ADC channel :
134+
An ADC channel can be disabled through the following function:
135135

136136
```c
137137
rt_err_t rt_adc_disable(rt_adc_device_t dev, rt_uint32_t channel);

documentation/device/hwtimer/hwtimer.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55

66
Hardware timers generally have two modes of operation, timer mode and counter mode. No matter which mode is operated, it works by counting the pulse signal counted by the internal counter module. Here are some important concepts of timers.
77

8-
**Counter mode:** Counts the external pulse.
8+
**Timer mode**: Counts the internal pulse. Timers are often used as timing clocks for timing detection, timing response, and timing control.
99

10-
**Timer mode **: Counts the internal pulse. Timers are often used as timing clocks for timing detection, timing response, and timing control.
10+
**Counter mode**: The counter can count up or down. The maximum count value of a 16-bit counter is 65535, and the maximum value of a 32-bit counter is 4 294 967 295.
1111

12-
**Counter **: Counter can count up or down. The maximum count value of the 16-bit counter is 65535, and the maximum value of the 32-bit counter is 4294967295.
13-
14-
**Counting frequency **:As for the number of counts within the counter time unit under the timer mode, since the system clock frequency is fixed, the timer time can be calculated according to the counter count value. `Timing time = count value / count frequency`. For example, if the counting frequency is 1 MHz, the counter counts once is 1 / 1000000 second. That is, every 1 microsecond counter is incremented by one (or subtract one), at this time, the maximum timing capability of the 16-bit counter is 65535 microseconds, which is 65.535 milliseconds.
12+
**Counting frequency**:Since the input frequency is usually fixed, the time it takes for the counter to reach its desired count number can be calculated from just the given frequency - `time = count value / count frequency`. For example, if the counting frequency is 1 MHz, the counter counts once every 1 / 1000000 seconds. That is, every 1 microsecond, the counter is incremented by one (or subtracted by one), at this time, the maximum timing capability of the 16-bit counter is 65535 microseconds, or 65.535 milliseconds.
1513

1614
## Access Hardware Timer Device
1715

@@ -80,10 +78,10 @@ rt_device_open(hw_dev, RT_DEVICE_OFLAG_RDWR);
8078

8179
### Set the Timeout Callback Function
8280

83-
Set the timer timeout callback function by the following function, this callback function will be called when the timer expires:
81+
Set the timer timeout callback function with the following function - this is the function that will be called when the timer reaches its set count value:
8482

8583
```c
86-
rt_err_t rt_device_set_rx_indicate(rt_device_t dev, rt_err_t (*rx_ind)(rt_device_t dev,rt_size_t size))
84+
rt_err_t rt_device_set_rx_indicate(rt_device_t dev, rt_err_t (*rx_ind)(rt_device_t dev, rt_size_t size))
8785
```
8886
8987
| Parameter | **Description** |
@@ -121,7 +119,7 @@ static int hwtimer_sample(int argc, char *argv[])
121119

122120
### Control the Timer Device
123121

124-
By commanding the control word, the application can configure the hardware timer device by the following function:
122+
By sending control words, the application can configure the hardware timer device with the following function:
125123

126124
```c
127125
rt_err_t rt_device_control(rt_device_t dev, rt_uint8_t cmd, void* arg);
@@ -146,11 +144,11 @@ The command control words available for the hardware timer device are as follows
146144
| HWTIMER_CTRL_INFO_GET | get timer feature information |
147145
| HWTIMER_CTRL_MODE_SET | set timer mode |
148146
149-
Get the timer parameter arg,which is a pointer to the structure struct rt_hwtimer_info, to save the obtained information.
147+
Get the timer parameter argument, which is a pointer to the structure struct rt_hwtimer_info, to save the obtained information.
150148
151-
>Setting frequency is valid only when the timer hardware and driver support sets the counting frequency. Generally, the default frequency of the driving setting can be used.
149+
>Setting frequency is valid only when the timer hardware and included driver set the counting frequency. Generally, the default frequency of the driving setting can be used.
152150
153-
When setting the timer mode, the parameter arg can take the following values:
151+
When setting the timer mode, the parameter argument can take the following values:
154152
155153
```c
156154
HWTIMER_MODE_ONESHOT /* Single timing */
@@ -283,7 +281,7 @@ rt_device_read(hw_dev, 0, &timeout_s, sizeof(timeout_s));
283281
284282
### Close the Timer Device
285283
286-
The timer device can be closed by the following function:
284+
The timer device can be closed with the following function:
287285
288286
```c
289287
rt_err_t rt_device_close(rt_device_t dev);
@@ -297,7 +295,7 @@ rt_err_t rt_device_close(rt_device_t dev);
297295
| -RT_ERROR | the device has been completely shut down and cannot be closed repeatedly |
298296
| other error code | fail to close the device |
299297

300-
To close the device interface and open the device interface should be used in pairs. When open a device, close the device after use , so that the device can be completely shut down, otherwise the device will remain a opening status.
298+
When a timer device has been used and is not necessary anymore, it should be closed, otherwise the device will remain in an open status.
301299

302300
An example of use is shown below:
303301

documentation/device/i2c/i2c.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22

33
## Introduction of I2C
44

5-
The I2C (Inter Integrated Circuit) bus is a half-duplex, bidirectional two-wire synchronous serial bus developed by PHILIPS. The I2C bus has only two signal lines, one is the bidirectional data line SDA (serial data), and the other is the bidirectional clock line SCL (serial clock). The SPI bus has two lines for receiving data and transmitting data between the master and slave devices, while the I2C bus uses only one line for data transmission and reception.
5+
The I2C (Inter Integrated Circuit) bus is a half-duplex, bidirectional two-wire synchronous serial bus developed by Philips. The I2C bus has only two signal lines, one is the bidirectional data line SDA (serial data), and the other is the bidirectional clock line SCL (serial clock). Compared to the SPI bus, which has two lines for receiving data and transmitting data between the master and slave devices, the I2C bus uses only one line for data transmission and reception.
66

7-
Like SPI, I2C works in a master-slave manner. Unlike SPI-master-multi-slave architecture, it allows multiple master devices to exist at the same time. Each device connected to the bus has a unique address, and the master device initiates data transfer, and generates a clock signal. The slave device is addressed by the master device, and only one master device is allowed at a time. As shown below:
7+
Like SPI, I2C works in a master-slave manner. Unlike SPI-master-multi-slave architecture, it allows multiple master devices to exist at the same time. Each device connected to the bus has a unique address, and the master device initiates data transfer, and generates a clock signal. The slave device is addressed by the master device, and only one master device is allowed to communicate at a time. As shown below:
88

99
![I2C Bus master-slave device connection mode](figures/i2c1.png)
1010

1111
The main data transmission format of the I2C bus is shown in the following figure:
1212

1313
![I2C Bus Data Transmission Format](figures/i2c2.png)
1414

15-
When the bus is idle, both SDA and SCL are in a high state. When the host wants to communicate with a slave, it will send a start condition first, then send the slave address and read and write control bits, and then transfer the data (host send or receive data). The host will send a stop condition when the data transfer ends. Each byte transmitted is 8 bits, with the high bit first and the low bit last. The different terms in the data transmission process are as follows:
15+
When the bus is idle, both SDA and SCL are in a high state. When the host wants to communicate with a slave, it will send a start condition first, then send the slave address and read and write control bits, and then transfer the data (the host can send or receive data). The host will send a stop condition when the data transfer ends. Each byte transmitted is 8 bits, with the high bit first and the low bit last. The different terms in the data transmission process are as follows:
1616

1717
* **Starting Condition:** When SCL is high, the host pulls SDA low, indicating that data transfer is about to begin.
1818

documentation/device/pin/pin.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
## Introduction of Pin
44

5-
The pins on the chip are generally divided into four categories: power supply, clock, control, and I/O. The I/O port is further divided into General Purpose Input Output (GPIO) and function multiplex I/O (such as SPI/I2C/UART, etc.) in the usage mode.
5+
The pins on the chip are generally divided into four categories: power supply, clock, control, and I/O. The I/O pins are further divided into General Purpose Input Output (GPIO) and function-multiplexed I/O (such as SPI/I2C/UART, etc.) pins, referring to their usage mode.
66

7-
Most MCU pins have more than one function. The internal structure of different pins is different and the functions are different. The actual function of the pin can be switched through different configurations. The main features of the General Purpose Input Output (GPIO) port are as follows:
7+
Most MCU pins have more than one function. Their internal structure is different and their supported functionality are different. The actual function of the pin can be switched through different configurations. The main features of the General Purpose Input Output (GPIO) port are as follows:
88

99
* Programmable Interrupt: The interrupt trigger mode is configurable. Generally, there are five interrupt trigger modes as shown in the following figure:
1010

@@ -31,7 +31,7 @@ The application accesses the GPIO through the PIN device management interface pr
3131

3232
### Obtain Pin Number
3333

34-
The pin numbers provided by RT-Thread need to be distinguished from the chip pin numbers. They are not the same concept. The pin numbers are defined by the PIN device driver and are related to the specific chip. There are two ways to obtain the pin number: use the macro definition or view the PIN driver file.
34+
The pin numbers provided by RT-Thread need to be distinguished from the chip pin numbers, which not the same. The pin numbers are defined by the PIN device driver and are related to the specific chip used. There are two ways to obtain the pin number: use the macro definition or view the PIN driver file.
3535

3636
#### Use Macro Definition
3737

@@ -157,7 +157,7 @@ status = rt_pin_read(BEEP_PIN_NUM);
157157
158158
### Bind Pin Interrupt Callback Function
159159
160-
To use the interrupt function of the pin, you can use the following function to configure a pin to some interrupt trigger mode and bind an interrupt callback function to the corresponding pin. When the pin interrupt occurs, the callback function will be executed. :
160+
To use the interrupt functionality of a pin, you can use the following function to configure the pin to some interrupt trigger mode and bind an interrupt callback function to the corresponding pin. When the pin interrupt occurs, the callback function will be executed.:
161161
162162
```c
163163
rt_err_t rt_pin_attach_irq(rt_int32_t pin, rt_uint32_t mode,

documentation/device/pwm/pwm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ PWM (Pulse Width Modulation) is a method of digitally encoding the level of an a
88

99
Above is a simple schematic diagram of PWM. Assuming that the timer works in a up-counter mode. When the count value is less than the threshold, it outputs a level state, such as a high level. When the count value is greater than the threshold, it outputs the opposite, such as a low level. When the count value reaches the maximum value, the counter recounts from 0 and returns to the original level state. The ratio of the high-level duration (pulse width) to the cycle time is the duty cycle, ranging from 0 to 100%. The high level of the above picture is just half of the cycle time, so the duty cycle is 50%.
1010

11-
One of the common PWM control scenarios is to adjust the brightness of the light or screen. The brightness can be adjusted according to the duty cycle. The PWM adjusts the brightness not continuously, but constantly lights up and turns off the screen. When the light is turned on and off fast enough, the naked eye will always think that it is always bright. In the process of on and off, the longer the light is off, the lower the brightness of the screen to the naked eye. The longer the light is on, the less time is spent and the screen will be brighter.
11+
One of the common PWM control scenarios is to adjust the brightness of a light or screen. The brightness can be adjusted through changing the duty cycle. The PWM does not adjust the light continuously, rather it constantly turns the screen on and off. When the light is turned on and off fast enough, the naked eye will always think that it is always bright. In the process of switching it on and off, the longer the light is off, the lower the brightness of the screen to the naked eye. Conversely, the longer the light is on, the brighter the screen will appear.
1212

1313
![PWM Brightness Adjustment](figures/pwm-l.png)
1414

@@ -162,14 +162,14 @@ rt_pwm_disable(pwm_dev,PWM_DEV_CHANNEL);
162162

163163
## FinSH Command
164164

165-
To set the period and duty cycle of a channel of a PWM device, use the command `pwm_set pwm1 1 500000 5000`. The first parameter is the command, the second parameter is the PWM device name, the third parameter is the PWM channel, and the fourth parameter is PWM period(ns), the fifth parameter is the pulse width (ns).
165+
To set the period and duty cycle of a channel of a PWM device, use the command `pwm_set pwm1 1 500000 5000`. The first parameter is the command, the second parameter is the PWM device name, the third parameter is the PWM channel, and the fourth parameter is PWM period (ns), the fifth parameter is the pulse width (ns).
166166

167167
```c
168168
msh />pwm_set pwm1 1 500000 5000
169169
msh />
170170
```
171171

172-
To enable a channel of the PWM device, use the command`pwm_enable pwm1 1`. The first parameter is the command, the second parameter is the PWM device name, and the third parameter is the PWM channel.
172+
To enable a channel of the PWM device, use the command `pwm_enable pwm1 1`. The first parameter is the command, the second parameter is the PWM device name, and the third parameter is the PWM channel.
173173

174174
```c
175175
msh />pwm_enable pwm1 1

0 commit comments

Comments
 (0)