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

◆ MB1242_DEFAULT_ADDRESS

#define MB1242_DEFAULT_ADDRESS   0x70

Definition at line 29 of file drv_mb1242.c.

Enumeration Type Documentation

◆ callack_type_t

Enumerator
START_MEAS_CB 
READ_DATA_CB 

Definition at line 47 of file drv_mb1242.c.

◆ sonar_state_t

Enumerator
START_MEAS 
READ_DATA 

Definition at line 41 of file drv_mb1242.c.

Function Documentation

◆ cb()

static void cb ( uint8_t  result)
static

Definition at line 105 of file drv_mb1242.c.

◆ convert()

void convert ( )
static

Definition at line 125 of file drv_mb1242.c.

◆ mb1242_async_read()

float mb1242_async_read ( )

Definition at line 99 of file drv_mb1242.c.

◆ mb1242_async_update()

void mb1242_async_update ( )

Definition at line 76 of file drv_mb1242.c.

◆ mb1242_init()

bool mb1242_init ( )

Definition at line 57 of file drv_mb1242.c.

◆ mb1242_present()

bool mb1242_present ( )

Definition at line 69 of file drv_mb1242.c.

Variable Documentation

◆ buf_

uint8_t buf_[2]
static

Definition at line 36 of file drv_mb1242.c.

◆ callback_type_

callack_type_t callback_type_
static

Definition at line 52 of file drv_mb1242.c.

◆ cmd_

uint8_t cmd_
static

Definition at line 40 of file drv_mb1242.c.

◆ distance_

float distance_
static

Definition at line 38 of file drv_mb1242.c.

◆ distance_cm_

uint32_t distance_cm_
static

Definition at line 37 of file drv_mb1242.c.

◆ last_update_time_ms_

uint32_t last_update_time_ms_
static

Definition at line 34 of file drv_mb1242.c.

◆ new_data_

bool new_data_ = false
static

Definition at line 39 of file drv_mb1242.c.

◆ next_update_time_ms_

uint32_t next_update_time_ms_
static

Definition at line 35 of file drv_mb1242.c.

◆ sensor_present_

bool sensor_present_
static

Definition at line 33 of file drv_mb1242.c.

◆ START_MEASUREMENT_CMD

const uint8_t START_MEASUREMENT_CMD = 0x51
static

Definition at line 31 of file drv_mb1242.c.

◆ state_

sonar_state_t state_
static

Definition at line 46 of file drv_mb1242.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Mon Feb 28 2022 23:36:11