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
ms5611_spi.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2013 Felix Ruess <felix.ruess@gmail.com>
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
28#ifndef MS5611_SPI_H
29#define MS5611_SPI_H
30
31#include "mcu_periph/spi.h"
32
33/* Include common MS5611 definitions */
34#include "peripherals/ms5611.h"
35
48
49// Functions
50extern void ms5611_spi_init(struct Ms5611_Spi *ms, struct spi_periph *spi_p, uint8_t addr,
51 bool is_ms5607);
52extern void ms5611_spi_start_configure(struct Ms5611_Spi *ms);
53extern void ms5611_spi_start_conversion(struct Ms5611_Spi *ms);
54extern void ms5611_spi_periodic_check(struct Ms5611_Spi *ms);
55extern void ms5611_spi_event(struct Ms5611_Spi *ms);
56
61static inline void ms5611_spi_read(struct Ms5611_Spi *ms)
62{
63 if (ms->initialized) {
65 } else {
67 }
68}
69
71static inline void ms5611_spi_periodic(struct Ms5611_Spi *ms)
72{
75}
76
77
78#endif /* MS5611_SPI_H */
SPI peripheral structure.
Definition spi.h:174
SPI transaction structure.
Definition spi.h:148
uint16_t foo
Definition main_demo5.c:58
MS5611 barometer driver common interface (I2C and SPI).
Ms5611Status
Definition ms5611.h:37
volatile uint8_t tx_buf[1]
Definition ms5611_spi.h:39
struct Ms5611Data data
Definition ms5611_spi.h:45
void ms5611_spi_start_configure(struct Ms5611_Spi *ms)
Definition ms5611_spi.c:65
void ms5611_spi_init(struct Ms5611_Spi *ms, struct spi_periph *spi_p, uint8_t addr, bool is_ms5607)
Definition ms5611_spi.c:33
enum Ms5611Status status
Definition ms5611_spi.h:41
volatile uint8_t rx_buf[4]
Definition ms5611_spi.h:40
void ms5611_spi_event(struct Ms5611_Spi *ms)
Definition ms5611_spi.c:133
void ms5611_spi_start_conversion(struct Ms5611_Spi *ms)
Definition ms5611_spi.c:76
bool initialized
config done flag
Definition ms5611_spi.h:43
static void ms5611_spi_periodic(struct Ms5611_Spi *ms)
convenience function
Definition ms5611_spi.h:71
int32_t prom_cnt
number of bytes read from PROM
Definition ms5611_spi.h:46
void ms5611_spi_periodic_check(struct Ms5611_Spi *ms)
Periodic function to ensure proper delay after triggering reset or conversion.
Definition ms5611_spi.c:92
volatile bool data_available
data ready flag
Definition ms5611_spi.h:44
struct spi_periph * spi_p
Definition ms5611_spi.h:37
struct spi_transaction spi_trans
Definition ms5611_spi.h:38
static void ms5611_spi_read(struct Ms5611_Spi *ms)
convenience function to trigger new measurement.
Definition ms5611_spi.h:61
bool is_ms5607
TRUE if MS5607, FALSE if MS5611.
Definition ms5611_spi.h:42
Architecture independent SPI (Serial Peripheral Interface) API.
int int32_t
Typedef defining 32 bit int type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.