i2c  1.4.2
RoadNarrows Robotics I2C Package
i2ccore_wrap.c File Reference

Swig generated core wrapper c file. More...

#include <Python.h>
#include <string.h>
#include "rnr/rnrconfig.h"
#include <float.h>
#include <math.h>
#include <limits.h>
#include <errno.h>
#include "rnr/i2c.h"
#include "i2ccore.h"

Go to the source code of this file.

Classes

struct  swig_type_info
 
struct  swig_cast_info
 
struct  swig_module_info
 
struct  PyHeapTypeObject
 
struct  swig_const_info
 
struct  SwigPyClientData
 
struct  SwigPyObject
 
struct  SwigPyPacked
 
struct  swig_globalvar
 
struct  swig_varlinkobject
 

Macros

#define SWIGPYTHON
 
#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
 
#define SWIGTEMPLATEDISAMBIGUATOR
 
#define SWIGINLINE
 
#define SWIGUNUSED
 
#define SWIGUNUSEDPARM(p)   p SWIGUNUSED
 
#define SWIGINTERN   static SWIGUNUSED
 
#define SWIGINTERNINLINE   SWIGINTERN SWIGINLINE
 
#define SWIGEXPORT
 
#define SWIGSTDCALL
 
#define SWIG_RUNTIME_VERSION   "4"
 
#define SWIG_TYPE_TABLE_NAME
 
#define SWIGRUNTIME   SWIGINTERN
 
#define SWIGRUNTIMEINLINE   SWIGRUNTIME SWIGINLINE
 
#define SWIG_BUFFER_SIZE   1024
 
#define SWIG_POINTER_DISOWN   0x1
 
#define SWIG_CAST_NEW_MEMORY   0x2
 
#define SWIG_POINTER_OWN   0x1
 
#define SWIG_OK   (0)
 
#define SWIG_ERROR   (-1)
 
#define SWIG_IsOK(r)   (r >= 0)
 
#define SWIG_ArgError(r)   ((r != SWIG_ERROR) ? r : SWIG_TypeError)
 
#define SWIG_CASTRANKLIMIT   (1 << 8)
 
#define SWIG_NEWOBJMASK   (SWIG_CASTRANKLIMIT << 1)
 
#define SWIG_TMPOBJMASK   (SWIG_NEWOBJMASK << 1)
 
#define SWIG_BADOBJ   (SWIG_ERROR)
 
#define SWIG_OLDOBJ   (SWIG_OK)
 
#define SWIG_NEWOBJ   (SWIG_OK | SWIG_NEWOBJMASK)
 
#define SWIG_TMPOBJ   (SWIG_OK | SWIG_TMPOBJMASK)
 
#define SWIG_AddNewMask(r)   (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
 
#define SWIG_DelNewMask(r)   (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
 
#define SWIG_IsNewObj(r)   (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
 
#define SWIG_AddTmpMask(r)   (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
 
#define SWIG_DelTmpMask(r)   (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
 
#define SWIG_IsTmpObj(r)   (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
 
#define SWIG_AddCast(r)   (r)
 
#define SWIG_CheckState(r)   (SWIG_IsOK(r) ? 1 : 0)
 
#define SWIG_UnknownError   -1
 
#define SWIG_IOError   -2
 
#define SWIG_RuntimeError   -3
 
#define SWIG_IndexError   -4
 
#define SWIG_TypeError   -5
 
#define SWIG_DivisionByZero   -6
 
#define SWIG_OverflowError   -7
 
#define SWIG_SyntaxError   -8
 
#define SWIG_ValueError   -9
 
#define SWIG_SystemError   -10
 
#define SWIG_AttributeError   -11
 
#define SWIG_MemoryError   -12
 
#define SWIG_NullReferenceError   -13
 
#define Py_TYPE(op)   ((op)->ob_type)
 
#define SWIG_Python_str_FromFormat   PyString_FromFormat
 
#define SWIG_Python_str_DelForPy3(x)
 
#define PyOS_snprintf   snprintf
 
#define SWIG_PYBUFFER_SIZE   1024
 
#define PyObject_Del(op)   PyMem_DEL((op))
 
#define PyObject_DEL   PyObject_Del
 
#define PyExc_StopIteration   PyExc_RuntimeError
 
#define PyObject_GenericGetAttr   0
 
#define Py_NotImplemented   PyExc_RuntimeError
 
#define PyString_AsStringAndSize(obj, s, len)   {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
 
#define PySequence_Size   PySequence_Length
 
