Paparazzi UAS  v5.12_stable-4-g9b43e9b
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ezcurrent.c File Reference

Copyright (C) 2012 Gerard Toonstra. More...

+ Include dependency graph for ezcurrent.c:

Go to the source code of this file.

Macros

#define EZCURRENT_ADDR   0xEF
 
#define EZCURRENT_I2C_DEV   i2c1
 
#define Uint16FromBuf(_buf, _idx)   ((uint16_t)((_buf[_idx+1]<<8) | _buf[_idx]))
 
#define Int16FromBuf(_buf, _idx)   ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx]))
 

Functions

void ezcurrent_init (void)
 
void ezcurrent_read_periodic (void)
 
void ezcurrent_read_event (void)
 

Variables

struct i2c_transaction ezcurrent_i2c_trans
 

Detailed Description

Copyright (C) 2012 Gerard Toonstra.

This file is part of paparazzi.

paparazzi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

paparazzi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with paparazzi; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Implementation of driver for the EzOSD Current sensor.

Notes: Connect directly to I2C1 port.

Sensor module wire assignments: Red wire: 5V Black wire: Ground DAT: SDA CLK: SCL

This file is part of paparazzi.

paparazzi is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version.

paparazzi is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with paparazzi; see the file COPYING. If not, write to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

Prototypes of driver for the EzOSD Current sensor.

Notes: Connect directly to I2C1 port.

Sensor module wire assignments: Red wire: 5V Black wire: Ground DAT: SDA CLK: SCL

Definition in file ezcurrent.c.

Macro Definition Documentation

#define EZCURRENT_ADDR   0xEF

Definition at line 42 of file ezcurrent.c.

Referenced by ezcurrent_init().

#define EZCURRENT_I2C_DEV   i2c1

Definition at line 45 of file ezcurrent.c.

Referenced by ezcurrent_read_periodic().

#define Int16FromBuf (   _buf,
  _idx 
)    ((int16_t)((_buf[_idx+1]<<8) | _buf[_idx]))

Definition at line 67 of file ezcurrent.c.

Referenced by ezcurrent_read_event().

#define Uint16FromBuf (   _buf,
  _idx 
)    ((uint16_t)((_buf[_idx+1]<<8) | _buf[_idx]))

Definition at line 66 of file ezcurrent.c.

Referenced by ezcurrent_read_event().

Function Documentation

void ezcurrent_read_periodic ( void  )

Definition at line 59 of file ezcurrent.c.

References EZCURRENT_I2C_DEV, ezcurrent_i2c_trans, i2c_receive(), I2CTransDone, i2c_transaction::slave_addr, and i2c_transaction::status.

+ Here is the call graph for this function:

Variable Documentation

struct i2c_transaction ezcurrent_i2c_trans

Definition at line 48 of file ezcurrent.c.

Referenced by ezcurrent_init(), ezcurrent_read_event(), and ezcurrent_read_periodic().