LibDriver AM2320
Loading...
Searching...
No Matches
driver_am2320.h File Reference

driver am2320 header file More...

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

Go to the source code of this file.

Data Structures

struct  am2320_handle_s
 am2320 handle structure definition More...
struct  am2320_info_s
 am2320 info structure definition More...

Macros

#define DRIVER_AM2320_LINK_INIT(HANDLE, STRUCTURE)
 initialize am2320_handle_t structure
#define DRIVER_AM2320_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_AM2320_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_AM2320_LINK_IIC_WRITE_COMMAND(HANDLE, FUC)
 link iic_write_cmd function
#define DRIVER_AM2320_LINK_IIC_READ_COMMAND(HANDLE, FUC)
 link iic_read_cmd function
#define DRIVER_AM2320_LINK_BUS_INIT(HANDLE, FUC)
 link bus_init function
#define DRIVER_AM2320_LINK_BUS_DEINIT(HANDLE, FUC)
 link bus_deinit function
#define DRIVER_AM2320_LINK_BUS_READ(HANDLE, FUC)
 link bus_read function
#define DRIVER_AM2320_LINK_BUS_WRITE(HANDLE, FUC)
 link bus_write function
#define DRIVER_AM2320_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_AM2320_LINK_DELAY_US(HANDLE, FUC)
 link delay_us function
#define DRIVER_AM2320_LINK_ENABLE_IRQ(HANDLE, FUC)
 link enable_irq function
#define DRIVER_AM2320_LINK_DISABLE_IRQ(HANDLE, FUC)
 link disable_irq function
#define DRIVER_AM2320_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct am2320_handle_s am2320_handle_t
 am2320 handle structure definition
typedef struct am2320_info_s am2320_info_t
 am2320 info structure definition

Enumerations

enum  am2320_interface_t { AM2320_INTERFACE_IIC = 0x00 , AM2320_INTERFACE_GPIO = 0x01 }
 am2320 interface enumeration definition More...

Functions

uint8_t am2320_info (am2320_info_t *info)
 get chip's information
uint8_t am2320_set_interface (am2320_handle_t *handle, am2320_interface_t interface)
 set the chip interface
uint8_t am2320_get_interface (am2320_handle_t *handle, am2320_interface_t *interface)
 get the chip interface
uint8_t am2320_init (am2320_handle_t *handle)
 initialize the chip
uint8_t am2320_deinit (am2320_handle_t *handle)
 close the chip
uint8_t am2320_read_temperature_humidity (am2320_handle_t *handle, uint16_t *temperature_raw, float *temperature_s, uint16_t *humidity_raw, float *humidity_s)
 read the temperature and humidity data
uint8_t am2320_read_humidity (am2320_handle_t *handle, uint16_t *raw, float *s)
 read the humidity data
uint8_t am2320_read_temperature (am2320_handle_t *handle, uint16_t *raw, float *s)
 read the temperature data
uint8_t am2320_get_device_type (am2320_handle_t *handle, uint16_t *type)
 get device type
uint8_t am2320_get_version (am2320_handle_t *handle, uint8_t *version)
 get version
uint8_t am2320_get_status (am2320_handle_t *handle, uint8_t *status)
 get status
uint8_t am2320_get_device_id (am2320_handle_t *handle, uint32_t *id)
 get device id
uint8_t am2320_set_user_reg1 (am2320_handle_t *handle, uint16_t reg)
 set user reg1
uint8_t am2320_get_user_reg1 (am2320_handle_t *handle, uint16_t *reg)
 get user reg1
uint8_t am2320_set_user_reg2 (am2320_handle_t *handle, uint16_t reg)
 set user reg2
uint8_t am2320_get_user_reg2 (am2320_handle_t *handle, uint16_t *reg)
 get user reg2
uint8_t am2320_set_get_reg (am2320_handle_t *handle, uint8_t *input_buf, uint16_t input_len, uint8_t *output_buf, uint16_t output_len)
 set and get the register value

Detailed Description

driver am2320 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
2024-10-30

history

Date Version Author Description
2024/10/30 1.0 Shifeng Li first upload

Definition in file driver_am2320.h.