Macros | Enumerations | Functions | Variables
drv_mb1242.c File Reference
#include <breezystm32.h>
#include <stdbool.h>
#include <stdint.h>
#include "drv_i2c.h"
Include dependency graph for drv_mb1242.c:

Go to the source code of this file.

Macros

#define MB1242_DEFAULT_ADDRESS   0x70
 

Enumerations

enum  callack_type_t { START_MEAS_CB, READ_DATA_CB }
 
enum  sonar_state_t { START_MEAS, READ_DATA }
 

Functions

static void cb (uint8_t result)
 
static void convert ()
 
float mb1242_async_read ()
 
void mb1242_async_update ()
 
bool mb1242_init ()
 
bool mb1242_present ()
 

Variables

static uint8_t buf_ [2]
 
static callack_type_t callback_type_
 
static uint8_t cmd_
 
static float distance_
 
static uint32_t distance_cm_
 
static uint32_t last_update_time_ms_
 
static bool new_data_ = false
 
static uint32_t next_update_time_ms_
 
static bool sensor_present_
 
static const uint8_t START_MEASUREMENT_CMD = 0x51
 
static sonar_state_t state_
 

Macro Definition Documentation

#define MB1242_DEFAULT_ADDRESS   0x70

Definition at line 29 of file drv_mb1242.c.

Enumeration Type Documentation

Enumerator
START_MEAS_CB 
READ_DATA_CB 

Definition at line 47 of file drv_mb1242.c.

Enumerator
START_MEAS 
READ_DATA 

Definition at line 41 of file drv_mb1242.c.

Function Documentation

static void cb ( uint8_t  result)
static

Definition at line 105 of file drv_mb1242.c.

void convert ( )
static

Definition at line 125 of file drv_mb1242.c.

float mb1242_async_read ( )

Definition at line 99 of file drv_mb1242.c.

void mb1242_async_update ( )

Definition at line 76 of file drv_mb1242.c.

bool mb1242_init ( )

Definition at line 57 of file drv_mb1242.c.

bool mb1242_present ( )

Definition at line 69 of file drv_mb1242.c.

Variable Documentation

uint8_t buf_[2]
static

Definition at line 36 of file drv_mb1242.c.

callack_type_t callback_type_
static

Definition at line 52 of file drv_mb1242.c.

uint8_t cmd_
static

Definition at line 40 of file drv_mb1242.c.

float distance_
static

Definition at line 38 of file drv_mb1242.c.

uint32_t distance_cm_
static

Definition at line 37 of file drv_mb1242.c.

uint32_t last_update_time_ms_
static

Definition at line 34 of file drv_mb1242.c.

bool new_data_ = false
static

Definition at line 39 of file drv_mb1242.c.

uint32_t next_update_time_ms_
static

Definition at line 35 of file drv_mb1242.c.

bool sensor_present_
static

Definition at line 33 of file drv_mb1242.c.

const uint8_t START_MEASUREMENT_CMD = 0x51
static

Definition at line 31 of file drv_mb1242.c.

sonar_state_t state_
static

Definition at line 46 of file drv_mb1242.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:50