Documentation: edit texts, markdown linting (#2226)

Co-authored-by: konerini <25254561+konerini@users.noreply.github.com>
Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
knrn-ai
2023-01-06 21:18:43 +03:00
committed by GitHub
parent fa223a4f4b
commit c24bea6b06
14 changed files with 509 additions and 485 deletions

View File

@@ -1,11 +1,12 @@
# Infrared Flipper File Formats
## Infrared Remote File Format
### Example
Filetype: IR signals file
Version: 1
#
#
name: Button_1
type: parsed
protocol: NECext
@@ -25,48 +26,59 @@
command: 15 00 00 00
### Description
Filename extension: `.ir`
This file format is used to store an infrared remote that consists of an arbitrary number of buttons.
This file format is used to store an infrared remote that consists of an arbitrary number of buttons.
Each button is separated from others by a comment character (`#`) for better readability.
Known protocols are represented in the `parsed` form, whereas non-recognised signals may be saved and re-transmitted as `raw` data.
Known protocols are represented in the `parsed` form, whereas non-recognized signals may be saved and re-transmitted as `raw` data.
#### Version history:
1. Initial version.
#### Format fields
| Name | Use | Type | Description |
| ---------- | ------- | ------ |------------ |
| name | both | string | Name of the button. Only printable ASCII characters are allowed. |
| type | both | string | Type of the signal. Must be `parsed` or `raw`. |
| protocol | parsed | string | Name of the infrared protocol. Refer to `ir` console command for the complete list of supported protocols. |
| address | parsed | hex | Payload address. Must be 4 bytes long. |
| command | parsed | hex | Payload command. Must be 4 bytes long. |
| frequency | raw | uint32 | Carrier frequency, in Hertz, usually 38000 Hz. |
| duty_cycle | raw | float | Carrier duty cycle, usually 0.33. |
| data | raw | uint32 | Raw signal timings, in microseconds between logic level changes. Individual elements must be space-separated. Maximum timings amount is 1024. |
| Name | Use | Type | Description |
| ---------- | ------ | ------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
| name | both | string | Name of the button. Only printable ASCII characters are allowed. |
| type | both | string | Type of the signal. Must be `parsed` or `raw`. |
| protocol | parsed | string | Name of the infrared protocol. Refer to `ir` console command for the complete list of supported protocols. |
| address | parsed | hex | Payload address. Must be 4 bytes long. |
| command | parsed | hex | Payload command. Must be 4 bytes long. |
| frequency | raw | uint32 | Carrier frequency, in Hertz, usually 38000 Hz. |
| duty_cycle | raw | float | Carrier duty cycle, usually 0.33. |
| data | raw | uint32 | Raw signal timings, in microseconds between logic level changes. Individual elements must be space-separated. Maximum timings amount is 1024. |
## Infrared Library File Format
### Examples
- [TV Universal Library](/assets/resources/infrared/assets/tv.ir)
- [A/C Universal Library](/assets/resources/infrared/assets/ac.ir)
- [Audio Universal Library](/assets/resources/infrared/assets/audio.ir)
### Description
Filename extension: `.ir`
This file format is used to store universal remote libraries. It is identical to the previous format, differing only in the `Filetype` field.\
It also has predefined button names for each universal library type, so that the universal remote application could understand them.
It also has predefined button names for each universal library type, so that the universal remote application can understand them.
See [Universal Remotes](/documentation/UniversalRemotes.md) for more information.
### Version history:
1. Initial version.
## Infrared Test File Format
### Examples
See [Infrared Unit Tests](/assets/unit_tests/infrared/) for various examples.
### Description
Filename extension: `.irtest`
This file format is used to store technical test data that is too large to keep directly in the firmware.
@@ -78,34 +90,38 @@ Known protocols are represented in the `parsed_array` form, whereas raw data has
Note: a single parsed signal must be represented as an array of size 1.
### Version history:
1. Initial version.
#### Format fields
| Name | Use | Type | Description |
| ---------- | ------------ | ------ |------------ |
| Name | Use | Type | Description |
| ---------- | ------------ | ------ | ---------------------------------------------------------------- |
| name | both | string | Name of the signal. Only printable ASCII characters are allowed. |
| type | both | string | Type of the signal. Must be `parsed_array` or `raw`. |
| count | parsed_array | uint32 | The number of parsed signals in an array. Must be at least 1. |
| protocol | parsed_array | string | Same as in previous formats. |
| address | parsed_array | hex | Ditto. |
| command | parsed_array | hex | Ditto. |
| repeat | parsed_array | bool | Indicates whether the signal is a repeated button press. |
| frequency | raw | uint32 | Same as in previous formats. |
| duty_cycle | raw | float | Ditto. |
| data | raw | uint32 | Ditto. |
| type | both | string | Type of the signal. Must be `parsed_array` or `raw`. |
| count | parsed_array | uint32 | The number of parsed signals in an array. Must be at least 1. |
| protocol | parsed_array | string | Same as in previous formats. |
| address | parsed_array | hex | Ditto. |
| command | parsed_array | hex | Ditto. |
| repeat | parsed_array | bool | Indicates whether the signal is a repeated button press. |
| frequency | raw | uint32 | Same as in previous formats. |
| duty_cycle | raw | float | Ditto. |
| data | raw | uint32 | Ditto. |
#### Signal names
The signal names in an `.irtest` file follow a convention `<name><test_number>`, where the name is one of:
- decoder_input
- decoder_expected
- encoder_decoder_input,
and the number is a sequential integer: 1, 2, 3...etc, which produces names like `decoder_input1`, `encoder_decoder_input3`, and so on.
and the number is a sequential integer: 1, 2, 3, etc., which produces names like `decoder_input1`, `encoder_decoder_input3`, and so on.
| Name | Type | Description |
| --------------------- | ------------ |-------------------------------------------------------------------------------------------------------|
| decoder_input | raw | A raw signal containing the decoder input. Is also used as the expected encoder output. |
| decoder_expected | parsed_array | An array of parsed signals containing the expected decoder output. Is also used as the encoder input. |
| --------------------- | ------------ | ----------------------------------------------------------------------------------------------------- |
| decoder_input | raw | A raw signal containing the decoder input. Also used as the expected encoder output. |
| decoder_expected | parsed_array | An array of parsed signals containing the expected decoder output. Also used as the encoder input. |
| encoder_decoder_input | parsed_array | An array of parsed signals containing both the encoder-decoder input and expected output. |
See [Unit Tests](/documentation/UnitTests.md#infrared) for more info.