![]() |
LibDriver AM2320
|
driver am2320 source file More...
#include "driver_am2320.h"Go to the source code of this file.
Functions | |
| 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_read_humidity (am2320_handle_t *handle, uint16_t *raw, float *s) |
| read the humidity data | |
| 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_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_init (am2320_handle_t *handle) |
| initialize the chip | |
| uint8_t | am2320_deinit (am2320_handle_t *handle) |
| close the chip | |
| 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 | |
| uint8_t | am2320_info (am2320_info_t *info) |
| get chip's information | |
driver am2320 source 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.
| Date | Version | Author | Description |
|---|---|---|---|
| 2024/10/30 | 1.0 | Shifeng Li | first upload |
Definition in file driver_am2320.c.
| #define AM2320_ADDRESS 0xB8 |
| #define AM2320_MODBUS_ADDRESS_DEVICE_0 0x0E |
device id 0
Definition at line 69 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_DEVICE_1 0x0D |
device id 1
Definition at line 68 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_DEVICE_2 0x0C |
device id 2
Definition at line 67 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_DEVICE_3 0x0B |
device id 3
Definition at line 66 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_DEVICE_TYPE_LSB 0x09 |
device type lsb
Definition at line 64 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_DEVICE_TYPE_MSB 0x08 |
device type msb
Definition at line 63 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_HUMI_LSB 0x01 |
humi lsb
Definition at line 60 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_HUMI_MSB 0x00 |
| #define AM2320_MODBUS_ADDRESS_STATUS 0x0F |
status
Definition at line 70 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_TEMP_LSB 0x03 |
temp lsb
Definition at line 62 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_TEMP_MSB 0x02 |
temp msb
Definition at line 61 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_USER_REG1_LSB 0x11 |
user reg1 lsb
Definition at line 72 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_USER_REG1_MSB 0x10 |
user reg1 msb
Definition at line 71 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_USER_REG2_LSB 0x13 |
user reg2 lsb
Definition at line 74 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_USER_REG2_MSB 0x12 |
user reg2 msb
Definition at line 73 of file driver_am2320.c.
| #define AM2320_MODBUS_ADDRESS_VERSION 0x0A |
version
Definition at line 65 of file driver_am2320.c.
| #define CHIP_NAME "ASAIR AM2320" |
| #define DRIVER_VERSION 1000 |
driver version
Definition at line 49 of file driver_am2320.c.
| #define MANUFACTURER_NAME "ASAIR" |
manufacturer name
Definition at line 43 of file driver_am2320.c.
| #define MAX_CURRENT 0.95f |
chip max current
Definition at line 46 of file driver_am2320.c.
| #define SUPPLY_VOLTAGE_MAX 5.5f |
chip max supply voltage
Definition at line 45 of file driver_am2320.c.
| #define SUPPLY_VOLTAGE_MIN 3.1f |
chip min supply voltage
Definition at line 44 of file driver_am2320.c.
| #define TEMPERATURE_MAX 60.0f |
chip max operating temperature
Definition at line 48 of file driver_am2320.c.
| #define TEMPERATURE_MIN -20.0f |
chip min operating temperature
Definition at line 47 of file driver_am2320.c.