Skip to content

Commit 1216b26

Browse files
Start of 2.2 branch
1 parent 343263f commit 1216b26

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+570
-102
lines changed

Bitmap/Bitmap_functions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Bitmap Functions
2+

Bitmap/getSize.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- This file was generated by the script. Do not edit it, any changes will be lost! -->
2+
3+
## Bitmap.getSize(name)
4+
5+
6+
7+
Return width, heigh of a bitmap in memory
8+
9+
@status current Introduced in 2.2.0
10+
11+
12+
#### Parameters
13+
14+
* `bitmap` (pointer) point to a bitmap previously opened with Bipmap.open()
15+
16+
17+
18+
#### Return value
19+
20+
none
21+
22+
##### Notice
23+
Only available on color screens
24+
25+

Bitmap/open.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!-- This file was generated by the script. Do not edit it, any changes will be lost! -->
2+
3+
## Bitmap.open(name)
4+
5+
6+
7+
Loads a bitmap in memory, for later use with lcd.drawBitmap()
8+
9+
@status current Introduced in 2.2.0
10+
11+
12+
#### Parameters
13+
14+
* `name` (string) full path to the bitmap on SD card (i.e. “/IMAGES/test.bmp”)
15+
16+
17+
18+
#### Return value
19+
20+
none
21+
22+
##### Notice
23+
Only available on color screens
24+
25+

README.md

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

