Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
ms2100.h File Reference

Driver for the ms2100 magnetic sensor from PNI. More...

#include "std.h"
#include "mcu_periph/spi.h"
#include "math/pprz_algebra_int.h"
#include "peripherals/ms2100_arch.h"
+ Include dependency graph for ms2100.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  Ms2100
 
union  Ms2100.data
 

Enumerations

enum  Ms2100Status {
  MS2100_IDLE , MS2100_SENDING_REQ , MS2100_GOT_EOC , MS2100_READING_RES ,
  MS2100_DATA_AVAILABLE
}
 

Functions

void ms2100_init (struct Ms2100 *ms, struct spi_periph *spi_p, uint8_t slave_idx)
 
void ms2100_read (struct Ms2100 *ms)
 send request to read next axis
 
void ms2100_event (struct Ms2100 *ms)
 
static void ms2100_periodic (struct Ms2100 *ms)
 
void ms2100_arch_init (void)
 

Variables

struct Ms2100 ms2100
 

Detailed Description

Driver for the ms2100 magnetic sensor from PNI.

Definition in file ms2100.h.


Data Structure Documentation

◆ Ms2100

struct Ms2100

Definition at line 44 of file ms2100.h.

+ Collaboration diagram for Ms2100:
Data Fields
volatile uint8_t cur_axe
union Ms2100.data data
volatile uint8_t read_buf[2] SPI buffer for reading a single axis.
struct spi_transaction read_trans
volatile uint8_t req_buf[1] SPI buffer for the command byte.
struct spi_transaction req_trans
struct spi_periph * spi_p
enum Ms2100Status status

◆ Ms2100.data

union Ms2100.data

Definition at line 52 of file ms2100.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

◆ Ms2100Status

Enumerator
MS2100_IDLE 
MS2100_SENDING_REQ 
MS2100_GOT_EOC 
MS2100_READING_RES 
MS2100_DATA_AVAILABLE 

Definition at line 36 of file ms2100.h.

Function Documentation

◆ ms2100_arch_init()

void ms2100_arch_init ( void  )
extern

Definition at line 40 of file ms2100_arch.c.

References foo, GPIO13, GPIO5, gpio_set(), GPIOB, GPIOC, and Ms2100Reset().

Referenced by ms2100_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ms2100_event()

void ms2100_event ( struct Ms2100 ms)
extern

Definition at line 105 of file ms2100.c.

References foo, Int16FromBuf, MS2100_DATA_AVAILABLE, MS2100_GOT_EOC, MS2100_IDLE, MS2100_READING_RES, spi_submit(), SPITransDone, SPITransFailed, and SPITransSuccess.

+ Here is the call graph for this function:

◆ ms2100_init()

void ms2100_init ( struct Ms2100 ms,
struct spi_periph spi_p,
uint8_t  slave_idx 
)
extern

◆ ms2100_periodic()

static void ms2100_periodic ( struct Ms2100 ms)
inlinestatic

Definition at line 65 of file ms2100.h.

References foo, MS2100_IDLE, and ms2100_read().

+ Here is the call graph for this function:

◆ ms2100_read()

void ms2100_read ( struct Ms2100 ms)
extern

send request to read next axis

Definition at line 96 of file ms2100.c.

References foo, MS2100_DIVISOR, MS2100_SENDING_REQ, and spi_submit().

Referenced by ms2100_periodic().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ ms2100

struct Ms2100 ms2100
extern

Definition at line 44 of file ms2100.c.

Referenced by exti9_5_isr().