mirror of
https://github.com/elua/elua.git
synced 2025-01-25 01:02:54 +08:00
- This should actually be a merge but we made a mistake on the initial repo creation and a merge was not possible. - Below there is a resumed log of the commit messages for the few steps, just for the record. - The merged commit messages for this work are: - Removing Portuguese doc content - Ignore folder names fixed on .gitignore - Removed doc files which content migrated to the CMS - docdata.lua updated accordingly - Doc build checked ok - Overall doc structure and contents still being refined - Removing folder cache from git versioning - Removing folder dist from git versioning. The folders above are generated by the buildall.lua script and are not part of the sources - Adding .gitignore file with objects info to inform git what to ignore - Removed file - Merge branch 'master' of git@repos.giga.puc-rio.br:elua-doc.git - Moving all files and folders to a working doc folder - Css updated - Index page added and CSS adjusts - Merge branch 'master' of git@repos.giga.puc-rio.br:elua-doc.git - Signed-off-by: Guilherme Sanchez <guilhermesanchezpacheco@gmail.com> - Merge branch 'master' of git@repos.giga.puc-rio.br:elua-doc.git - files deleted - Changed function that creates functions submenus. - Menu inserted with árvore, CSS adjusts, google search - Changed past design to new design - CSS updated - initial import - The commit ids were also preserved but they are related to this "other" work done on Led Lab. We'll keep the repo just in case. 4dce3f77c47b0c3001a2075a946e80ee52759b49 - Removing Portuguese doc content 78d8847525cacf045fe7e672cff6bd1e058a6a4b Ignore folder names fixed on .gitignore 48dee6b7962168ab1098bf709ead6f3cfe6b7964 - Removed doc files which content migrated to the CMS - docdata.lua updated accordingly - Doc build checked ok - Overall doc structure and contents still being refined 2aa2fe0c554db03dbc7029c34d0f4500fe625b37 - Removing folder cache from git versioning - Removing folder dist from git versioning The folders above are generated by the buildall.lua script and are not part of the sources - Adding .gitignore file with objects info to inform git what to ignore af6cc2890edf1855af319dc999a03feee5f9bee0 Removed file 6a180e72eb4f4860620cafc0685000e9f2174cfe Merge branch 'master' of git@repos.giga.puc-rio.br:elua-doc.git eb430112e78ae537459ab315e228ebca84bdf2d4 Moving all files and folders to a working doc folder d28a7c99489915630bd2625f3756fecf0d08ce37 Css updated 32836ffe382f04ab07c3e6f018c7b449a20d7a8d Index page added and CSS adjusts 1461d9957d9d25a1467cb57ab8717aa213a37e8d Merge branch 'master' of git@repos.giga.puc-rio.br:elua-doc.git ae1934c04f35a29e25bb4495ae8a31cd9c000b5b Signed-off-by: Guilherme Sanchez <guilhermesanchezpacheco@gmail.com> b5f31d70f1fac8d3fba325c9867a03f976775698 Merge branch 'master' of git@repos.giga.puc-rio.br:elua-doc.git ec9ad8446b7ea38b252c6a416e70774349835e45 files deleted bd7a80151b2030720ba8d8a303467d8c25a4b4b2 Changed function that creates functions submenus. 6a7494acaec694fadbb13520bcbccc51a6b95dfe Inserido menu com árvore, ajustes no CSS, busca do google e979f1c259d425c9a3be83f9cda20eddffe073bb Changed past design to new design. 381459e95286886b052103a0253e60b29e064d7a CSS updated 4f81d2f1195efe733fe5f97517be325d75937bc3 initial import
103 lines
5.1 KiB
Lua
103 lines
5.1 KiB
Lua
-- eLua reference manual - ADC
|
|
|
|
data_en =
|
|
{
|
|
|
|
-- Title
|
|
title = "eLua reference manual - ADC",
|
|
|
|
-- Menu name
|
|
menu_name = "adc",
|
|
|
|
-- Overview
|
|
overview = [[This module contains functions that access analog to digital converter (ADC) peripherals.</p>
|
|
<p>When utilizing this module, acquiring ADC data is a two step process: requesting sample conversions (using $adc.sample$) and extraction of conversion results from a conversion buffer (using $adc.getsample$, $adc.getsamples$ or $adc.insertsamples$). Various configuration parameters are available to set conversion rate, how results are extracted from the buffer and how these results are processed prior to extraction.</p>
|
|
<p>This module can be utilized if the device in use has a supported ADC peripheral (see @status.html@status@ for details) and if ADC functionality is enabled at build time (see @building.html@building@).</p>
|
|
<p><span class="warning">IMPORTANT</span>: Platform support varies for this module (see @status.html#plat_notes@status notes@ for details) .
|
|
]],
|
|
|
|
-- Functions
|
|
funcs =
|
|
{
|
|
{ sig = "#adc.sample#( id, count )",
|
|
desc = "Initiate conversion and buffering of samples on an ADC channel.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID. Optionally, this may be a table containing a list of channel IDs (i.e.: {0, 2, 3}), allowing synchronization of acquisition. NOTE: This acceptance of mixed types is only for the sample function.",
|
|
"$count$ - number of samples to acquire and place in buffer."
|
|
}
|
|
},
|
|
{ sig = "sample = #adc.getsample#( id )",
|
|
desc = "Get a single conversion value from the buffer associated with a given channel.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID."
|
|
},
|
|
ret = "$sample$ - numeric value of conversion, or nil if sample was not available."
|
|
},
|
|
{ sig = "samples = #adc.getsamples#( id, count )",
|
|
desc = "Get multiple conversion values from the buffer associated with a given channel.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID.",
|
|
"$count$ - optional parameter to indicate number of samples to return. If not included, all available samples are returned."
|
|
},
|
|
ret = "$samples$ - table containing integer conversion values. If not enough samples are available, remaining indices will be nil."
|
|
},
|
|
{ sig = "#adc.insertsamples#( id, table, idx, count )",
|
|
desc = "Get multiple conversion values from a channel's buffer, and write them into a table.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID.",
|
|
"$table$ - table to write samples to. Values at $table$[$idx$] to $table$[$idx$ + $count$ -1] will be overwritten with samples (or nil if not enough samples are available).",
|
|
"$idx$ - first index to use in the table for writing samples.",
|
|
"$count$ - number of samples to return. If not enough samples are available (after blocking, if enabled) remaining values will be nil."
|
|
}
|
|
},
|
|
{ sig = "maxval = #adc.maxval#( id )",
|
|
desc = "Get the maximum value (corresponding to the maximum voltage) that can be returned on a given channel.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID."
|
|
},
|
|
ret = "$maxval$ - maximum integer conversion value (based on channel resolution)"
|
|
},
|
|
{ sig = "clock = #adc.setclock#( id, clock, timer_id )",
|
|
desc = "Set the frequency (number of samples per second) at which voltages will be converted into samples.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID.",
|
|
"$clock$ - frequency to acquire samples at in Hz (number of samples per second), 0 to acquire as fast as possible.",
|
|
"$timer_id$ - Timer channel ID to use to control ADC conversion. <strong>Note:</strong> At this time, a timer selection will apply to all channels on a given ADC peripheral."
|
|
},
|
|
ret = "$clock$ - actual acquisition frequency to be used"
|
|
},
|
|
{ sig = "status = #adc.isdone#( id )",
|
|
desc = "Check whether samples are still being acquired on a channel.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID."
|
|
},
|
|
ret = "$status$ - 1 if no samples are being acquired, 0 if samples are pending acquisition."
|
|
},
|
|
{ sig = "#adc.setblocking#( id, mode )",
|
|
desc = "Set whether or not functions that request converted samples should wait for requested samples or return immediately with what is available.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID.",
|
|
"$mode$ - 1 if requests to get samples should block until requested samples are available or sampling has completed, 0 to return immediately with available samples"
|
|
},
|
|
},
|
|
{ sig = "#adc.setsmoothing#( id, length )",
|
|
desc = "Set the length of the moving average filter. When $length$ is greater than 1, samples pulled from the conversion buffer will be averaged with the preceding $length$ - 1 buffered values.",
|
|
args =
|
|
{
|
|
"$id$ - ADC channel ID.",
|
|
"$length$ - number of preceding samples to include in moving average filter (must be a power of 2). If 1, filter is disabled. When enabled, a filter buffer is filled before the main conversion buffer, so that averages are always over the same number of samples."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
data_pt = data_en
|