Paparazzi UAS  v5.15_devel-230-gc96ce27
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ist8310.h File Reference
#include "std.h"
#include "mcu_periph/i2c.h"
#include "math/pprz_algebra_int.h"
#include "peripherals/ist8310_regs.h"
+ Include dependency graph for ist8310.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  IST8310
 Default IST8310 structure. More...
 
union  IST8310.data
 

Enumerations

enum  IST8310ConfStatus {
  IST_CONF_UNINIT, IST_CONF_CNTL1, IST_CONF_CNTL3, IST_CONF_CNTL4,
  IST_CONF_DONE
}
 Config status states. More...
 
enum  IST8310Status { IST_STATUS_IDLE, IST_STATUS_READ, IST_STATUS_DONE }
 Normal status states. More...
 

Functions

void ist8310_init (struct IST8310 *ist, struct i2c_periph *i2c_p, uint8_t addr)
 Initialize IST8310 struct. More...
 
void ist8310_configure (struct IST8310 *ist)
 
void ist8310_event (struct IST8310 *ist)
 
void ist8310_read (struct IST8310 *ist)
 
static void ist8310_periodic (struct IST8310 *ist)
 convenience function: read or start configuration if not already initialized More...
 

Data Structure Documentation

struct IST8310

Default IST8310 structure.

Definition at line 55 of file ist8310.h.

+ Collaboration diagram for IST8310:
Data Fields
union IST8310 data
volatile bool data_available data ready flag
struct i2c_periph * i2c_p peripheral used for communcation
struct i2c_transaction i2c_trans i2c transaction used for communication with the ist8310
enum IST8310ConfStatus init_status init status
bool initialized config done flag
enum IST8310Status status main status
union IST8310.data

Definition at line 64 of file ist8310.h.

Data Fields
int16_t value[3] data values accessible by channel index
struct Int16Vect3 vect data vector in mag coordinate system

Enumeration Type Documentation

Config status states.

Enumerator
IST_CONF_UNINIT 
IST_CONF_CNTL1 
IST_CONF_CNTL3 
IST_CONF_CNTL4 
IST_CONF_DONE 

Definition at line 39 of file ist8310.h.

Normal status states.

Enumerator
IST_STATUS_IDLE 
IST_STATUS_READ 
IST_STATUS_DONE 

Definition at line 48 of file ist8310.h.

Function Documentation

void ist8310_init ( struct IST8310 ist,
struct i2c_periph i2c_p,
uint8_t  addr 
)

Initialize IST8310 struct.

Definition at line 34 of file ist8310.c.

References IST8310::data_available, IST8310::i2c_p, IST8310::i2c_trans, I2CTransDone, IST8310::init_status, IST8310::initialized, IST_CONF_UNINIT, i2c_transaction::slave_addr, and i2c_transaction::status.

Referenced by mag_ist8310_module_init().

+ Here is the caller graph for this function:

static void ist8310_periodic ( struct IST8310 ist)
inlinestatic

convenience function: read or start configuration if not already initialized

Definition at line 77 of file ist8310.h.

References IST8310::initialized, ist8310_configure(), and ist8310_read().

Referenced by mag_ist8310_module_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void ist8310_read ( struct IST8310 ist)

Definition at line 98 of file ist8310.c.

References i2c_transaction::buf, IST8310::i2c_p, IST8310::i2c_trans, i2c_transceive(), IST8310_CNTL1_ODR_SINGLE, IST8310_REG_CNTL1, IST_STATUS_IDLE, i2c_transaction::slave_addr, and IST8310::status.

Referenced by ist8310_periodic().

+ Here is the call graph for this function:

+ Here is the caller graph for this function: