1
0
mirror of https://github.com/elua/elua.git synced 2025-01-08 20:56:17 +08:00
elua/doc/eluadoc/refman_gen_spi.lua
James Snyder bd1465ca50 Merge 0.6 branch to trunk.
Conflicts:
	SConstruct
	doc/en/arch_platform.html
	doc/en/comunity.html
	doc/en/overview.html
	doc/en/refman.html
	doc/en/refman_gen.html
	doc/en/status.html
	doc/en/tut_bootstick.html
	doc/images/lng_pt.png
	doc/images/minusnode.png
	doc/images/next.png
	doc/images/node.png
	doc/images/nodelast.png
	doc/images/plusnode.png
	doc/images/plusnodelast.png
	doc/images/previous.png
	doc/images/showall.png
	doc/images/sync.png
	doc/images/vertline.png
	doc/pt/arch.html
	doc/pt/arch_coding.html
	doc/pt/arch_con_term.html
	doc/pt/arch_newport.html
	doc/pt/arch_overview.html
	doc/pt/arch_platform.html
	doc/pt/arch_tcpip.html
	doc/pt/building.html
	doc/pt/comunity.html
	doc/pt/dl_binaries.html
	doc/pt/dl_old.html
	doc/pt/dl_sources.html
	doc/pt/downloads.html
	doc/pt/examples.html
	doc/pt/faq.html
	doc/pt/installing_i386.html
	doc/pt/installing_lm3s.html
	doc/pt/news.html
	doc/pt/overview.html
	doc/pt/refman_dep.html
	doc/pt/refman_gen.html
	doc/pt/status.html
	doc/pt/tc_386.html
	doc/pt/toolchains.html
	doc/pt/tut_openocd.html
	doc/pt/using.html
	romfs/LM3S.lua
	romfs/led.lua
	romfs/morse.lua
	romfs/pong.lua
	src/lua/linit.c
	src/modules/auxmods.h
	src/platform/lm3s/platform.c
	src/platform/lm3s/platform_conf.h
	src/platform/sim/platform_conf.h
2009-10-13 02:14:27 +00:00

137 lines
4.8 KiB
Lua

-- eLua reference manual - SPI module
data_en =
{
-- Title
title = "eLua reference manual - SPI module",
-- Menu name
menu_name = "spi",
-- Overview
overview = [[This module contains functions for accessing the SPI interfaces of the eLua CPU.</p>
<p><span class="warning">IMPORTANT</span>: right now, only master SPI mode is implemented in eLua.]],
-- Functions
funcs =
{
{ sig = "clock = #spi.setup#( id, type, clock, cpol, cpha, databits )",
desc = "Setup the SPI interface",
args =
{
"$id$ - the ID of the SPI interface.",
"$type$ - SPI interface type, can be either $spi.MASTER$ or $spi.SLAVE$. $NOTE: currently, only master SPI mode is supported$.",
"$clock$ - the clock of the SPI interface.",
"$cpol$ - the clock polarity (0 or 1).",
"$cpha$ - the clock phase (0 or 1).",
"$databits$ - the length of the SPI data word.",
},
ret = "The actual clock set on the SPI interface. Depending on the hardware, this might have a different value than the $clock$ parameter."
},
{ sig = "#spi.sson#( id )",
desc = "Select the SS line (Slave Select) of the SPI interface. This is only applicable for SPI interfaces with a dedicated SS pin.",
args = "$id$ - the ID of the SPI interface.",
},
{ sig = "#spi.ssoff#( id )",
desc = "Deselect the SS line (Slave Select) of the SPI interface. This is only applicable for SPI interfaces with a dedicated SS pin.",
args = "$id$ - the ID of the SPI interface.",
},
{ sig = "#spi.write#( id, data1, [data2], ..., [datan] )",
desc = "Write one or more strings/numbers to the SPI interface.",
args =
{
"$id$ - the ID os the SPI interface.",
"$data1$ - the first string/number to send.",
"$data2 (optional)$ - the second string/number to send.",
"$datan (optional)$ - the %n%-th string/number to send."
},
},
{ sig = "#spi.readwrite#( id, data1, [data2], ..., [datan] )",
desc = "Write one or more strings/numbers to the SPI interface and return the data read from the same interface.",
args =
{
"$id$ - the ID os the SPI interface.",
"$data1$ - the first string/number to send.",
"$data2 (optional)$ - the second string/number to send.",
"$datan (optional)$ - the %n%-th string/number to send."
},
ret = "An array with all the data read from the SPI interface."
}
},
}
data_pt =
{
-- Title
title = "eLua reference manual - SPI module",
-- Menu name
menu_name = "spi",
-- Overview
overview = [[This module contains functions for accessing the SPI interfaces of the eLua CPU.</p>
<p><span class="warning">IMPORTANT</span>: right now, only master SPI mode is implemented in eLua.]],
-- Functions
funcs =
{
{ sig = "clock = #spi.setup#( id, type, clock, cpol, cpha, databits )",
desc = "Setup the SPI interface",
args =
{
"$id$ - the ID of the SPI interface.",
"$type$ - SPI interface type, can be either $spi.MASTER$ or $spi.SLAVE$. $NOTE: currently, only master SPI mode is supported$.",
"$clock$ - the clock of the SPI interface.",
"$cpol$ - the clock polarity (0 or 1).",
"$cpha$ - the clock phase (0 or 1).",
"$databits$ - the length of the SPI data word.",
},
ret = "The actual clock set on the SPI interface. Depending on the hardware, this might have a different value than the $clock$ parameter."
},
{ sig = "#spi.sson#( id )",
desc = "Select the SS line (Slave Select) of the SPI interface. This is only applicable for SPI interfaces with a dedicated SS pin.",
args = "$id$ - the ID of the SPI interface.",
},
{ sig = "#spi.ssoff#( id )",
desc = "Deselect the SS line (Slave Select) of the SPI interface. This is only applicable for SPI interfaces with a dedicated SS pin.",
args = "$id$ - the ID of the SPI interface.",
},
{ sig = "#spi.write#( id, data1, [data2], ..., [datan] )",
desc = "Write one or more strings/numbers to the SPI interface.",
args =
{
"$id$ - the ID os the SPI interface.",
"$data1$ - the first string/number to send.",
"$data2 (optional)$ - the second string/number to send.",
"$datan (optional)$ - the %n%-th string/number to send."
},
},
{ sig = "#spi.readwrite#( id, data1, [data2], ..., [datan] )",
desc = "Write one or more strings/numbers to the SPI interface and return the data read from the same interface.",
args =
{
"$id$ - the ID os the SPI interface.",
"$data1$ - the first string/number to send.",
"$data2 (optional)$ - the second string/number to send.",
"$datan (optional)$ - the %n%-th string/number to send."
},
ret = "An array with all the data read from the SPI interface."
}
},
}