diff --git a/docs/en/modules/adc.md b/docs/en/modules/adc.md index 30367aec..3906b703 100644 --- a/docs/en/modules/adc.md +++ b/docs/en/modules/adc.md @@ -1,4 +1,8 @@ # ADC Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-24 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [adc.c](../../../app/modules/adc.c)| + The ADC module provides access to the in-built ADC. On the ESP8266 there is only a single-channel, which is multiplexed with the battery voltage. Depending on the setting in the "esp init data" (byte 107) one can either use the ADC to read an external voltage, or to read the system voltage, but not both. @@ -36,4 +40,4 @@ none ####Returns system voltage in millivolts (number) -If the ESP8266 has been configured to use the ADC for sampling the external pin, this function will always return 65535. This is a hardware and/or SDK limitation. \ No newline at end of file +If the ESP8266 has been configured to use the ADC for sampling the external pin, this function will always return 65535. This is a hardware and/or SDK limitation. diff --git a/docs/en/modules/am2320.md b/docs/en/modules/am2320.md index 783d1d63..2db61809 100644 --- a/docs/en/modules/am2320.md +++ b/docs/en/modules/am2320.md @@ -1,4 +1,8 @@ # AM2320 Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-02-14 | [Henk Vergonet](https://github.com/hvegh) | [Henk Vergonet](https://github.com/hvegh) | [am2320.c](../../../app/modules/am2320.c)| + This module provides access to the [AM2320](https://akizukidenshi.com/download/ds/aosong/AM2320.pdf) humidity and temperature sensor, using the i2c interface. diff --git a/docs/en/modules/apa102.md b/docs/en/modules/apa102.md index 653637b3..e9e4622e 100644 --- a/docs/en/modules/apa102.md +++ b/docs/en/modules/apa102.md @@ -1,4 +1,8 @@ # APA102 Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-01-26 | [Robert Foss](https://github.com/robertfoss)| [Robert Foss](https://github.com/robertfoss)| [apa102.c](../../../app/modules/apa102.c)| + This module provides Lua access to [APA102 RGB LEDs](https://youtu.be/UYvC-hukz-0) which are similar in function to the common [WS2812](ws2812) addressable LEDs. > DotStar LEDs are 5050-sized LEDs with an embedded micro controller inside the LED. You can set the color/brightness of each LED to 24-bit color (8 bits each red green and blue). Each LED acts like a shift register, reading incoming color data on the input pins, and then shifting the previous color data out on the output pin. By sending a long string of data, you can control an infinite number of LEDs, just tack on more or cut off unwanted LEDs at the end. diff --git a/docs/en/modules/bit.md b/docs/en/modules/bit.md index e95c9622..b6dc1af4 100644 --- a/docs/en/modules/bit.md +++ b/docs/en/modules/bit.md @@ -1,4 +1,8 @@ # bit Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-24 | [https://github.com/LuaDist/bitlib](https://github.com/LuaDist/bitlib), [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [bit.c](../../../app/modules/bit.c)| + Bit manipulation support, on 32bit integers. @@ -167,4 +171,4 @@ Set bits in a number. - `...posn` position of the nth bit to set. ####Returns -the number with the bit(s) set in the given position(s) \ No newline at end of file +the number with the bit(s) set in the given position(s) diff --git a/docs/en/modules/bme280.md b/docs/en/modules/bme280.md index 4e4ff745..92fe92ad 100644 --- a/docs/en/modules/bme280.md +++ b/docs/en/modules/bme280.md @@ -1,4 +1,7 @@ # BME280 module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-02-21 | [vsky279](https://github.com/vsky279) | [vsky279](https://github.com/vsky279) | [bit.c](../../../app/modules/bme280.c)| This module provides a simple interface to [BME280/BMP280 temperature/air presssure/humidity sensors](http://www.bosch-sensortec.com/bst/products/all_products/bme280) (Bosch Sensortec). diff --git a/docs/en/modules/bmp085.md b/docs/en/modules/bmp085.md index 9b3e0d94..1bb96aa2 100644 --- a/docs/en/modules/bmp085.md +++ b/docs/en/modules/bmp085.md @@ -1,4 +1,8 @@ # BMP085 Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-08-03 | [Konrad Beckmann](https://github.com/kbeckmann) | [Konrad Beckmann](https://github.com/kbeckmann) | [bmp085.c](../../../app/modules/bmp085.c)| + This module provides access to the [BMP085](https://www.sparkfun.com/tutorials/253) temperature and pressure sensor. The module also works with BMP180. diff --git a/docs/en/modules/cjson.md b/docs/en/modules/cjson.md index 80a0be66..32f7b9b8 100644 --- a/docs/en/modules/cjson.md +++ b/docs/en/modules/cjson.md @@ -1,4 +1,7 @@ # CJSON Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-03-16 | [Mark Pulford](http://kyne.com.au/~mark/software/lua-cjson.php), [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [cjson](../../../app/modules/cjson.c) | The JSON support module. Allows encoding and decoding to/from JSON. @@ -46,4 +49,4 @@ Lua table representation of the JSON data ```lua t = cjson.decode('{"key":"value"}') for k,v in pairs(t) do print(k,v) end -``` \ No newline at end of file +``` diff --git a/docs/en/modules/coap.md b/docs/en/modules/coap.md index 6f50d9f9..eea2f882 100755 --- a/docs/en/modules/coap.md +++ b/docs/en/modules/coap.md @@ -1,224 +1,228 @@ -# CoAP Module -The CoAP module provides a simple implementation according to [CoAP](http://tools.ietf.org/html/rfc7252) protocol. -The basic endpoint server part is based on [microcoap](https://github.com/1248/microcoap), and many other code reference [libcoap](https://github.com/obgm/libcoap). - -This module implements both the client and the server side. GET/PUT/POST/DELETE is partially supported by the client. Server can register Lua functions and varibles. No observe or discover supported yet. - -## Caution -This module is only in the very early stage and not complete yet. - +# CoAP Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-02-04 | Toby Jaffey , [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [coap.c](../../../app/modules/coap.c) | + +The CoAP module provides a simple implementation according to [CoAP](http://tools.ietf.org/html/rfc7252) protocol. +The basic endpoint server part is based on [microcoap](https://github.com/1248/microcoap), and many other code reference [libcoap](https://github.com/obgm/libcoap). + +This module implements both the client and the server side. GET/PUT/POST/DELETE is partially supported by the client. Server can register Lua functions and varibles. No observe or discover supported yet. + +## Caution +This module is only in the very early stage and not complete yet. + ## Constants Constants for various functions. - + `coap.CON`, `coap.NON` represent the request types. - -`coap.TEXT_PLAIN`, `coap.LINKFORMAT`, `coap.XML`, `coap.OCTET_STREAM`, `coap.EXI`, `coap.JSON` represent content types. - -## coap.Client() - -Creates a CoAP client. - -#### Syntax -`coap.Client()` - -#### Parameters -none - -#### Returns -CoAP client - -#### Example -```lua -cc = coap.Client() --- assume there is a coap server at ip 192.168.100 -cc:get(coap.CON, "coap://192.168.18.100:5683/.well-known/core") --- GET is not complete, the result/payload only print out in console. -cc:post(coap.NON, "coap://192.168.18.100:5683/", "Hello") -``` - -## coap.Server() - -Creates a CoAP server. - -#### Syntax -`coap.Server()` - -#### Parameters -none - -#### Returns -CoAP server - -#### Example -```lua --- use copper addon for firefox -cs=coap.Server() -cs:listen(5683) - -myvar=1 -cs:var("myvar") -- get coap://192.168.18.103:5683/v1/v/myvar will return the value of myvar: 1 - -all='[1,2,3]' -cs:var("all", coap.JSON) -- sets content type to json - --- function should tack one string, return one string. -function myfun(payload) - print("myfun called") - respond = "hello" - return respond -end -cs:func("myfun") -- post coap://192.168.18.103:5683/v1/f/myfun will call myfun - -``` - -# CoAP Client - -## coap.client:get() - -Issues a GET request to the server. - -#### Syntax -`coap.client:get(type, uri[, payload])` - -#### Parameters -- `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. -- `uri` the URI such as "coap://192.168.18.103:5683/v1/v/myvar", only IP addresses are supported i.e. no hostname resoltion. -- `payload` optional, the payload will be put in the payload section of the request. - -#### Returns -`nil` - -## coap.client:put() - -Issues a PUT request to the server. - -#### Syntax -`coap.client:put(type, uri[, payload])` - -#### Parameters -- `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. -- `uri` the URI such as "coap://192.168.18.103:5683/v1/v/myvar", only IP addresses are supported i.e. no hostname resoltion. -- `payload` optional, the payload will be put in the payload section of the request. - -#### Returns -`nil` - -## coap.client:post() - -Issues a POST request to the server. - -#### Syntax -`coap.client:post(type, uri[, payload])` - -#### Parameters -- `type` coap.CON, coap.NON, defaults to CON. when type is CON, and request failed, the request will retry another 4 times before giving up. -- `uri` the uri such as coap://192.168.18.103:5683/v1/v/myvar, only IP is supported. -- `payload` optional, the payload will be put in the payload section of the request. - -#### Returns -`nil` - -## coap.client:delete() - -Issues a DELETE request to the server. - -#### Syntax -`coap.client:delete(type, uri[, payload])` - -#### Parameters -- `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. -- `uri` the URI such as "coap://192.168.18.103:5683/v1/v/myvar", only IP addresses are supported i.e. no hostname resoltion. -- `payload` optional, the payload will be put in the payload section of the request. - -#### Returns -`nil` - -# CoAP Server - -## coap.server:listen() - -Starts the CoAP server on the given port. - -#### Syntax -`coap.server:listen(port[, ip])` - -#### Parameters -- `port` server port (number) -- `ip` optional IP address - -#### Returns -`nil` - -## coap.server:close() - -Closes the CoAP server. - -#### Syntax -`coap.server:close()` - -#### Parameters -none - -#### Returns -`nil` - -## coap.server:var() - -Registers a Lua variable as an endpoint in the server. the variable value then can be retrieved by a client via GET method, represented as an [URI](http://tools.ietf.org/html/rfc7252#section-6) to the client. The endpoint path for varialble is '/v1/v/'. - -#### Syntax -`coap.server:var(name[, content_type])` - -#### Parameters -- `name` the Lua variable's name -- `content_type` optional, defaults to `coap.TEXT_PLAIN`, see [Content Negotiation](http://tools.ietf.org/html/rfc7252#section-5.5.4) - -#### Returns -`nil` - -#### Example -```lua --- use copper addon for firefox -cs=coap.Server() -cs:listen(5683) - -myvar=1 -cs:var("myvar") -- get coap://192.168.18.103:5683/v1/v/myvar will return the value of myvar: 1 --- cs:var(myvar), WRONG, this api accept the name string of the varialbe. but not the variable itself. -all='[1,2,3]' -cs:var("all", coap.JSON) -- sets content type to json -``` - -## coap.server:func() - -Registers a Lua function as an endpoint in the server. The function then can be called by a client via POST method. represented as an [URI](http://tools.ietf.org/html/rfc7252#section-6) to the client. The endpoint path for function is '/v1/f/'. - -When the client issues a POST request to this URI, the payload will be passed to the function as parameter. The function's return value will be the payload in the message to the client. - -The function registered SHOULD accept ONLY ONE string type parameter, and return ONE string value or return nothing. - -#### Syntax -`coap.server:func(name[, content_type])` - -#### Parameters -- `name` the Lua function's name -- `content_type` optional, defaults to `coap.TEXT_PLAIN`, see [Content Negotiation](http://tools.ietf.org/html/rfc7252#section-5.5.4) - -#### Returns -`nil` - -#### Example -```lua --- use copper addon for firefox -cs=coap.Server() -cs:listen(5683) - --- function should take only one string, return one string. -function myfun(payload) - print("myfun called") - respond = "hello" - return respond -end -cs:func("myfun") -- post coap://192.168.18.103:5683/v1/f/myfun will call myfun --- cs:func(myfun), WRONG, this api accept the name string of the function. but not the function itself. -``` + +`coap.TEXT_PLAIN`, `coap.LINKFORMAT`, `coap.XML`, `coap.OCTET_STREAM`, `coap.EXI`, `coap.JSON` represent content types. + +## coap.Client() + +Creates a CoAP client. + +#### Syntax +`coap.Client()` + +#### Parameters +none + +#### Returns +CoAP client + +#### Example +```lua +cc = coap.Client() +-- assume there is a coap server at ip 192.168.100 +cc:get(coap.CON, "coap://192.168.18.100:5683/.well-known/core") +-- GET is not complete, the result/payload only print out in console. +cc:post(coap.NON, "coap://192.168.18.100:5683/", "Hello") +``` + +## coap.Server() + +Creates a CoAP server. + +#### Syntax +`coap.Server()` + +#### Parameters +none + +#### Returns +CoAP server + +#### Example +```lua +-- use copper addon for firefox +cs=coap.Server() +cs:listen(5683) + +myvar=1 +cs:var("myvar") -- get coap://192.168.18.103:5683/v1/v/myvar will return the value of myvar: 1 + +all='[1,2,3]' +cs:var("all", coap.JSON) -- sets content type to json + +-- function should tack one string, return one string. +function myfun(payload) + print("myfun called") + respond = "hello" + return respond +end +cs:func("myfun") -- post coap://192.168.18.103:5683/v1/f/myfun will call myfun + +``` + +# CoAP Client + +## coap.client:get() + +Issues a GET request to the server. + +#### Syntax +`coap.client:get(type, uri[, payload])` + +#### Parameters +- `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. +- `uri` the URI such as "coap://192.168.18.103:5683/v1/v/myvar", only IP addresses are supported i.e. no hostname resoltion. +- `payload` optional, the payload will be put in the payload section of the request. + +#### Returns +`nil` + +## coap.client:put() + +Issues a PUT request to the server. + +#### Syntax +`coap.client:put(type, uri[, payload])` + +#### Parameters +- `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. +- `uri` the URI such as "coap://192.168.18.103:5683/v1/v/myvar", only IP addresses are supported i.e. no hostname resoltion. +- `payload` optional, the payload will be put in the payload section of the request. + +#### Returns +`nil` + +## coap.client:post() + +Issues a POST request to the server. + +#### Syntax +`coap.client:post(type, uri[, payload])` + +#### Parameters +- `type` coap.CON, coap.NON, defaults to CON. when type is CON, and request failed, the request will retry another 4 times before giving up. +- `uri` the uri such as coap://192.168.18.103:5683/v1/v/myvar, only IP is supported. +- `payload` optional, the payload will be put in the payload section of the request. + +#### Returns +`nil` + +## coap.client:delete() + +Issues a DELETE request to the server. + +#### Syntax +`coap.client:delete(type, uri[, payload])` + +#### Parameters +- `type` `coap.CON`, `coap.NON`, defaults to CON. If the type is CON and request fails, the library retries four more times before giving up. +- `uri` the URI such as "coap://192.168.18.103:5683/v1/v/myvar", only IP addresses are supported i.e. no hostname resoltion. +- `payload` optional, the payload will be put in the payload section of the request. + +#### Returns +`nil` + +# CoAP Server + +## coap.server:listen() + +Starts the CoAP server on the given port. + +#### Syntax +`coap.server:listen(port[, ip])` + +#### Parameters +- `port` server port (number) +- `ip` optional IP address + +#### Returns +`nil` + +## coap.server:close() + +Closes the CoAP server. + +#### Syntax +`coap.server:close()` + +#### Parameters +none + +#### Returns +`nil` + +## coap.server:var() + +Registers a Lua variable as an endpoint in the server. the variable value then can be retrieved by a client via GET method, represented as an [URI](http://tools.ietf.org/html/rfc7252#section-6) to the client. The endpoint path for varialble is '/v1/v/'. + +#### Syntax +`coap.server:var(name[, content_type])` + +#### Parameters +- `name` the Lua variable's name +- `content_type` optional, defaults to `coap.TEXT_PLAIN`, see [Content Negotiation](http://tools.ietf.org/html/rfc7252#section-5.5.4) + +#### Returns +`nil` + +#### Example +```lua +-- use copper addon for firefox +cs=coap.Server() +cs:listen(5683) + +myvar=1 +cs:var("myvar") -- get coap://192.168.18.103:5683/v1/v/myvar will return the value of myvar: 1 +-- cs:var(myvar), WRONG, this api accept the name string of the varialbe. but not the variable itself. +all='[1,2,3]' +cs:var("all", coap.JSON) -- sets content type to json +``` + +## coap.server:func() + +Registers a Lua function as an endpoint in the server. The function then can be called by a client via POST method. represented as an [URI](http://tools.ietf.org/html/rfc7252#section-6) to the client. The endpoint path for function is '/v1/f/'. + +When the client issues a POST request to this URI, the payload will be passed to the function as parameter. The function's return value will be the payload in the message to the client. + +The function registered SHOULD accept ONLY ONE string type parameter, and return ONE string value or return nothing. + +#### Syntax +`coap.server:func(name[, content_type])` + +#### Parameters +- `name` the Lua function's name +- `content_type` optional, defaults to `coap.TEXT_PLAIN`, see [Content Negotiation](http://tools.ietf.org/html/rfc7252#section-5.5.4) + +#### Returns +`nil` + +#### Example +```lua +-- use copper addon for firefox +cs=coap.Server() +cs:listen(5683) + +-- function should take only one string, return one string. +function myfun(payload) + print("myfun called") + respond = "hello" + return respond +end +cs:func("myfun") -- post coap://192.168.18.103:5683/v1/f/myfun will call myfun +-- cs:func(myfun), WRONG, this api accept the name string of the function. but not the function itself. +``` diff --git a/docs/en/modules/crypto.md b/docs/en/modules/crypto.md index 510bc8da..80f43843 100644 --- a/docs/en/modules/crypto.md +++ b/docs/en/modules/crypto.md @@ -1,4 +1,7 @@ # crypto Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-06-02 | [DiUS](https://github.com/DiUS), [Johny Mattsson](https://github.com/jmattsson) | [Johny Mattsson](https://github.com/jmattsson) | [crypto.c](../../../app/modules/crypto.c)| The crypto modules provides various functions for working with cryptographic algorithms. diff --git a/docs/en/modules/dht.md b/docs/en/modules/dht.md index 2d2e852a..f6636648 100644 --- a/docs/en/modules/dht.md +++ b/docs/en/modules/dht.md @@ -1,4 +1,7 @@ # DHT Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-06-17 | [RobTillaart](https://github.com/RobTillaart/Arduino/tree/master/libraries/DHTlib) | [Vowstar](https://github.com/vowstar) | [dhtlib](../../../app/dhtlib/)| ## Constants Constants for various functions. diff --git a/docs/en/modules/encoder.md b/docs/en/modules/encoder.md index a57bc6b3..a7244d5c 100644 --- a/docs/en/modules/encoder.md +++ b/docs/en/modules/encoder.md @@ -1,4 +1,7 @@ # encoder Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-02-26 | [Terry Ellison](https://github.com/TerryE) | [Terry Ellison](https://github.com/TerryE) | [encoder.c](../../../app/modules/encoder.c)| The encoder modules provides various functions for encoding and decoding byte data. diff --git a/docs/en/modules/enduser-setup.md b/docs/en/modules/enduser-setup.md index 41d7918d..4c45ab93 100644 --- a/docs/en/modules/enduser-setup.md +++ b/docs/en/modules/enduser-setup.md @@ -1,4 +1,8 @@ # enduser setup Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-09-02 | [Robert Foss](https://github.com/robertfoss) | [Robert Foss](https://github.com/robertfoss) | [enduser_setup.c](../../../app/modules/enduser_setup.c)| + This module provides a simple way of configuring ESP8266 chips without using a serial interface or pre-programming WiFi credentials onto the chip. ![enduser setup config dialog](../../img/enduser-setup.jpg "enduser setup config dialog") diff --git a/docs/en/modules/file.md b/docs/en/modules/file.md index a342534a..27b04f25 100644 --- a/docs/en/modules/file.md +++ b/docs/en/modules/file.md @@ -1,4 +1,8 @@ # file Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [file.c](../../../app/modules/file.c)| + The file module provides access to the file system and its individual files. The file system is a flat file system, with no notion of directories/folders. diff --git a/docs/en/modules/gpio.md b/docs/en/modules/gpio.md index b7563df5..d76e05c4 100644 --- a/docs/en/modules/gpio.md +++ b/docs/en/modules/gpio.md @@ -1,4 +1,8 @@ # GPIO Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [gpio.c](../../../app/modules/gpio.c)| + This module provides access to the [GPIO](https://en.wikipedia.org/wiki/General-purpose_input/output) (General Purpose Input/Output) subsystem. diff --git a/docs/en/modules/http.md b/docs/en/modules/http.md index 06685495..9fc36412 100644 --- a/docs/en/modules/http.md +++ b/docs/en/modules/http.md @@ -1,8 +1,11 @@ # HTTP Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-01-15 | [Vowstar](https://github.com/vowstar) | [Vowstar](https://github.com/vowstar) | [http.c](../../../app/modules/http.c)| -Basic HTTP client module. +Basic HTTP *client* module. -Provides an interface to do basic GET/POST/PUT/DELETE over HTTP(S), as well as customized requests. Due to the memory constraints on ESP8266, the supported page/body size is limited by available memory. Attempting to receive pages larger than this will fail. If larger page/body sizes are necessary, consider using `net.createConnection()` and stream in the data. +Provides an interface to do basic GET/POST/PUT/DELETE over HTTP(S), as well as customized requests. Due to the memory constraints on ESP8266, the supported page/body size is limited by available memory. Attempting to receive pages larger than this will fail. If larger page/body sizes are necessary, consider using [`net.createConnection()`](#netcreateconnection) and stream in the data. Each request method takes a callback which is invoked when the response has been received from the server. The first argument is the status code, which is either a regular HTTP status code, or -1 to denote a DNS, connection or out-of-memory failure, or a timeout (currently at 10 seconds). @@ -13,10 +16,7 @@ For each operation it is also possible to include custom headers. Note that foll The `Host` header is taken from the URL itself, the `Connection` is always set to `close`, and the `User-Agent` is `ESP8266`. -Note that it is not possible to execute concurrent HTTP requests using this module. Starting a new request before the previous has completed will result in undefined behaviour. - -#### See also - - [`net.createConnection()`](#netcreateconnection) +Note that it is not possible to execute concurrent HTTP requests using this module. Starting a new request before the previous has completed will result in undefined behavior. ## http.delete() diff --git a/docs/en/modules/hx711.md b/docs/en/modules/hx711.md index 0e0169e7..bbfba6b3 100644 --- a/docs/en/modules/hx711.md +++ b/docs/en/modules/hx711.md @@ -1,4 +1,7 @@ # HX711 Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-10-09 | [Chris Takahashi](https://github.com/christakahashi) | [Chris Takahashi](https://github.com/christakahashi) | [hx711.c](../../../app/modules/hx711.c)| This module provides access to an [HX711 load cell amplifier/ADC](https://learn.sparkfun.com/tutorials/load-cell-amplifier-hx711-breakout-hookup-guide). The HX711 is an inexpensive 24bit ADC with programmable 128x, 64x, and 32x gain. Currently only channel A at 128x gain is supported. diff --git a/docs/en/modules/i2c.md b/docs/en/modules/i2c.md index 721bf761..c7ef9afc 100644 --- a/docs/en/modules/i2c.md +++ b/docs/en/modules/i2c.md @@ -1,4 +1,7 @@ # I²C Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [i2c.c](../../../app/modules/i2c.c)| ## i2c.address() Setup I²C address and read/write mode for the next transfer. diff --git a/docs/en/modules/mdns.md b/docs/en/modules/mdns.md index 111f8dc7..ef6c1285 100644 --- a/docs/en/modules/mdns.md +++ b/docs/en/modules/mdns.md @@ -1,4 +1,7 @@ # mDNS Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-02-24 | [Philip Gladstone](https://github.com/pjsg) | [Philip Gladstone](https://github.com/pjsg) | [mdns.c](../../../app/modules/mdns.c)| [Multicast DNS](https://en.wikipedia.org/wiki/Multicast_DNS) is used as part of Bonjour / Zeroconf. This allows system to identify themselves and the services that they provide on a local area network. Clients are then able to discover these systems and connect to them. diff --git a/docs/en/modules/mqtt.md b/docs/en/modules/mqtt.md index 36905325..844bd0de 100644 --- a/docs/en/modules/mqtt.md +++ b/docs/en/modules/mqtt.md @@ -1,4 +1,8 @@ # MQTT Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-01-23 | [Stephen Robinson](https://github.com/esar/contiki-mqtt), [Tuan PM](https://github.com/tuanpmt/esp_mqtt) | [Vowstar](https://github.com/vowstar) | [mqtt.c](../../../app/modules/mqtt.c)| + The client adheres to version 3.1.1 of the [MQTT](https://en.wikipedia.org/wiki/MQTT) protocol. Make sure that your broker supports and is correctly configured for version 3.1.1. The client is backwards incompatible with brokers running MQTT 3.1. diff --git a/docs/en/modules/net.md b/docs/en/modules/net.md index 63522798..61d40459 100644 --- a/docs/en/modules/net.md +++ b/docs/en/modules/net.md @@ -1,7 +1,11 @@ # net Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [net.c](../../../app/modules/net.c)| + ## Constants -`net.TCP`, `net.UDP` +Constants to be used in other functions: `net.TCP`, `net.UDP` ## net.createConnection() diff --git a/docs/en/modules/node.md b/docs/en/modules/node.md index af8beb7f..b2fa0785 100644 --- a/docs/en/modules/node.md +++ b/docs/en/modules/node.md @@ -1,4 +1,8 @@ # node Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [node.c](../../../app/modules/node.c)| + The node module provides access to system-level features such as sleep, restart and various info and IDs. ## node.bootreason() diff --git a/docs/en/modules/ow.md b/docs/en/modules/ow.md index e1bfee89..4cc23462 100644 --- a/docs/en/modules/ow.md +++ b/docs/en/modules/ow.md @@ -1,4 +1,7 @@ # 1-Wire Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [ow.c](../../../app/modules/ow.c)| This module provides functions to work with the [1-Wire](https://en.wikipedia.org/wiki/1-Wire) device communications bus system. diff --git a/docs/en/modules/perf.md b/docs/en/modules/perf.md index b6bdf729..768bd0bb 100644 --- a/docs/en/modules/perf.md +++ b/docs/en/modules/perf.md @@ -1,12 +1,11 @@ # perf Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-02-26 | [Philip Gladstone](https://github.com/pjsg) | [Philip Gladstone](https://github.com/pjsg) | [perf.c](../../../app/modules/perf.c)| -This module provides simple performance measurement for an application. -It samples the program counter roughly every 50 microseconds and builds -a histogram of the values that it finds. Since there is only a small amount -of memory to store the histogram, the user can specify which area of code -is of interest. The default is the enitre flash which contains code. Once the hotspots are -identified, then the run can then be repeated with different areas and at different -resolutions to get as much information as required. + +This module provides simple performance measurement for an application. It samples the program counter roughly every 50 microseconds and builds a histogram of the values that it finds. Since there is only a small amount +of memory to store the histogram, the user can specify which area of code is of interest. The default is the entire flash which contains code. Once the hotspots are identified, then the run can then be repeated with different areas and at different resolutions to get as much information as required. ## perf.start() Starts a performance monitoring session. diff --git a/docs/en/modules/pwm.md b/docs/en/modules/pwm.md index 8849d2d0..3c22b959 100644 --- a/docs/en/modules/pwm.md +++ b/docs/en/modules/pwm.md @@ -1,4 +1,7 @@ # PWM Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [pwm.c](../../../app/modules/pwm.c)| ## pwm.close() Quit PWM mode for the specified GPIO pin. diff --git a/docs/en/modules/rc.md b/docs/en/modules/rc.md new file mode 100644 index 00000000..6fea3d5f --- /dev/null +++ b/docs/en/modules/rc.md @@ -0,0 +1,4 @@ +# RC Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-06-12 | [Mike Wen](https://github.com/mikewen) | - | [rc.c](../../../app/modules/rc.c)| diff --git a/docs/en/modules/rotary.md b/docs/en/modules/rotary.md index c9139dcc..e01033b1 100644 --- a/docs/en/modules/rotary.md +++ b/docs/en/modules/rotary.md @@ -1,14 +1,12 @@ # rotary Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-03-01 | [Philip Gladstone](https://github.com/pjsg) | [Philip Gladstone](https://github.com/pjsg) | [rotary.c](../../../app/modules/rotary.c)| -This module can read the state of cheap rotary encoder switches. These are available at -all the standard places for a dollar or two. They are five pin devices where three are used -for a gray code encoder for rotation, and two are used for the push switch. These switches -are commonly used in car audio systems. -These switches do not have absolute positioning, but only encode the number of positions -rotated clockwise / anticlockwise. To make use of this module, connect the common pin on the quadrature -encoder to ground and the A and B phases to the nodemcu. One pin of the push switch should -also be grounded and the other pin connected to the nodemcu. +This module can read the state of cheap rotary encoder switches. These are available at all the standard places for a dollar or two. They are five pin devices where three are used for a gray code encoder for rotation, and two are used for the push switch. These switches are commonly used in car audio systems. + +These switches do not have absolute positioning, but only encode the number of positions rotated clockwise / anti-clockwise. To make use of this module, connect the common pin on the quadrature encoder to ground and the A and B phases to the NodeMCU. One pin of the push switch should also be grounded and the other pin connected to the NodeMCU. ## Sources for parts diff --git a/docs/en/modules/rtcfifo.md b/docs/en/modules/rtcfifo.md index 485e700a..7c02213a 100644 --- a/docs/en/modules/rtcfifo.md +++ b/docs/en/modules/rtcfifo.md @@ -1,4 +1,7 @@ -# rtcfifo Module +# RTC FIFO Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-06-26 | [DiUS](https://github.com/DiUS), [Johny Mattsson](https://github.com/jmattsson), Bernd Meyer | [Johny Mattsson](https://github.com/jmattsson) | [rtcfifo.c](../../../app/modules/rtcfifo.c)| The rtcfifo module implements a first-in,first-out storage intended for sensor readings. As the name suggests, it is backed by the [RTC](https://en.wikipedia.org/wiki/Real-time_clock) user memory and as such survives deep sleep cycles. Conceptually it can be thought of as a cyclic array of `{ timestamp, name, value }` tuples. Internally it uses a space-optimized storage format to allow the greatest number of samples to be kept. This comes with several trade-offs, and as such is not a one-solution-fits-all. Notably: - Timestamps are stored with second-precision. diff --git a/docs/en/modules/rtcmem.md b/docs/en/modules/rtcmem.md index 2fd7cc4c..ca5648d8 100644 --- a/docs/en/modules/rtcmem.md +++ b/docs/en/modules/rtcmem.md @@ -1,4 +1,8 @@ -# rtcmem Module +# RTC User Memory Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-06-25 | [DiUS](https://github.com/DiUS), [Johny Mattsson](https://github.com/jmattsson) | [Johny Mattsson](https://github.com/jmattsson) | [rtcmem.c](../../../app/modules/rtcmem.c)| + The rtcmem module provides basic access to the [RTC](https://en.wikipedia.org/wiki/Real-time_clock) (Real Time Clock) memory. The RTC in the ESP8266 contains memory registers which survive a deep sleep, making them highly useful for keeping state across sleep cycles. Some of this memory is reserved for system use, but 128 slots (each 32bit wide) are available for application use. This module provides read and write access to these. diff --git a/docs/en/modules/rtctime.md b/docs/en/modules/rtctime.md index 933899e4..0f834f69 100644 --- a/docs/en/modules/rtctime.md +++ b/docs/en/modules/rtctime.md @@ -1,4 +1,7 @@ -# rtctime Module +# RTC Time Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-06-25 | [DiUS](https://github.com/DiUS), [Johny Mattsson](https://github.com/jmattsson), Bernd Meyer | [Johny Mattsson](https://github.com/jmattsson) | [rtctime.c](../../../app/modules/rtctime.c)| The rtctime module provides advanced timekeeping support for NodeMCU, including keeping time across deep sleep cycles (provided [`rtctime.dsleep()`](#rtctimedsleep) is used instead of [`node.dsleep()`](node.md#nodedsleep)). This can be used to significantly extend battery life on battery powered sensor nodes, as it is no longer necessary to fire up the RF module each wake-up in order to obtain an accurate timestamp. diff --git a/docs/en/modules/sigma-delta.md b/docs/en/modules/sigma-delta.md index b962a127..a569531a 100644 --- a/docs/en/modules/sigma-delta.md +++ b/docs/en/modules/sigma-delta.md @@ -1,5 +1,9 @@ -# sigma delta Module -This module provides access to the sigma-delta component. It's a hardware signal generator that can be routed to any of the GPIOs except pin 0. +# Sigma-delta Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2016-02-20 | [Arnim Läuger](https://github.com/devsaurus), [Espressif example](http://bbs.espressif.com/viewtopic.php?t=49) | [Arnim Läuger](https://github.com/devsaurus) | [sigma_delta.c](../../../app/modules/sigma_delta.c)| + +This module provides access to the [sigma-delta](https://en.wikipedia.org/wiki/Delta-sigma_modulation) component. It's a hardware signal generator that can be routed to any of the GPIOs except pin 0. The signal generation is controlled by the [`setprescale()`](#sigma_deltasetprescale) and [`settarget()`](#sigma_deltasettarget) functions. diff --git a/docs/en/modules/sntp.md b/docs/en/modules/sntp.md index dbbbb8e6..f944961e 100644 --- a/docs/en/modules/sntp.md +++ b/docs/en/modules/sntp.md @@ -1,4 +1,7 @@ # SNTP Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-06-30 | [DiUS](https://github.com/DiUS), [Johny Mattsson](https://github.com/jmattsson) | [Johny Mattsson](https://github.com/jmattsson) | [sntp.c](../../../app/modules/sntp.c)| The SNTP module implements a [Simple Network Time Procotol](https://en.wikipedia.org/wiki/Network_Time_Protocol#SNTP) client. This includes support for the "anycast" [NTP](https://en.wikipedia.org/wiki/Network_Time_Protocol) mode where, if supported by the NTP server(s) in your network, it is not necessary to even know the IP address of the NTP server. diff --git a/docs/en/modules/spi.md b/docs/en/modules/spi.md index b15d9eeb..6ce48530 100644 --- a/docs/en/modules/spi.md +++ b/docs/en/modules/spi.md @@ -1,4 +1,8 @@ # SPI Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-01-16 | [Ibrahim Abd Elkader](https://github.com/iabdalkader) | [Arnim Läuger](https://github.com/devsaurus) | [spi.c](../../../app/modules/spi.c)| + All transactions for sending and receiving are most-significant-bit first and least-significant last. For technical details of the underlying hardware refer to [metalphreak's ESP8266 HSPI articles](http://d.av.id.au/blog/tag/hspi/). diff --git a/docs/en/modules/struct.md b/docs/en/modules/struct.md index b391ddf4..57aa9191 100644 --- a/docs/en/modules/struct.md +++ b/docs/en/modules/struct.md @@ -1,20 +1,13 @@ -# struct module +# Struct Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-02-13 | [Roberto Ierusalimschy](http://www.inf.puc-rio.br/~roberto/struct/), [Philip Gladstone](https://github.com/pjsg) | [Philip Gladstone](https://github.com/pjsg) | [struct.c](../../../app/modules/struct.c)| -This module offers basic facilities to convert Lua values to and from C -structs. Its main functions are `struct.pack`, which packs multiple Lua -values into a struct-like string; and `struct.unpack`, which unpacks -multiple Lua values from a given struct-like string. +This module offers basic facilities to convert Lua values to and from C structs. Its main functions are `struct.pack`, which packs multiple Lua values into a struct-like string; and `struct.unpack`, which unpacks multiple Lua values from a given struct-like string. -The first argument to both functions is a *format string*, which -describes the layout of the structure. The format string is a sequence -of conversion elements, which respect the current endianess and the -current alignment requirements. Initially, the current endianess is the -machine's native endianness and the current alignment requirement is 1 -(meaning no alignment at all). You can change these settings with -appropriate directives in the format string. +The first argument to both functions is a *format string*, which describes the layout of the structure. The format string is a sequence of conversion elements, which respect the current endianess and the current alignment requirements. Initially, the current endianess is the machine's native endianness and the current alignment requirement is 1 (meaning no alignment at all). You can change these settings with appropriate directives in the format string. -Note that the float and double conversions are only available with -a floating point NodeMCU build. +Note that the float and double conversions are only available with a floating point NodeMCU build. ### Format String diff --git a/docs/en/modules/tmr.md b/docs/en/modules/tmr.md index e4056923..7dab8cc0 100644 --- a/docs/en/modules/tmr.md +++ b/docs/en/modules/tmr.md @@ -1,4 +1,7 @@ -# tmr Module +# Timer Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-12 | [Zeroday](https://github.com/funshine) | [dnc40085](https://github.com/dnc40085) | [tmr.c](../../../app/modules/tmr.c)| The tmr module allows access to simple timers, the system counter and uptime. diff --git a/docs/en/modules/tsl2561.md b/docs/en/modules/tsl2561.md index 7388c595..8014aa3a 100644 --- a/docs/en/modules/tsl2561.md +++ b/docs/en/modules/tsl2561.md @@ -1,4 +1,7 @@ # TSL2561 Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-08-22 | [Michael Lucas](https://github.com/Aeprox) | [Michael Lucas](https://github.com/Aeprox) | [tsl2561.c](../../../app/modules/tsl2561.c)| ## tsl2561.getlux() Reads sensor values from the device and returns calculated lux value. @@ -128,4 +131,4 @@ if status == tsl2561.TSL2561_OK then lux = tsl2561.getlux() print("Illuminance: "..lux.." lx") end -``` \ No newline at end of file +``` diff --git a/docs/en/modules/u8g.md b/docs/en/modules/u8g.md index 1f37e512..494a7fd2 100644 --- a/docs/en/modules/u8g.md +++ b/docs/en/modules/u8g.md @@ -1,4 +1,8 @@ # u8g Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-01-30 | [Oli Kraus](https://github.com/olikraus/u8glib), [Arnim Läuger](https://github.com/devsaurus) | [Arnim Läuger](https://github.com/devsaurus) | [u8glib](../../../app/u8glib/)| + U8glib is a graphics library developed at [olikraus/u8glib](https://github.com/olikraus/u8glib) with support for many different displays. The NodeMCU firmware supports a subset of these. I²C and SPI mode: diff --git a/docs/en/modules/uart.md b/docs/en/modules/uart.md index dd1358cf..2d5d6806 100644 --- a/docs/en/modules/uart.md +++ b/docs/en/modules/uart.md @@ -1,4 +1,8 @@ # UART Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2014-12-22 | [Zeroday](https://github.com/funshine) | [Zeroday](https://github.com/funshine) | [uart.c](../../../app/modules/uart.c)| + The [UART](https://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter) (Universal asynchronous receiver/transmitter) module allows configuration of and communication over the UART serial port. ## uart.alt() diff --git a/docs/en/modules/ucg.md b/docs/en/modules/ucg.md index ad7c1e16..cac5f97a 100644 --- a/docs/en/modules/ucg.md +++ b/docs/en/modules/ucg.md @@ -1,4 +1,8 @@ # ucg Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-08-05 | [Oli Kraus](https://github.com/olikraus/ucglib), [Arnim Läuger](https://github.com/devsaurus) | [Arnim Läuger](https://github.com/devsaurus) | [ucglib](../../../app/ucglib/)| + Ucglib is a graphics library developed at [olikraus/ucglib](https://github.com/olikraus/ucglib) with support for color TFT displays. The NodeMCU firmware supports a subset of these: - ILI9163 diff --git a/docs/en/modules/wifi.md b/docs/en/modules/wifi.md index a218f2f8..128bc90b 100644 --- a/docs/en/modules/wifi.md +++ b/docs/en/modules/wifi.md @@ -1,4 +1,8 @@ # WiFi Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-05-12 | [Zeroday](https://github.com/funshine) | [dnc40085](https://github.com/dnc40085) | [wifi.c](../../../app/modules/wifi.c)| + The NodeMCU WiFi control is spread across several tables: - `wifi` for overall WiFi configuration diff --git a/docs/en/modules/ws2801.md b/docs/en/modules/ws2801.md index 9f3299ae..032eccc8 100644 --- a/docs/en/modules/ws2801.md +++ b/docs/en/modules/ws2801.md @@ -1,4 +1,8 @@ # WS2801 Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-07-12 | [Espressif example](https://github.com/CHERTS/esp8266-devkit/blob/master/Espressif/examples/EspLightNode/user/ws2801.c), [Konrad Beckmann](https://github.com/kbeckmann) | [Konrad Beckmann](https://github.com/kbeckmann) | [ws2801.c](../../../app/modules/ws2801.c)| + ## ws2801.init() Initializes the module and sets the pin configuration. diff --git a/docs/en/modules/ws2812.md b/docs/en/modules/ws2812.md index 07829e8b..068ab6a1 100644 --- a/docs/en/modules/ws2812.md +++ b/docs/en/modules/ws2812.md @@ -1,4 +1,8 @@ # WS2812 Module +| Since | Origin / Contributor | Maintainer | Source | +| :----- | :-------------------- | :---------- | :------ | +| 2015-02-05 | [Till Klocke](https://github.com/dereulenspiegel) | [Till Klocke](https://github.com/dereulenspiegel) | [ws2812.c](../../../app/modules/ws2812.c)| + ## ws2812.write() Send GRB data in 8 bits to a WS2812 chain. diff --git a/docs/js/extra.js b/docs/js/extra.js index 75bdfb51..01349c91 100644 --- a/docs/js/extra.js +++ b/docs/js/extra.js @@ -10,6 +10,7 @@ var nodemcu = nodemcu || {}; addToc(); hideNavigationForAllButSelectedLanguage(); addLanguageSelectorToRtdFlyOutMenu(); + replaceRelativeLinksWithStaticGitHubUrl(); }); /** @@ -104,6 +105,20 @@ var nodemcu = nodemcu || {}; } } + /** + * The module doc pages contain relative links to artifacts in the GitHub repository. For those links to work both + * on GitHub (i.e. when the page is viewed on GitHub) and on RTD they are defined with a relative URL. This function + * replaces the relative path with an absolute path based on the selected branch. + */ + function replaceRelativeLinksWithStaticGitHubUrl() { + var relativePath = "../../../.."; + var gitHubPath = "https://github.com/nodemcu/nodemcu-firmware/tree/" + determineSelectedBranch(); + var gitHubLinks = $("a[href^='" + relativePath + "']").each(function (index) { + var url = $(this).attr('href'); + $(this).attr('href', url.replace(relativePath, gitHubPath)); + }); + } + function createLanguageLinkFor(languageCode, isCurrentlySelected) { var strong; // split[0] is an '' because the path starts with the separator @@ -146,6 +161,23 @@ var nodemcu = nodemcu || {}; return selectedLanguageCode; } + /** + * Analyzes the URL of the current page to find out what the selected GitHub branch is. It's usually + * part of the location path. The code needs to distinguish between running MkDocs standalone + * and docs served from RTD. If no valid branch could be determined 'dev' returned. + * + * @returns GitHub branch name + */ + function determineSelectedBranch() { + var branch = 'dev', path = window.location.pathname; + if (window.location.origin.indexOf('readthedocs') > -1) { + // path is like /en///build/ -> extract 'lang' + // split[0] is an '' because the path starts with the separator + branch = path.split('/')[2]; + } + return branch; + } + function values(associativeArray) { var values = []; for (var key in associativeArray) { diff --git a/mkdocs.yml b/mkdocs.yml index 247eb237..d0d3d68f 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -57,10 +57,11 @@ pages: - 'ow (1-Wire)': 'en/modules/ow.md' - 'perf': 'en/modules/perf.md' - 'pwm' : 'en/modules/pwm.md' + - 'rc' : 'en/modules/rc.md' - 'rotary' : 'en/modules/rotary.md' + - 'rtcfifo': 'en/modules/rtcfifo.md' - 'rtcmem': 'en/modules/rtcmem.md' - 'rtctime': 'en/modules/rtctime.md' - - 'rtcfifo': 'en/modules/rtcfifo.md' - 'sigma delta': 'en/modules/sigma-delta.md' - 'sntp': 'en/modules/sntp.md' - 'spi': 'en/modules/spi.md'