Paparazzi UAS  v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
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

◆ EZCURRENT_ADDR

#define EZCURRENT_ADDR   0xEF

Definition at line 42 of file ezcurrent.c.

◆ EZCURRENT_I2C_DEV

#define EZCURRENT_I2C_DEV   i2c1

Definition at line 45 of file ezcurrent.c.

◆ Int16FromBuf

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

Definition at line 64 of file ezcurrent.c.

◆ Uint16FromBuf

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

Definition at line 63 of file ezcurrent.c.

Function Documentation

◆ ezcurrent_init()

void ezcurrent_init ( void  )

◆ ezcurrent_read_event()

◆ ezcurrent_read_periodic()

void ezcurrent_read_periodic ( void  )

Definition at line 56 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

◆ ezcurrent_i2c_trans

struct i2c_transaction ezcurrent_i2c_trans

Definition at line 1 of file ezcurrent.c.

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