LibDriver SFA30
Loading...
Searching...
No Matches
driver_sfa30.h File Reference

driver sfa30 header file More...

#include <stdio.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for driver_sfa30.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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...

Macros

#define DRIVER_SFA30_LINK_INIT(HANDLE, STRUCTURE)
 initialize sfa30_handle_t structure
#define DRIVER_SFA30_LINK_UART_INIT(HANDLE, FUC)
 link uart_init function
#define DRIVER_SFA30_LINK_UART_DEINIT(HANDLE, FUC)
 link uart_deinit function
#define DRIVER_SFA30_LINK_UART_READ(HANDLE, FUC)
 link uart_read function
#define DRIVER_SFA30_LINK_UART_WRITE(HANDLE, FUC)
 link uart_write function
#define DRIVER_SFA30_LINK_UART_FLUSH(HANDLE, FUC)
 link uart_flush function
#define DRIVER_SFA30_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_SFA30_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_SFA30_LINK_IIC_WRITE_COMMAND(HANDLE, FUC)
 link iic_write_cmd function
#define DRIVER_SFA30_LINK_IIC_READ_COMMAND(HANDLE, FUC)
 link iic_read_cmd function
#define DRIVER_SFA30_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_SFA30_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

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
uint8_t sfa30_set_get_reg_uart (sfa30_handle_t *handle, uint8_t *input, uint16_t in_len, uint8_t *output, uint16_t out_len)
 set and get the chip register with uart interface
uint8_t sfa30_set_reg_iic (sfa30_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 set the chip register with iic interface
uint8_t sfa30_get_reg_iic (sfa30_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 get the chip register with iic interface

Detailed Description

driver sfa30 header file

Copyright (c) 2015 - present LibDriver All rights reserved

The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Version
1.0.0
Author
Shifeng Li
Date
2023-07-30

history

Date Version Author Description
2023/07/30 1.0 Shifeng Li first upload

Definition in file driver_sfa30.h.