|
From: <ean...@us...> - 2012-09-23 15:41:05
|
Revision: 11089
http://octave.svn.sourceforge.net/octave/?rev=11089&view=rev
Author: eandrius
Date: 2012-09-23 15:40:53 +0000 (Sun, 23 Sep 2012)
Log Message:
-----------
instrument-control: i2c, texinfo help strings
Modified Paths:
--------------
trunk/octave-forge/main/instrument-control/src/i2c/i2c.cc
trunk/octave-forge/main/instrument-control/src/i2c/i2c_addr.cc
trunk/octave-forge/main/instrument-control/src/i2c/i2c_close.cc
trunk/octave-forge/main/instrument-control/src/i2c/i2c_read.cc
trunk/octave-forge/main/instrument-control/src/i2c/i2c_write.cc
Modified: trunk/octave-forge/main/instrument-control/src/i2c/i2c.cc
===================================================================
--- trunk/octave-forge/main/instrument-control/src/i2c/i2c.cc 2012-09-23 08:54:28 UTC (rev 11088)
+++ trunk/octave-forge/main/instrument-control/src/i2c/i2c.cc 2012-09-23 15:40:53 UTC (rev 11089)
@@ -66,7 +66,17 @@
os << this->fd;
}
-DEFUN_DLD (i2c, args, nargout, "")
+DEFUN_DLD (i2c, args, nargout,
+"-*- texinfo -*-\n\
+@deftypefn {Loadable Function} {@var{i2c} = } i2c ([@var{path}], [@var{address}])\n \
+\n\
+Open i2c interface.\n \
+\n\
+@var{path} - the interface path of type String. If omitted defaults to '/dev/i2c-0'. @*\
+@var{address} - the slave device address. If omitted must be set using i2c_addr() call.\n \
+\n\
+The i2c() shall return instance of @var{octave_i2c} class as the result @var{i2c}.\n \
+@end deftypefn")
{
#ifdef __WIN32__
error("i2c: Windows platform support is not yet implemented, go away...");
Modified: trunk/octave-forge/main/instrument-control/src/i2c/i2c_addr.cc
===================================================================
--- trunk/octave-forge/main/instrument-control/src/i2c/i2c_addr.cc 2012-09-23 08:54:28 UTC (rev 11088)
+++ trunk/octave-forge/main/instrument-control/src/i2c/i2c_addr.cc 2012-09-23 15:40:53 UTC (rev 11089)
@@ -26,7 +26,20 @@
#include "i2c.h"
-DEFUN_DLD (i2c_addr, args, nargout, "")
+DEFUN_DLD (i2c_addr, args, nargout,
+"-*- texinfo -*-\n\
+@deftypefn {Loadable Function} {} i2c_addr (@var{i2c}, @var{address})\n \
+@deftypefnx {Loadable Function} {@var{addr} = } i2c_addr (@var{i2c})\n \
+\n\
+Set new or get existing i2c slave device address.\n \
+\n\
+@var{i2c} - instance of @var{octave_i2c} class.@*\
+@var{address} - i2c slave device address of type Integer. \
+The address is passed in the 7 or 10 lower bits of the argument.\n \
+\n\
+If @var{address} parameter is omitted, the i2c_addr() shall return \
+current i2c slave device address as the result @var{addr}.\n \
+@end deftypefn")
{
if (args.length() > 2 ||
args(0).type_id() != octave_i2c::static_type_id())
Modified: trunk/octave-forge/main/instrument-control/src/i2c/i2c_close.cc
===================================================================
--- trunk/octave-forge/main/instrument-control/src/i2c/i2c_close.cc 2012-09-23 08:54:28 UTC (rev 11088)
+++ trunk/octave-forge/main/instrument-control/src/i2c/i2c_close.cc 2012-09-23 15:40:53 UTC (rev 11089)
@@ -25,7 +25,14 @@
#include "i2c.h"
-DEFUN_DLD (i2c_close, args, nargout, "")
+DEFUN_DLD (i2c_close, args, nargout,
+"-*- texinfo -*-\n\
+@deftypefn {Loadable Function} {} i2c_close (@var{i2c})\n \
+\n\
+Close the interface and release a file descriptor.\n \
+\n\
+@var{i2c} - instance of @var{octave_i2c} class.@*\
+@end deftypefn")
{
if (args.length() != 1 || args(0).type_id() != octave_i2c::static_type_id())
{
Modified: trunk/octave-forge/main/instrument-control/src/i2c/i2c_read.cc
===================================================================
--- trunk/octave-forge/main/instrument-control/src/i2c/i2c_read.cc 2012-09-23 08:54:28 UTC (rev 11088)
+++ trunk/octave-forge/main/instrument-control/src/i2c/i2c_read.cc 2012-09-23 15:40:53 UTC (rev 11089)
@@ -26,7 +26,17 @@
#include "i2c.h"
-DEFUN_DLD (i2c_read, args, nargout, "")
+DEFUN_DLD (i2c_read, args, nargout,
+"-*- texinfo -*-\n\
+@deftypefn {Loadable Function} {[@var{data}, @var{count}] = } i2c_read (@var{i2c}, @var{n})\n \
+\n\
+Read from i2c slave device.\n \
+\n\
+@var{i2c} - instance of @var{octave_i2c} class.@*\
+@var{n} - number of bytes to attempt to read of type Integer.\n \
+\n\
+The i2c_read() shall return number of bytes successfully read in @var{count} as Integer and the bytes themselves in @var{data} as uint8 array.\n \
+@end deftypefn")
{
if (args.length() < 1 || args.length() > 2 || args(0).type_id() != octave_i2c::static_type_id())
{
Modified: trunk/octave-forge/main/instrument-control/src/i2c/i2c_write.cc
===================================================================
--- trunk/octave-forge/main/instrument-control/src/i2c/i2c_write.cc 2012-09-23 08:54:28 UTC (rev 11088)
+++ trunk/octave-forge/main/instrument-control/src/i2c/i2c_write.cc 2012-09-23 15:40:53 UTC (rev 11089)
@@ -28,7 +28,17 @@
using std::string;
-DEFUN_DLD (i2c_write, args, nargout, "")
+DEFUN_DLD (i2c_write, args, nargout,
+"-*- texinfo -*-\n\
+@deftypefn {Loadable Function} {@var{n} = } i2c_write (@var{i2c}, @var{data})\n \
+\n\
+Write data to a i2c slave device.\n \
+\n\
+@var{i2c} - instance of @var{octave_i2c} class.@*\
+@var{data} - data to be written to the slave device. Can be either of String or uint8 type.\n \
+\n\
+Upon successful completion, i2c_write() shall return the number of bytes written as the result @var{n}.\n \
+@end deftypefn")
{
if (args.length() != 2 || args(0).type_id() != octave_i2c::static_type_id())
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|