#define PY_SSIZE_T_MAX   INT_MAX
 
#define PY_SSIZE_T_MIN   INT_MIN
 
#define PyInt_FromSize_t(x)   PyInt_FromLong((long)x)
 
#define Py_VISIT(op)
 
#define PyDescr_TYPE(x)   (((PyDescrObject *)(x))->d_type)
 
#define PyDescr_NAME(x)   (((PyDescrObject *)(x))->d_name)
 
#define SWIG_PYTHON_INITIALIZE_THREADS
 
#define SWIG_PYTHON_THREAD_BEGIN_BLOCK
 
#define SWIG_PYTHON_THREAD_END_BLOCK
 
#define SWIG_PYTHON_THREAD_BEGIN_ALLOW
 
#define SWIG_PYTHON_THREAD_END_ALLOW
 
#define SWIG_PY_POINTER   4
 
#define SWIG_PY_BINARY   5
 
#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)   SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
 
#define SWIG_ConvertPtr(obj, pptr, type, flags)   SWIG_Python_ConvertPtr(obj, pptr, type, flags)
 
#define SWIG_ConvertPtrAndOwn(obj, pptr, type, flags, own)   SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
 
#define SWIG_NewPointerObj(ptr, type, flags)   SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
 
#define SWIG_InternalNewPointerObj(ptr, type, flags)   SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
 
#define SWIG_CheckImplicit(ty)   SWIG_Python_CheckImplicit(ty)
 
#define SWIG_AcquirePtr(ptr, src)   SWIG_Python_AcquirePtr(ptr, src)
 
#define swig_owntype   int
 
#define SWIG_ConvertPacked(obj, ptr, sz, ty)   SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
 
#define SWIG_NewPackedObj(ptr, sz, type)   SWIG_Python_NewPackedObj(ptr, sz, type)
 
#define SWIG_ConvertInstance(obj, pptr, type, flags)   SWIG_ConvertPtr(obj, pptr, type, flags)
 
#define SWIG_NewInstanceObj(ptr, type, flags)   SWIG_NewPointerObj(ptr, type, flags)
 
#define SWIG_ConvertFunctionPtr(obj, pptr, type)   SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
 
#define SWIG_NewFunctionPtrObj(ptr, type)   SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
 
#define SWIG_ConvertMember(obj, ptr, sz, ty)   SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
 
#define SWIG_NewMemberObj(ptr, sz, type)   SWIG_Python_NewPackedObj(ptr, sz, type)
 
#define SWIG_GetModule(clientdata)   SWIG_Python_GetModule(clientdata)
 
#define SWIG_SetModule(clientdata, pointer)   SWIG_Python_SetModule(pointer)
 
#define SWIG_NewClientData(obj)   SwigPyClientData_New(obj)
 
#define SWIG_SetErrorObj   SWIG_Python_SetErrorObj
 
#define SWIG_SetErrorMsg   SWIG_Python_SetErrorMsg
 
#define SWIG_ErrorType(code)   SWIG_Python_ErrorType(code)
 
#define SWIG_Error(code, msg)   SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
 
#define SWIG_fail   goto fail
 
#define SWIG_Python_Raise(obj, type, desc)   SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
 
#define SWIG_Python_CallFunctor(functor, obj)   PyObject_CallFunction(functor, "O", obj);
 
#define SWIG_STATIC_POINTER(var)   var = 0; if (!var) var
 
#define SWIG_POINTER_NOSHADOW   (SWIG_POINTER_OWN << 1)
 
#define SWIG_POINTER_NEW   (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
 
#define SWIG_POINTER_IMPLICIT_CONV   (SWIG_POINTER_DISOWN << 1)
 
#define SWIG_BUILTIN_TP_INIT   (SWIG_POINTER_OWN << 2)
 
#define SWIG_BUILTIN_INIT   (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
 
#define SWIG_POINTER_EXCEPTION   0
 
#define SWIG_arg_fail(arg)   SWIG_Python_ArgFail(arg)
 
#define SWIG_MustGetPtr(p, type, argnum, flags)   SWIG_Python_MustGetPtr(p, type, argnum, flags)
 
#define SWIG_exception_fail(code, msg)   do { SWIG_Error(code, msg); SWIG_fail; } while(0)
 
#define SWIG_contract_assert(expr, msg)   if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
 
#define SWIGTYPE_p_char   swig_types[0]
 
#define SWIGTYPE_p_int   swig_types[1]
 
#define SWIGTYPE_p_unsigned_char   swig_types[2]
 
