LibDriver CS100
Loading...
Searching...
No Matches
cs100 base driver function

cs100 base driver modules More...

Collaboration diagram for cs100 base driver function:

Data Structures

struct  cs100_time_s
 cs100 time structure definition More...
struct  cs100_handle_s
 cs100 handle structure definition More...
struct  cs100_info_s
 cs100 information structure definition More...

Macros

#define CS100_READ_RETRY_TIMES   3
 cs100 read retry times definition

Typedefs

typedef struct cs100_time_s cs100_time_t
 cs100 time structure definition
typedef struct cs100_handle_s cs100_handle_t
 cs100 handle structure definition
typedef struct cs100_info_s cs100_info_t
 cs100 information structure definition

Functions

uint8_t cs100_info (cs100_info_t *info)
 get chip's information
uint8_t cs100_init (cs100_handle_t *handle)
 initialize the chip
uint8_t cs100_deinit (cs100_handle_t *handle)
 close the chip
uint8_t cs100_read (cs100_handle_t *handle, uint32_t *time_us, float *m)
 read the distance

Detailed Description

cs100 base driver modules

Macro Definition Documentation

◆ CS100_READ_RETRY_TIMES

#define CS100_READ_RETRY_TIMES   3

cs100 read retry times definition

retry 3 times

Definition at line 64 of file driver_cs100.h.

Typedef Documentation

◆ cs100_handle_t

cs100 handle structure definition

◆ cs100_info_t

typedef struct cs100_info_s cs100_info_t

cs100 information structure definition

◆ cs100_time_t

typedef struct cs100_time_s cs100_time_t

cs100 time structure definition

Function Documentation

◆ cs100_deinit()

uint8_t cs100_deinit ( cs100_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an cs100 handle structure
Returns
status code
  • 0 success
  • 1 trig or echo deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 154 of file driver_cs100.c.

◆ cs100_info()

uint8_t cs100_info ( cs100_info_t * info)

get chip's information

Parameters
[out]*infopointer to an cs100 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 324 of file driver_cs100.c.

◆ cs100_init()

uint8_t cs100_init ( cs100_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an cs100 handle structure
Returns
status code
  • 0 success
  • 1 trig or echo init failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 61 of file driver_cs100.c.

◆ cs100_read()

uint8_t cs100_read ( cs100_handle_t * handle,
uint32_t * time_us,
float * m )

read the distance

Parameters
[in]*handlepointer to an cs100 handle structure
[out]*time_uspointer to a us buffer
[out]*mpointer to a distance buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 194 of file driver_cs100.c.