Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
Loading...
Searching...
No Matches
sonar_i2c.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 OpenUAS <noreply@openuas.org>
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 */
22
26#ifndef SONAR_I2C_H
27#define SONAR_I2C_H
28
29#include "stdbool.h"
30#include "mcu_periph/i2c.h"
31
37
46
47extern struct SonarI2C sonar_i2c;
48
49extern void sonar_i2c_init(void);
50extern void sonar_i2c_event(void);
51extern void sonar_i2c_periodic(void);
52extern void sonar_i2c_report(void);
53
54#endif /* SONAR_I2C_H */
I2C transaction structure.
Definition i2c.h:94
Architecture independent I2C (Inter-Integrated Circuit Bus) API.
uint16_t raw
raw measuread non scaled range value from sensor
Definition sonar_i2c.h:42
float distance
Distance scaled to [m].
Definition sonar_i2c.h:43
void sonar_i2c_event(void)
Rangefinder event function Basically just check the progress of the transation to prevent overruns du...
Definition sonar_i2c.c:142
enum SonarI2CStatus status
Definition sonar_i2c.h:41
void sonar_i2c_report(void)
Option to send debug informative values over telemetry if you do not want sonar message in telemetry.
Definition sonar_i2c.c:246
bool update_agl
Do or don't update AGL ABI message.
Definition sonar_i2c.h:44
void sonar_i2c_init(void)
Set the default values at initialization.
Definition sonar_i2c.c:114
struct SonarI2C sonar_i2c
Definition sonar_i2c.c:101
SonarI2CStatus
Definition sonar_i2c.h:32
@ SONAR_I2C_PARSE_DATA
Definition sonar_i2c.h:35
@ SONAR_I2C_READ_DATA
Definition sonar_i2c.h:34
@ SONAR_I2C_REQ_DATA
Definition sonar_i2c.h:33
uint8_t addr
Definition sonar_i2c.h:40
struct i2c_transaction trans
Definition sonar_i2c.h:39
void sonar_i2c_periodic(void)
Get the ranger current distance value.
Definition sonar_i2c.c:169
unsigned short uint16_t
Typedef defining 16 bit unsigned short type.
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.