LibDriver SFA30
Loading...
Searching...
No Matches
sfa30 basic driver function

sfa30 basic driver modules More...

Collaboration diagram for sfa30 basic driver function:

Data Structures

struct  sfa30_data_s
 sfa30 data structure definition More...
struct  sfa30_handle_s
 sfa30 handle structure definition More...
struct  sfa30_info_s
 sfa30 information structure definition More...

Typedefs

typedef struct sfa30_data_s sfa30_data_t
 sfa30 data structure definition
typedef struct sfa30_handle_s sfa30_handle_t
 sfa30 handle structure definition
typedef struct sfa30_info_s sfa30_info_t
 sfa30 information structure definition

Enumerations

enum  sfa30_interface_t { SFA30_INTERFACE_IIC = 0x00 , SFA30_INTERFACE_UART = 0x01 }
 sfa30 interface enumeration definition More...

Functions

uint8_t sfa30_info (sfa30_info_t *info)
 get chip information
uint8_t sfa30_set_interface (sfa30_handle_t *handle, sfa30_interface_t interface)
 set the chip interface
uint8_t sfa30_get_interface (sfa30_handle_t *handle, sfa30_interface_t *interface)
 get the chip interface
uint8_t sfa30_init (sfa30_handle_t *handle)
 initialize the chip
uint8_t sfa30_deinit (sfa30_handle_t *handle)
 close the chip
uint8_t sfa30_read (sfa30_handle_t *handle, sfa30_data_t *data)
 read the result
uint8_t sfa30_start_measurement (sfa30_handle_t *handle)
 start the measurement
uint8_t sfa30_stop_measurement (sfa30_handle_t *handle)
 stop the measurement
uint8_t sfa30_reset (sfa30_handle_t *handle)
 reset the chip
uint8_t sfa30_get_device_information (sfa30_handle_t *handle, char info[32])
 get device information

Detailed Description

sfa30 basic driver modules

Typedef Documentation

◆ sfa30_data_t

typedef struct sfa30_data_s sfa30_data_t

sfa30 data structure definition

◆ sfa30_handle_t

sfa30 handle structure definition

◆ sfa30_info_t

typedef struct sfa30_info_s sfa30_info_t

sfa30 information structure definition

Enumeration Type Documentation

◆ sfa30_interface_t

sfa30 interface enumeration definition

Enumerator
SFA30_INTERFACE_IIC 

iic interface

SFA30_INTERFACE_UART 

uart interface

Definition at line 62 of file driver_sfa30.h.

Function Documentation

◆ sfa30_deinit()

uint8_t sfa30_deinit ( sfa30_handle_t * handle)

close the chip

Parameters
[in]*handlepointer to an sfa30 handle structure
Returns
status code
  • 0 success
  • 1 iic or uart deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 soft reset failed
Note
none

Definition at line 1054 of file driver_sfa30.c.

◆ sfa30_get_device_information()

uint8_t sfa30_get_device_information ( sfa30_handle_t * handle,
char info[32] )

get device information

Parameters
[in]*handlepointer to an sfa30 handle structure
[out]*infopointer to an info buffer
Returns
status code
  • 0 success
  • 1 get device information failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 655 of file driver_sfa30.c.

◆ sfa30_get_interface()

uint8_t sfa30_get_interface ( sfa30_handle_t * handle,
sfa30_interface_t * interface )

get the chip interface

Parameters
[in]*handlepointer to an sfa30 handle structure
[out]*interfacepointer to a chip interface buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 497 of file driver_sfa30.c.

◆ sfa30_info()

uint8_t sfa30_info ( sfa30_info_t * info)

get chip information

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

Definition at line 1241 of file driver_sfa30.c.

◆ sfa30_init()

uint8_t sfa30_init ( sfa30_handle_t * handle)

initialize the chip

Parameters
[in]*handlepointer to an sfa30 handle structure
Returns
status code
  • 0 success
  • 1 iic or uart initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 reset failed
Note
none

Definition at line 908 of file driver_sfa30.c.

◆ sfa30_read()

uint8_t sfa30_read ( sfa30_handle_t * handle,
sfa30_data_t * data )

read the result

Parameters
[in]*handlepointer to an sfa30 handle structure
[out]*datapointer to an sfa30_data_t structure
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 814 of file driver_sfa30.c.

◆ sfa30_reset()

uint8_t sfa30_reset ( sfa30_handle_t * handle)

reset the chip

Parameters
[in]*handlepointer to an sfa30 handle structure
Returns
status code
  • 0 success
  • 1 reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 746 of file driver_sfa30.c.

◆ sfa30_set_interface()

uint8_t sfa30_set_interface ( sfa30_handle_t * handle,
sfa30_interface_t interface )

set the chip interface

Parameters
[in]*handlepointer to an sfa30 handle structure
[in]interfacechip interface
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 476 of file driver_sfa30.c.

◆ sfa30_start_measurement()

uint8_t sfa30_start_measurement ( sfa30_handle_t * handle)

start the measurement

Parameters
[in]*handlepointer to an sfa30 handle structure
Returns
status code
  • 0 success
  • 1 start measurement failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 519 of file driver_sfa30.c.

◆ sfa30_stop_measurement()

uint8_t sfa30_stop_measurement ( sfa30_handle_t * handle)

stop the measurement

Parameters
[in]*handlepointer to an sfa30 handle structure
Returns
status code
  • 0 success
  • 1 stop measurement failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 587 of file driver_sfa30.c.