#define SWIGTYPE_p_unsigned_int   swig_types[3]
 
#define SWIGTYPE_p_unsigned_long   swig_types[4]
 
#define SWIGTYPE_p_unsigned_short   swig_types[5]
 
#define SWIG_TypeQuery(name)   SWIG_TypeQueryModule(&swig_module, &swig_module, name)
 
#define SWIG_MangledTypeQuery(name)   SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
 
#define SWIG_init   init_i2ccore
 
#define SWIG_name   "_i2ccore"
 
#define SWIGVERSION   0x030008
 
#define SWIG_VERSION   SWIGVERSION
 
#define SWIG_as_voidptr(a)   (void *)((const void *)(a))
 
#define SWIG_as_voidptrptr(a)   ((void)SWIG_as_voidptr(*a),(void**)(a))
 
#define SWIG_From_long   PyLong_FromLong
 
#define SWIG_newvarlink()   SWIG_Python_newvarlink()
 
#define SWIG_addvarlink(p, name, get_attr, set_attr)   SWIG_Python_addvarlink(p, name, get_attr, set_attr)
 
#define SWIG_InstallConstants(d, constants)   SWIG_Python_InstallConstants(d, constants)
 

Typedefs

typedef void *(* swig_converter_func) (void *, int *)
 
typedef struct swig_type_info *(* swig_dycast_func) (void **)
 
typedef struct swig_type_info swig_type_info
 
typedef struct swig_cast_info swig_cast_info
 
typedef struct swig_module_info swig_module_info
 
typedef int Py_ssize_t
 
typedef inquiry lenfunc
 
typedef intargfunc ssizeargfunc
 
typedef intintargfunc ssizessizeargfunc
 
typedef intobjargproc ssizeobjargproc
 
typedef intintobjargproc ssizessizeobjargproc
 
typedef getreadbufferproc readbufferproc
 
typedef getwritebufferproc writebufferproc
 
typedef getsegcountproc segcountproc
 
typedef getcharbufferproc charbufferproc
 
typedef destructor freefunc
 
typedef struct swig_const_info swig_const_info
 
typedef struct swig_globalvar swig_globalvar
 
typedef struct swig_varlinkobject swig_varlinkobject
 

Functions

static int SWIG_TypeNameComp (const char *f1, const char *l1, const char *f2, const char *l2)
 
static int SWIG_TypeCmp (const char *nb, const char *tb)
 
static int SWIG_TypeEquiv (const char *nb, const char *tb)
 
static swig_cast_infoSWIG_TypeCheck (const char *c, swig_type_info *ty)
 
static swig_cast_infoSWIG_TypeCheckStruct (swig_type_info *from, swig_type_info *ty)
 
static void * SWIG_TypeCast (swig_cast_info *ty, void *ptr, int *newmemory)
 
static swig_type_infoSWIG_TypeDynamicCast (swig_type_info *ty, void **ptr)
 
static const char * SWIG_TypeName (const swig_type_info *ty)
 
static const char * SWIG_TypePrettyName (const swig_type_info *type)
 
static void SWIG_TypeClientData (swig_type_info *ti, void *clientdata)
 
static void SWIG_TypeNewClientData (swig_type_info *ti, void *clientdata)
 
static swig_type_infoSWIG_MangledTypeQueryModule (swig_module_info *start, swig_module_info *end, const char *name)
 
static swig_type_infoSWIG_TypeQueryModule (swig_module_info *start, swig_module_info *end, const char *name)
 
static char * SWIG_PackData (char *c, void *ptr, size_t sz)
 
static const char * SWIG_UnpackData (const char *c, void *ptr, size_t sz)
 
static char * SWIG_PackVoidPtr (char *buff, void *ptr, const char *name, size_t bsz)
 
static const char * SWIG_UnpackVoidPtr (const char *c, void **ptr, const char *name)
 
static char * SWIG_PackDataName (char *buff, void *ptr, size_t sz, const char *name, size_t bsz)
 
static const char * SWIG_UnpackDataName (const char *c, void *ptr, size_t sz, const char *name)
 
static char * SWIG_Python_str_AsChar (PyObject *str)
 
static PyObject * SWIG_Python_str_FromChar (const char *c)
 
static PyObject * PyString_FromFormat (const char *fmt,...)
 
static PyObject * PyBool_FromLong (long ok)
 
static long PyNumber_AsSsize_t (PyObject *x, void *exc)
 
static PyObject * SWIG_Python_ErrorType (int code)
 
