1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/doc/eluadoc/arch_platform_i2c.lua

105 lines
3.6 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 platform interface - I2C
-- Make a full description for each language
data_en =
{
-- Menu name
menu_name = "I2C",
-- Title
title = "eLua platform interface - I2C",
-- Overview
overview = "This part of the platform interface groups functions related to the I2C interface(s) of the MCU. Currently only the I2C master mode is supported by eLua.",
-- Data structures, constants and types
structures =
{
{ text = [[// I2C speed
enum
{
PLATFORM_I2C_SPEED_SLOW = 100000,
PLATFORM_I2C_SPEED_FAST = 400000
};]],
name = "I2C speed",
desc = "Constants used to configure the speed of the I2C interface."
},
{ text = [[// I2C direction
enum
{
PLATFORM_I2C_DIRECTION_TRANSMITTER,
PLATFORM_I2C_DIRECTION_RECEIVER
};
]],
name = "I2C transfer direction",
desc = "Constants used to select the I2C master transfer direction (transmitter or receiver)."
},
},
-- Functions
funcs =
{
{ sig = "int #platform_i2c_exists#( unsigned id );",
desc = [[Checks if the platform has the hardware I2C specified as argument. Implemented in %src/common.c%, it uses the $NUM_I2C$ macro that must be defined in the
platform's $platform_conf.h$ file (see @arch_overview.html#platforms@here@ for details). For example:</p>
~#define NUM_I2C 1 $// The platform has one I2C interface$~<p> ]],
args = "$id$ - I2C interface ID.",
ret = "1 if the I2C interface exists, 0 otherwise"
},
{ sig = "u32 #platform_i2c_setup#( unsigned id, u23 speed );",
desc = [[This function is used to initialize the parameters of the I2C interface. <span class="warning">NOTE</span>: currently, only master I2C mode is implemented in eLua.]],
args =
{
"$id$ - I2C interface ID.",
"$speed$ - the speed of the interface, can be either $PLATFORM_I2C_SPEED_SLOW$ or $PLATFORM_I2C_SPEED_FAST$ as defined @#i2c_speed@here@"
},
ret = "the actual speed set for the I2C interface. Depending on the hardware, this may have a different value than the $speed$ argument."
},
{ sig = "void #platform_i2c_send_start#( unsigned id );",
desc = "Send an I2C START condition on the specified interface.",
args = "$id$ - I2C interface ID."
},
{ sig = "void #platform_i2c_send_stop#( unsigned id );",
desc = "Send an I2C STOP condition on the specified interface.",
args = "$id$ - I2C interface ID."
},
{ sig = "int #platform_i2c_send_address#( unsigned id, u16 address, int direction );",
desc = [[Send an address on the I2C with the specified transfer direction (transmitter or receiver).]],
args =
{
"$id$ - I2C interface ID.",
"$address$ - I2C peripheral address.",
"$direction$ - transfer direction, either $PLATFORM_I2C_DIRECTION_TRANSMITTER$ or $PLATFORM_I2C_DIRECTION_RECEIVER$ as defined @#i2c_transfer_direction@here@."
},
ret = "1 for success, 0 for error."
},
{ sig = "int #platform_i2c_send_byte#( unsigned id, u8 data );",
desc = "Send a byte on the I2C interface.",
args =
{
"$id$ - I2C interface ID.",
"$data$ - the byte to send.",
},
ret = "1 for success, 0 for error.",
},
{ sig = "int #platform_i2c_recv_byte#( unsigned id, int ack );",
desc = "Receive a byte from the I2C interface and send a positive (ACK) or negative (NAK) acknowledgement.",
args =
{
"$id$ - I2C interface ID.",
"$ack$ - 1 to send ACK, 0 to send NAK. If $ACK$ is 0 a STOP condition will automatically be generated after the NAK."
},
ret = "1 for success, 0 for error."
}
}
}