33
[[![Join the chat at https://opentx.rocket.chat](https://camo.githubusercontent.com/3d659054abd6ce21c0e47cf3b83a51bda69ca282/68747470733a2f2f64656d6f2e726f636b65742e636861742f696d616765732f6a6f696e2d636861742e737667)](https://opentx.rocket.chat)]()
44

5-
Go to https://www.gitbook.com/book/opentx/opentx-lua-reference-guide/details for the latest published version of this guide.
5+
Go to https://opentx.gitbooks.io/opentx-2-2-lua-reference-guide/content/ for the latest published version of this guide.
66

7-
This guide covers the development of user-written scripts for R/C transmitters running the OpenTX 2.1 operating system with Lua support. Readers should be familiar with OpenTX, the OpenTX Companion, and know how to transfer files the SD card in the transmitter.
7+
This guide covers the development of user-written scripts for R/C transmitters running the OpenTX 2.2 operating system with Lua support. Readers should be familiar with OpenTX, the OpenTX Companion, and know how to transfer files the SD card in the transmitter.
88

99
Part I of the guide shows how to enable Lua support for Taranis and includes basic examples of each types of script.
1010

@@ -14,7 +14,9 @@ Part III is the OpenTX Lua API Reference
1414

1515
Part IV addresses common issues in converting Lua scripts that were originally written for OpenTX 2.0
1616

17-
Part V covers advanced topics with examples
17+
Part V addresses common issues in converting Lua scripts that were originally written for OpenTX 2.1
18+
19+
Part VI covers advanced topics with examples
1820

1921

2022

SUMMARY.md

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Summary
22

3-
* [OpenTX 2.1 Lua Reference Guide](README.md)
3+
* [OpenTX 2.2 Lua Reference Guide](README.md)
44
* [Introduction](introduction.md)
55
* [Acknowledgments](acknowledgments.md)
66
* [Getting Started](getting_started.md)
@@ -28,21 +28,30 @@
2828
* [Key Event Constants](key_events.md)
2929
* [General Functions](general/general_functions.md) [//]: <> (LUADOC-BEGIN:general)
3030
* [GREY()](general/GREY.md)
31+
* [crossfireTelemetryPop()](general/crossfireTelemetryPop.md)
32+
* [crossfireTelemetryPush()](general/crossfireTelemetryPush.md)
3133
* [defaultChannel(stick)](general/defaultChannel.md)
3234
* [defaultStick(channel)](general/defaultStick.md)
3335
* [getDateTime()](general/getDateTime.md)
3436
* [getFieldInfo(name)](general/getFieldInfo.md)
3537
* [getFlightMode(mode)](general/getFlightMode.md)
3638
* [getGeneralSettings()](general/getGeneralSettings.md)
39+
* [getRAS()](general/getRAS.md)
40+
* [getRSSI()](general/getRSSI.md)
3741
* [getTime()](general/getTime.md)
3842
* [getValue(source)](general/getValue.md)
3943
* [getVersion()](general/getVersion.md)
4044
* [killEvents(key)](general/killEvents.md)
45+
* [luaPlayHaptic(duration, pause [, flags])](general/luaPlayHaptic.md)
4146
* [playDuration(duration [, hourFormat])](general/playDuration.md)
4247
* [playFile(name)](general/playFile.md)
4348
* [playNumber(value, unit [, attributes])](general/playNumber.md)
4449
* [playTone(frequency, duration, pause [, flags [, freqIncr]])](general/playTone.md)
45-
* [popupInput(title, event, input, min, max)](general/popupInput.md) [//]: <> (LUADOC-END:general)
50+
* [popupConfirmation(title, event)](general/popupConfirmation.md)
51+
* [popupInput(title, event, input, min, max)](general/popupInput.md)
52+
* [popupWarning(title, event)](general/popupWarning.md)
53+
* [sportTelemetryPop()](general/sportTelemetryPop.md)
54+
* [sportTelemetryPush()](general/sportTelemetryPush.md) [//]: <> (LUADOC-END:general)
4655
* [Model Functions](model/model_functions.md) [//]: <> (LUADOC-BEGIN:model)
4756
* [model.defaultInputs()](model/defaultInputs.md)
4857
* [model.deleteInput(input, line)](model/deleteInput.md)
@@ -73,11 +82,13 @@
7382
* [model.setTimer(timer, value)](model/setTimer.md) [//]: <> (LUADOC-END:model)
7483
* [Lcd Functions](lcd/lcd_functions.md) [//]: <> (LUADOC-BEGIN:lcd)
7584
* [Lcd Functions Overview](lcd/lcd_functions-overview.md)
85+
* [lcd.RGB(r, g, b)](lcd/RGB.md)
7686
* [lcd.clear()](lcd/clear.md)
87+
* [lcd.drawBitmap(bitmap, x, y [, scale])](lcd/drawBitmap.md)
7788
* [lcd.drawChannel(x, y, source, flags)](lcd/drawChannel.md)
7889
* [lcd.drawCombobox(x, y, w, list, idx [, flags])](lcd/drawCombobox.md)
7990
* [lcd.drawFilledRectangle(x, y, w, h [, flags])](lcd/drawFilledRectangle.md)
80-
* [lcd.drawGauge(x, y, w, h, fill, maxfill)](lcd/drawGauge.md)
91+
* [lcd.drawGauge(x, y, w, h, fill, maxfill [, flags])](lcd/drawGauge.md)
8192
* [lcd.drawLine(x1, y1, x2, y2, pattern, flags)](lcd/drawLine.md)
8293
* [lcd.drawNumber(x, y, value [, flags])](lcd/drawNumber.md)
8394
* [lcd.drawPixmap(x, y, name)](lcd/drawPixmap.md)
@@ -89,12 +100,17 @@
89100
* [lcd.drawText(x, y, text [, flags])](lcd/drawText.md)
90101
* [lcd.drawTimer(x, y, value [, flags])](lcd/drawTimer.md)
91102
* [lcd.getLastPos()](lcd/getLastPos.md)
92-
* [lcd.lock()](lcd/lock.md) [//]: <> (LUADOC-END:lcd)
103+
* [lcd.refresh()](lcd/refresh.md)
104+
* [lcd.setColor(area, color)](lcd/setColor.md) [//]: <> (LUADOC-END:lcd)
105+
* [Bitmap Functions](Bitmap/Bitmap_functions.md) [//]: <> (LUADOC-BEGIN:Bitmap)
106+
* [Bitmap.getSize(name)](Bitmap/getSize.md)
107+
* [Bitmap.open(name)](Bitmap/open.md) [//]: <> (LUADOC-END:Bitmap)
93108
* [Part IV - Converting OpenTX 2.0 Scripts](part_iv_-_converting_opentx_20_scripts.md)
94109
* [General Issues](known_issues.md)
95110
* [Handling GPS Sensor data](handling_gps_sensor_data.md)
96111
* [Handling Lipo Sensor Data](handling_lipo_sensor_data.md)
97-
* [Part V - Advanced Topics](part_v_-_advanced_topics.md)
112+
* [Part V - Converting OpenTX 2.1 Scripts](part_v_-_converting_opentx_21_scripts.md)
113+
* [Part VI - Advanced Topics](part_vi_-_advanced_topics.md)
98114
* [Lua data sharing across scripts](lua_data_sharing_across_scripts.md)
99115
* [Debugging techniques](debugging_techniques.md)
100116

function_scripts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Function scripts are invoked via the **'Lua Script'** option of Special Function
1717

1818
* should not exceed allowed run-time/ number of instructions.
1919
* all function scripts are stopped while one-time script is running (see Lua One-time scripts)
20-
* Version 2.1 function scripts **DO NOT HAVE ACCESS TO LCD DISPLAY**
20+
* Function scripts **DO NOT HAVE ACCESS TO LCD DISPLAY**
2121

2222
##### Location
2323

general/crossfireTelemetryPop.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<!-- This file was generated by the script. Do not edit it, any changes will be lost! -->
2+
3+
## crossfireTelemetryPop()
4+
5+
6+
7+
@status current Introduced in 2.2.0
8+
9+
10+
#### Parameters
11+
12+
none
13+
14+
#### Return value
15+
16+
* `SPORT` paket as a quadruple:
17+
* sensor ID (number)
18+
* frame ID (number)
19+
* data ID (number)
20+
* value (number)
21+
22+
23+

general/crossfireTelemetryPush.md

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!-- This file was generated by the script. Do not edit it, any changes will be lost! -->
2+
3+
## crossfireTelemetryPush()
4+
5+
6+
7+
This functions allows for sending telemetry data toward the TBS Crossfire link.
8+
9+
When called without parameters, it will only return the status of the ouput buffer without sending anything.
10+
11+
@status current Introduced in 2.2.0
12+
13+
14+
#### Parameters
15+
16+
* `sensorId` physical sensor ID
17+
18+
* `frameId` frame ID
19+
20+
* `dataId` data ID
21+
22+
* `value` value
23+
24+
25+
26+
#### Return value
27+
28+
* `boolean` data queued in output buffer or not.
29+
30+
31+

general/defaultChannel.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66

7-
Get channel assigned to stick. See Default Channel Order in General Settings
7+
Get channel assigned to stick. See Default Channel Order in General Settings
88

99
@status current Introduced in 2.0.0
1010

general/getFieldInfo.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,6 @@ The list of valid sources is available:
1212
* for OpenTX 2.1.x Taranis and Taranis Plus at http://downloads-21.open-tx.org/firmware/lua_fields_taranis.txt
1313
* for OpenTX 2.1.x Taranis X9E at http://downloads-21.open-tx.org/firmware/lua_fields_taranis_x9e.txt
1414

15-
In OpenTX 2.1.x the telemetry sources no longer have a predefined name.
16-
To get a telemetry value simply use it's sensor name. For example:
17-
* Altitude sensor has a name "Alt"
18-
* to get the current altitude use the source "Alt"
19-
* to get the minimum altitude use the source "Alt-", to get the maximum use "Alt+"
20-
2115
@status current Introduced in 2.0.8
2216

2317

@@ -30,9 +24,9 @@ To get a telemetry value simply use it's sensor name. For example:
3024
#### Return value
3125

3226
* `table` information about requested field, table elements:
33-
* `id` (number) field identifier
34-
* `name` (string) field name
35-
* `desc` (string) field description
27+
* `id` (number) field identifier
28+
* `name` (string) field name
29+
* `desc` (string) field description
3630

3731
* `nil` the requested field was not found
3832

0 commit comments

Comments
 (0)