static void SWIG_Python_AddErrorMsg (const char *mesg)
 
static PyObject * SWIG_PyInstanceMethod_New (PyObject *self, PyObject *func)
 
static void SWIG_Python_SetErrorObj (PyObject *errtype, PyObject *obj)
 
static void SWIG_Python_SetErrorMsg (PyObject *errtype, const char *msg)
 
static void SWIG_Python_SetConstant (PyObject *d, const char *name, PyObject *obj)
 
static PyObject * SWIG_Python_AppendOutput (PyObject *result, PyObject *obj)
 
static Py_ssize_t SWIG_Python_UnpackTuple (PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
 
static PyObject * SWIG_Py_Void (void)
 
static int SWIG_Python_CheckImplicit (swig_type_info *ty)
 
static PyObject * SWIG_Python_ExceptionType (swig_type_info *desc)
 
static SwigPyClientDataSwigPyClientData_New (PyObject *obj)
 
static void SwigPyClientData_Del (SwigPyClientData *data)
 
static PyObject * SwigPyObject_long (SwigPyObject *v)
 
static PyObject * SwigPyObject_format (const char *fmt, SwigPyObject *v)
 
static PyObject * SwigPyObject_oct (SwigPyObject *v)
 
static PyObject * SwigPyObject_hex (SwigPyObject *v)
 
static PyObject * SwigPyObject_repr (SwigPyObject *v, PyObject *args)
 
static int SwigPyObject_compare (SwigPyObject *v, SwigPyObject *w)
 
static PyObject * SwigPyObject_richcompare (SwigPyObject *v, SwigPyObject *w, int op)
 
static PyTypeObject * SwigPyObject_TypeOnce (void)
 
static PyTypeObject * SwigPyObject_type (void)
 
static int SwigPyObject_Check (PyObject *op)
 
static PyObject * SwigPyObject_New (void *ptr, swig_type_info *ty, int own)
 
static void SwigPyObject_dealloc (PyObject *v)
 
static PyObject * SwigPyObject_append (PyObject *v, PyObject *next)
 
static PyObject * SwigPyObject_next (PyObject *v, PyObject *args)
 
static PyObject * SwigPyObject_disown (PyObject *v, PyObject *args)
 
static PyObject * SwigPyObject_acquire (PyObject *v, PyObject *args)
 
static PyObject * SwigPyObject_own (PyObject *v, PyObject *args)
 
static PyObject * SwigPyObject_getattr (SwigPyObject *sobj, char *name)
 
static int SwigPyPacked_print (SwigPyPacked *v, FILE *fp, int flags)
 
static PyObject * SwigPyPacked_repr (SwigPyPacked *v)
 
static PyObject * SwigPyPacked_str (SwigPyPacked *v)
 
static int SwigPyPacked_compare (SwigPyPacked *v, SwigPyPacked *w)
 
static PyTypeObject * SwigPyPacked_TypeOnce (void)
 
static PyTypeObject * SwigPyPacked_type (void)
 
static int SwigPyPacked_Check (PyObject *op)
 
static void SwigPyPacked_dealloc (PyObject *v)
 
static PyObject * SwigPyPacked_New (void *ptr, size_t size, swig_type_info *ty)
 
static swig_type_infoSwigPyPacked_UnpackData (PyObject *obj, void *ptr, size_t size)
 
static PyObject * _SWIG_This (void)
 
static PyObject * SWIG_This (void)
 
static SwigPyObjectSWIG_Python_GetSwigThis (PyObject *pyobj)
 
static int SWIG_Python_AcquirePtr (PyObject *obj, int own)
 
static int SWIG_Python_ConvertPtrAndOwn (PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own)
 
static int SWIG_Python_ConvertFunctionPtr (PyObject *obj, void **ptr, swig_type_info *ty)
 
static int SWIG_Python_ConvertPacked (PyObject *obj, void *ptr, size_t sz, swig_type_info *ty)
 
static PyObject * SWIG_Python_NewShadowInstance (SwigPyClientData *data, PyObject *swig_this)
 
static void SWIG_Python_SetSwigThis (PyObject *inst, PyObject *swig_this)
 
static PyObject * SWIG_Python_InitShadowInstance (PyObject *args)
 
static PyObject * SWIG_Python_NewPointerObj (PyObject *self, void *ptr, swig_type_info *type, int flags)
 
static PyObject * SWIG_Python_NewPackedObj (void *ptr, size_t sz, swig_type_info *type)
 
static swig_module_infoSWIG_Python_GetModule (void *clientdata)
 
static int PyModule_AddObject (PyObject *m, char *name, PyObject *o)
 
static void SWIG_Python_DestroyModule (void *vptr)
 
static void SWIG_Python_SetModule (swig_module_info *swig_module)
 
static PyObject * SWIG_Python_TypeCache (void)
 
static swig_type_infoSWIG_Python_TypeQuery (const char *type)
 
static int SWIG_Python_AddErrMesg (const char *mesg, int infront)
 
static int SWIG_Python_ArgFail (int argnum)
 
static const char * SwigPyObject_GetDesc (PyObject *self)
 
static void SWIG_Python_TypeError (const char *type, PyObject *obj)
 
static void * SWIG_Python_MustGetPtr (PyObject *obj, swig_type_info *ty, int argnum, int flags)
 
static byte_t * new_byteArray (size_t nelements)
 
static void delete_byteArray (byte_t *ary)
 
static byte_t byteArray_getitem (byte_t *ary, size_t index)
 
static void byteArray_setitem (byte_t *ary, size_t index, byte_t value)
 
static int SWIG_AsVal_double (PyObject *obj, double *val)
 
static int SWIG_CanCastAsInteger (double *d, double min, double max)
 
static int SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
 
static int SWIG_AsVal_size_t (PyObject *obj, size_t *val)
 
static PyObject * SWIG_From_unsigned_SS_long (unsigned long value)
 
static PyObject * SWIG_From_unsigned_SS_char (unsigned char value)
 
static int SWIG_AsVal_unsigned_SS_char (PyObject *obj, unsigned char *val)
 
static uint_t * new_uintp ()
 
static uint_t * copy_uintp (uint_t value)
 
static void delete_uintp (uint_t *obj)
 
static void uintp_assign (uint_t *obj, uint_t value)
 
static uint_t uintp_value (uint_t *obj)
 
static int SWIG_AsVal_unsigned_SS_int (PyObject *obj, unsigned int *val)
 
static PyObject * SWIG_From_unsigned_SS_int (unsigned int value)
 
int i2ccore_open (const char *device)
 Open a I2C bus device. More...
 
int i2ccore_close (int fd)
 Close an open I2C bus device. More...
 
int i2ccore_read (int fd, unsigned short cur_addr, unsigned short addr, byte_t buf[], unsigned int count)
 Read data from an attached device connected to the open I2C bus. More...
 
int i2ccore_write (int fd, unsigned short cur_addr, unsigned short addr, byte_t buf[], unsigned int count)
 Write data to an attached device connected to the open I2C bus. More...
 
int i2ccore_transfer (int fd, unsigned short cur_addr, unsigned short addr, byte_t wbuf[], unsigned int wcount, byte_t rbuf[], unsigned int rcount)
 Transfer data to an attached device connected to the open I2C bus reead back. More...
 
int i2ccore_check (int fd, unsigned short cur_addr, unsigned short addr)
 Test for the existence of a device with the given address. More...
 
static swig_type_infoSWIG_pchar_descriptor (void)
 
static int SWIG_AsCharPtrAndSize (PyObject *obj, char **cptr, size_t *psize, int *alloc)
 
static PyObject * SWIG_From_int (int value)
 
static int SWIG_AsVal_long (PyObject *obj, long *val)
 
static int SWIG_AsVal_int (PyObject *obj, int *val)
 
static int SWIG_AsVal_unsigned_SS_short (PyObject *obj, unsigned short *val)
 
static PyObject * _wrap_new_byteArray (PyObject *self, PyObject *args)
 
static PyObject * _wrap_delete_byteArray (PyObject *self, PyObject *args)
 
static PyObject * _wrap_byteArray_getitem (PyObject *self, PyObject *args)
 
static PyObject * _wrap_byteArray_setitem (PyObject *self, PyObject *args)
 
static PyObject * _wrap_new_uintp (PyObject *self, PyObject *args)
 
static PyObject * _wrap_copy_uintp (PyObject *self, PyObject *args)
 
static PyObject * _wrap_delete_uintp (PyObject *self, PyObject *args)
 
static PyObject * _wrap_uintp_assign (PyObject *self, PyObject *args)
 
static PyObject * _wrap_uintp_value (PyObject *self, PyObject *args)
 
static PyObject * _wrap_i2ccore_open (PyObject *self, PyObject *args)
 
static PyObject * _wrap_i2ccore_close (PyObject *self, PyObject *args)
 
static PyObject * _wrap_i2ccore_read (PyObject *self, PyObject *args)
 
static PyObject * _wrap_i2ccore_write (PyObject *self, PyObject *args)
 
static PyObject * _wrap_i2ccore_transfer (PyObject *self, PyObject *args)
 
static PyObject * _wrap_i2ccore_check (PyObject *self, PyObject *args)
 
static void SWIG_InitializeModule (void *clientdata)
 
static void SWIG_PropagateClientData (void)
 
static PyObject * swig_varlink_repr (swig_varlinkobject *v)
 
static PyObject * swig_varlink_str (swig_varlinkobject *v)
 
static int swig_varlink_print (swig_varlinkobject *v, FILE *fp, int flags)
 
static void swig_varlink_dealloc (swig_varlinkobject *v)
 
static PyObject * swig_varlink_getattr (swig_varlinkobject *v, char *n)
 
static int swig_varlink_setattr (swig_varlinkobject *v, char *n, PyObject *p)
 
static PyTypeObject * swig_varlink_type (void)
 
static PyObject * SWIG_Python_newvarlink (void)
 
static void SWIG_Python_addvarlink (PyObject *p, char *name, PyObject *(*get_attr)(void), int(*set_attr)(PyObject *p))
 
static PyObject * SWIG_globals (void)
 
static void SWIG_Python_InstallConstants (PyObject *d, swig_const_info constants[])
 
static void SWIG_Python_FixMethods (PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial)
 
void init_i2ccore (void)
 

Variables

static PyMethodDef swigobject_methods []
 
static PyObject * swig_this = NULL
 
static swig_type_infoswig_types [7]
 
static swig_module_info swig_module = {swig_types, 6, 0, 0, 0, 0}
 
static PyMethodDef SwigMethods []
 
static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}
 
