1
0
mirror of https://github.com/elua/elua.git synced 2025-01-25 01:02:54 +08:00
elua/doc/eluadoc/refman_gen_cpu.lua

146 lines
6.0 KiB
Lua
Raw Normal View History

- doc folder replaced by some work done on Led Lab for the new doc and site - 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
2011-05-06 06:49:21 -03:00
-- eLua reference manual - CPU module
data_en =
{
-- Title
title = "eLua reference manual - CPU module",
-- Menu name
menu_name = "cpu",
-- Overview
overview = [[This module deals with low-level access to CPU (and related modules) functionality, such as reading and writing memory, or
enabling and disabling interrupts. It also offers access to platform specific CPU-related constants, as explained @#cpu_constants@here@.]],
- doc folder replaced by some work done on Led Lab for the new doc and site - 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
2011-05-06 06:49:21 -03:00
-- Data structures, constants and types
structures =
{
{ text = [[cpu.INT_GPIOA
cpu.INT_GPIOB
.............
cpu.INT_UDMA]],
name = "CPU constants",
desc = [[eLua has a mechanism that lets the user export an unlimited number of constants to the $cpu$ module. Although in theory any kind of constant can be exposed by this module,
one should only use constants related to the CPU and its subsystems (as shown above, where a number of CPU specific interrupt masks are exposed to Lua using this mechanism). The constants
visible to the CPU module are given by 3 separate macros (each can be empty):</p>
<ul>
<li> <b>PLATFORM_CPU_CONSTANTS_INTS</b>: the IDs of the interrupt supported by the @inthandlers.html@eLua interrupt subsystem@ on this CPU.</li>
<li> <b>PLATFORM_CPU_CONSTANTS_PLATFORM</b>: various CPU and platform related constants (for example peripheral register addresses and maps).</li>
<li> <b>PLATFORM_CPU_CONSTANTS_CONFIGURED</b>: these are defined in the @configurator.html@configurator@.</li>
</ul>
<p>To use this mechanism, just declare the above constants your platform's header files (for example the CPU definition file) and list your constants as part of this macro,
each enclosed in a special macro called $_C$. For example, to get the constants listed above declare your $PLATFORM_CPU_CONSTANTS$ macro like this:</p>
~#define PLATFORM_CPU_CONSTANTS_PLATFORM\
- doc folder replaced by some work done on Led Lab for the new doc and site - 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
2011-05-06 06:49:21 -03:00
_C( INT_GPIOA ),\
_C( INT_GPIOB ),\
.................
_C( INT_UDMA )~
<p>It's worth to note that adding more constants does not increase RAM usage, only Flash usage, so you can expose as many constants as you need without worrying about RAM consumption.]]
- doc folder replaced by some work done on Led Lab for the new doc and site - 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
2011-05-06 06:49:21 -03:00
},
},
-- Functions
funcs =
{
{ sig = "#cpu.w32#( address, data )",
desc = "Writes a 32-bit word to memory.",
args =
{
"$address$ - the memory address.",
"$data$ - the 32-bit data to write."
},
},
{ sig = "data = #cpu.r32#( address )",
desc = "Read a 32-bit word from memory.",
args = "$address$ - the memory address.",
ret = "$data$ - the 32-bit word read from memory."
},
{ sig = "#cpu.w16#( address, data )",
desc = "Writes a 16-bit word to memory.",
args =
{
"$address$ - the memory address.",
"$data$ - the 16-bit data to write."
},
},
{ sig = "data = #cpu.r16#( address )",
desc = "Reads a 16-bit word from memory.",
args = "$address$ - the memory address.",
ret = "$data$ - the 16-bit word read from memory."
},
{ sig = "#cpu.w8#( address, data )",
desc = "Writes a byte to memory.",
args =
{
"$address$ - the memory address.",
"$data$ - the byte to write."
}
},
{ sig = "data = #cpu.r8#( address )",
desc = "Reads a byte from memory.",
args = "$address$ - the memory address",
ret = "$data$ - the byte read from memory."
},
{ sig = "#cpu.cli#( [id], [resnum1], [resnum2], ... [resnumn])",
desc = "Disables the global CPU interrupt flag if called without arguments, or a specific interrupt for a list of resource IDs if called with arguments.",
args =
{
"$id$ - the interrupt ID. If specified, at least one resource ID must also be specified.",
"$resnum1$ - the first resource ID, required if $id$ is specified.",
"$resnum2 (optional)$ - the second resource ID.",
"$resnumn (optional)$ - the #n#-th resource ID."
}
},
{ sig = "#cpu.sei#( [id], [resnum1], [resnum2], ... [resnumn])",
desc = "Enables the global CPU interrupt flag if called without arguments, or a specific interrupt for a list of resource IDs if called with arguments.",
args =
{
"$id$ - the interrupt ID. If specified, at least one resource ID must also be specified.",
"$resnum1$ - the first resource ID, required if $id$ is specified.",
"$resnum2 (optional)$ - the second resource ID.",
"$resnumn (optional)$ - the #n#-th resource ID."
}
},
{ sig = "clock = #cpu.clock#()",
desc = "Get the CPU core frequency.",
ret = "$clock$ - the CPU clock (in Hertz)."
},
{ sig = "prev_handler = #cpu.set_int_handler#( id, handler )",
desc = "Sets the Lua interrupt handler for interrupt *id* to function *handler*. *handler* can be #nil# to disable the interrupt handler. Only available if interrupt support is enabled, check @inthandlers.html@here@ for details.",
args =
{
"$id$ - the interrup ID.",
"$handler$ - the Lua interrupt handler function, or *nil* to disable the Lua interrupt handler feature."
},
ret = "$prev_handler$ - the previous interrupt handler for interrupt *id*, or *nil* if an interrupt handler was not set for interrupt *id*."
},
{ sig = "handler = #cpu.get_int_handler#( id )",
desc = "Returns the Lua interrupt handler for interrupt *id*",
args = "$id$ - the interrup ID.",
ret = "$handler$ - the interrupt handler for interrupt *id*, or *nil* if an interrupt handler is not set for interrupt *id*."
},
{ sig = "#cpu.get_int_flag#( id, resnum, [clear] )",
desc = "Get the interrupt pending flag of an interrupt ID/resource ID combination, and optionally clear the pending flag. Only available if interrupt support is enabled, check @inthandlers.html@here@ for details.",
args =
{
"$id$ - the interrupt ID.",
"$resnum$ - the resource ID.",
"$clear (optional)$ - $true$ to clear the interrupt pending flag or $false$ to leave the interrupt pending flag untouched. Defaults to $true$ if not specified."
}
}
}
}