LibDriver GP2Y1051AU0F  1.0.0
GP2Y1051AU0F full-featured driver
gp2y1051au0f basic driver function

gp2y1051au0f basic driver modules More...

Data Structures

struct  gp2y1051au0f_handle_s
 gp2y1051au0f handle structure definition More...
 
struct  gp2y1051au0f_info_s
 gp2y1051au0f information structure definition More...
 

Typedefs

typedef struct gp2y1051au0f_handle_s gp2y1051au0f_handle_t
 gp2y1051au0f handle structure definition More...
 
typedef struct gp2y1051au0f_info_s gp2y1051au0f_info_t
 gp2y1051au0f information structure definition More...
 

Functions

uint8_t gp2y1051au0f_info (gp2y1051au0f_info_t *info)
 get chip's information More...
 
uint8_t gp2y1051au0f_init (gp2y1051au0f_handle_t *handle)
 initialize the chip More...
 
uint8_t gp2y1051au0f_deinit (gp2y1051au0f_handle_t *handle)
 close the chip More...
 
uint8_t gp2y1051au0f_read (gp2y1051au0f_handle_t *handle, uint16_t *raw, float *mg_m3)
 read the data More...
 

Detailed Description

gp2y1051au0f basic driver modules

Typedef Documentation

◆ gp2y1051au0f_handle_t

gp2y1051au0f handle structure definition

◆ gp2y1051au0f_info_t

gp2y1051au0f information structure definition

Function Documentation

◆ gp2y1051au0f_deinit()

uint8_t gp2y1051au0f_deinit ( gp2y1051au0f_handle_t handle)

close the chip

Parameters
[in]*handlepointer to a gp2y1051au0f handle structure
Returns
status code
  • 0 success
  • 1 uart deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 123 of file driver_gp2y1051au0f.c.

◆ gp2y1051au0f_info()

uint8_t gp2y1051au0f_info ( gp2y1051au0f_info_t info)

get chip's information

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

Definition at line 289 of file driver_gp2y1051au0f.c.

◆ gp2y1051au0f_init()

uint8_t gp2y1051au0f_init ( gp2y1051au0f_handle_t handle)

initialize the chip

Parameters
[in]*handlepointer to a gp2y1051au0f handle structure
Returns
status code
  • 0 success
  • 1 uart initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
Note
none

Definition at line 61 of file driver_gp2y1051au0f.c.

◆ gp2y1051au0f_read()

uint8_t gp2y1051au0f_read ( gp2y1051au0f_handle_t handle,
uint16_t *  raw,
float *  mg_m3 
)

read the data

Parameters
[in]*handlepointer to a gp2y1051au0f handle structure
[out]*rawpointer to a raw buffer
[out]*mg_m3pointer to a converted data buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 frame is invalid
  • 5 frame is error
  • 6 frame check error
Note
none

Definition at line 160 of file driver_gp2y1051au0f.c.