static swig_type_info _swigt__p_int = {"_p_int", "bool_t *|int *", 0, 0, (void*)0, 0}
 
static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *|byte_t *", 0, 0, (void*)0, 0}
 
static swig_type_info _swigt__p_unsigned_int = {"_p_unsigned_int", "unsigned int *|uint_t *", 0, 0, (void*)0, 0}
 
static swig_type_info _swigt__p_unsigned_long = {"_p_unsigned_long", "unsigned long *|ulong_t *", 0, 0, (void*)0, 0}
 
static swig_type_info _swigt__p_unsigned_short = {"_p_unsigned_short", "unsigned short *|ushort_t *", 0, 0, (void*)0, 0}
 
static swig_type_infoswig_type_initial []
 
static swig_cast_info _swigc__p_char [] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}
 
static swig_cast_info _swigc__p_int [] = { {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}}
 
static swig_cast_info _swigc__p_unsigned_char [] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}
 
static swig_cast_info _swigc__p_unsigned_int [] = { {&_swigt__p_unsigned_int, 0, 0, 0},{0, 0, 0, 0}}
 
static swig_cast_info _swigc__p_unsigned_long [] = { {&_swigt__p_unsigned_long, 0, 0, 0},{0, 0, 0, 0}}
 
static swig_cast_info _swigc__p_unsigned_short [] = { {&_swigt__p_unsigned_short, 0, 0, 0},{0, 0, 0, 0}}
 
static swig_cast_infoswig_cast_initial []
 
static swig_const_info swig_const_table []
 

Detailed Description

Swig generated core wrapper c file.

Definition in file i2ccore_wrap.c.

Macro Definition Documentation

#define Py_VISIT (   op)
Value:
do { \
if (op) { \
int vret = visit((op), arg); \
if (vret) \
return vret; \
} \
} while (0)

Definition at line 927 of file i2ccore_wrap.c.

Function Documentation

int i2ccore_check ( int  fd,
unsigned short  cur_addr,
unsigned short  addr 
)

Test for the existence of a device with the given address.

Parameters
fdFile descriptor.
cur_addrI2C address of last I/O operation.
addrI2C device address to read.
Returns
If device is found, returns 1, else returns 0.

Definition at line 3414 of file i2ccore_wrap.c.

References i2c_struct::addr, i2c_struct::fd, i2c_exists(), i2ccore_close(), i2ccore_open(), i2ccore_read(), i2ccore_transfer(), and i2ccore_write().

3415 {
3416  i2c_t i2c;
3417 
3418  i2c.fd = fd;
3419  i2c.addr = cur_addr;
3420 
3421  return i2c_exists(&i2c, addr);
3422 }
i2c_addr_t addr
address of the currently selected attached I2C device
Definition: i2c.h:82
I2C python modules.
int fd
opened file descriptor of the I2C bus device
Definition: i2c.h:81
I2C Bus Handle Type.
Definition: i2c.h:79
int i2c_exists(i2c_t *i2c, i2c_addr_t addr)
Test the existance of a device at the given address on the given I2C Bus.
Definition: i2ccom.c:199
int i2ccore_close ( int  fd)

Close an open I2C bus device.

Returns
On success, returns 0. On failure, returns -errno.

Definition at line 3309 of file i2ccore_wrap.c.

References i2c_struct::fd, and i2c_close().

Referenced by i2ccore_check().

3310 {
3311  i2c_t i2c;
3312 
3313  i2c.fd = fd;
3314 
3315  i2c_close(&i2c);
3316 
3317  return OK;
3318 }
I2C python modules.
int fd
opened file descriptor of the I2C bus device
Definition: i2c.h:81
void i2c_close(i2c_t *i2c)
Closes an I2C Bus.
Definition: i2ccom.c:137
I2C Bus Handle Type.
Definition: i2c.h:79
int i2ccore_open ( const char *  device)

Open a I2C bus device.

Parameters
deviceDevice name.
Returns
On success, returns open file descriptor. On failure, returns -errno.

Definition at line 3292 of file i2ccore_wrap.c.

References i2c_struct::fd, and i2c_open().

Referenced by i2ccore_check().

3293 {
3294  i2c_t i2c;
3295  int rc;
3296 
3297  rc = i2c_open(&i2c, device);
3298 
3299  return rc < 0? -errno: i2c.fd;
3300 }
I2C python modules.
int fd
opened file descriptor of the I2C bus device
Definition: i2c.h:81
I2C Bus Handle Type.
Definition: i2c.h:79
int i2c_open(i2c_t *i2c, const char *device)
Open the host I2C Bus device.
Definition: i2ccom.c:118
int i2ccore_read ( int  fd,
unsigned short  cur_addr,
unsigned short  addr,
byte_t  buf[],
unsigned int  count 
)

Read data from an attached device connected to the open I2C bus.

Parameters
fdFile descriptor.
cur_addrI2C address of last I/O operation.
addrI2C device address to read.
[out]bufOutput buffer.
countNumber of byte to read.
Returns
On success, returns number of bytes read. On failure, returns -errno.

Definition at line 3333 of file i2ccore_wrap.c.

References i2c_struct::addr, i2c_struct::fd, and i2c_read().

Referenced by i2ccore_check().

3335 {
3336  i2c_t i2c;
3337  int n;
3338 
3339  i2c.fd = fd;
3340  i2c.addr = cur_addr;
3341 
3342  n = i2c_read(&i2c, addr, buf, count);
3343 
3344  return n < 0? -errno: n;
3345 }
i2c_addr_t addr
address of the currently selected attached I2C device
Definition: i2c.h:82
I2C python modules.
int fd
opened file descriptor of the I2C bus device
Definition: i2c.h:81
I2C Bus Handle Type.
Definition: i2c.h:79
int i2c_read(i2c_t *i2c, i2c_addr_t addr, byte_t *buf, uint_t len)
Read from an I2C device.
Definition: i2ccom.c:147
int i2ccore_transfer ( int  fd,
unsigned short  cur_addr,
unsigned short  addr,
byte_t  wbuf[],
unsigned int  wcount,
byte_t  rbuf[],
unsigned int  rcount 
)

Transfer data to an attached device connected to the open I2C bus reead back.

Parameters
fdFile descriptor.
cur_addrI2C address of last I/O operation.
addrI2C device address to read.
[in]wbufInput buffer.
wcountNumber of byte to write.
[out]rbufOutput buffer.
rcountNumber of byte to read.
Returns
On success, returns 0. On failure, returns -errno.

Definition at line 3390 of file i2ccore_wrap.c.

References i2c_struct::addr, i2c_struct::fd, and i2c_transfer().

Referenced by i2ccore_check().

3393 {
3394  i2c_t i2c;
3395  int rc;
3396 
3397  i2c.fd = fd;
3398  i2c.addr = cur_addr;
3399 
3400  rc = i2c_transfer(&i2c, addr, wbuf, wcount, rbuf, rcount);
3401 
3402  return rc < 0? -errno: rc;
3403 }
i2c_addr_t addr
address of the currently selected attached I2C device
Definition: i2c.h:82
I2C python modules.
int fd
opened file descriptor of the I2C bus device
Definition: i2c.h:81
I2C Bus Handle Type.
Definition: i2c.h:79
int i2c_transfer(i2c_t *i2c, i2c_addr_t addr, const byte_t *write_buf, uint_t write_len, byte_t *read_buf, uint_t read_len)
Perform a transfer with an I2C device.
Definition: i2ccom.c:171
int i2ccore_write ( int  fd,
unsigned short  cur_addr,
unsigned short  addr,
byte_t  buf[],
unsigned int  count 
)

Write data to an attached device connected to the open I2C bus.

Parameters
fdFile descriptor.
cur_addrI2C address of last I/O operation.
addrI2C device address to read.
[in]bufInput buffer.
countNumber of byte to write.
Returns
On success, returns number of bytes written. On failure, returns -errno.

Definition at line 3360 of file i2ccore_wrap.c.

References i2c_struct::addr, i2c_struct::fd, and i2c_write().

Referenced by i2ccore_check().

3362 {
3363  i2c_t i2c;
3364  int n;
3365 
3366  i2c.fd = fd;
3367  i2c.addr = cur_addr;
3368 
3369  n = i2c_write(&i2c, addr, buf, count);
3370 
3371  return n < 0? -errno: n;
3372 }
i2c_addr_t addr
address of the currently selected attached I2C device
Definition: i2c.h:82
int i2c_write(i2c_t *i2c, i2c_addr_t addr, const byte_t *buf, uint_t len)
Write to an I2C device.
Definition: i2ccom.c:159
I2C python modules.
int fd
opened file descriptor of the I2C bus device
Definition: i2c.h:81
I2C Bus Handle Type.
Definition: i2c.h:79

Variable Documentation

swig_cast_info* swig_cast_initial[]
static
Initial value:
= {
_swigc__p_char,
_swigc__p_int,
_swigc__p_unsigned_char,
_swigc__p_unsigned_int,
_swigc__p_unsigned_long,
_swigc__p_unsigned_short,
}

Definition at line 4171 of file i2ccore_wrap.c.

swig_const_info swig_const_table[]
static
Initial value:
= {
{0, 0, 0, 0.0, 0, 0}}

Definition at line 4183 of file i2ccore_wrap.c.

swig_type_info* swig_type_initial[]
static
Initial value:
= {
&_swigt__p_char,
&_swigt__p_int,
&_swigt__p_unsigned_char,
&_swigt__p_unsigned_int,
&_swigt__p_unsigned_long,
&_swigt__p_unsigned_short,
}

Definition at line 4155 of file i2ccore_wrap.c.

PyMethodDef SwigMethods[]
static
Initial value:
= {
{ (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
{ (char *)"new_byteArray", _wrap_new_byteArray, METH_VARARGS, NULL},
{ (char *)"delete_byteArray", _wrap_delete_byteArray, METH_VARARGS, NULL},
{ (char *)"byteArray_getitem", _wrap_byteArray_getitem, METH_VARARGS, NULL},
{ (char *)"byteArray_setitem", _wrap_byteArray_setitem, METH_VARARGS, NULL},
{ (char *)"new_uintp", _wrap_new_uintp, METH_VARARGS, NULL},
{ (char *)"copy_uintp", _wrap_copy_uintp, METH_VARARGS, NULL},
{ (char *)"delete_uintp", _wrap_delete_uintp, METH_VARARGS, NULL},
{ (char *)"uintp_assign", _wrap_uintp_assign, METH_VARARGS, NULL},
{ (char *)"uintp_value", _wrap_uintp_value, METH_VARARGS, NULL},
{ (char *)"i2ccore_open", _wrap_i2ccore_open, METH_VARARGS, NULL},
{ (char *)"i2ccore_close", _wrap_i2ccore_close, METH_VARARGS, NULL},
{ (char *)"i2ccore_read", _wrap_i2ccore_read, METH_VARARGS, NULL},
{ (char *)"i2ccore_write", _wrap_i2ccore_write, METH_VARARGS, NULL},
{ (char *)"i2ccore_transfer", _wrap_i2ccore_transfer, METH_VARARGS, NULL},
{ (char *)"i2ccore_check", _wrap_i2ccore_check, METH_VARARGS, NULL},
{ NULL, NULL, 0, NULL }
}

Definition at line 4125 of file i2ccore_wrap.c.

PyMethodDef swigobject_methods[]
static
Initial value:
= {
{(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"},
{(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"acquires ownership of the pointer"},
{(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
{(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"},
{(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"},
{(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"},
{0, 0, 0, 0}
}

Definition at line 1835 of file i2ccore_wrap.c.