LibDriver APM2000
Loading...
Searching...
No Matches
driver_apm2000.h File Reference

driver apm2000 header file More...

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

Go to the source code of this file.

Data Structures

struct  apm2000_handle_s
 apm2000 handle structure definition More...
struct  apm2000_pm_s
 apm2000 pm structure definition More...
struct  apm2000_info_s
 apm2000 information structure definition More...

Macros

#define DRIVER_APM2000_LINK_INIT(HANDLE, STRUCTURE)
 initialize apm2000_handle_t structure
#define DRIVER_APM2000_LINK_UART_INIT(HANDLE, FUC)
 link uart_init function
#define DRIVER_APM2000_LINK_UART_DEINIT(HANDLE, FUC)
 link uart_deinit function
#define DRIVER_APM2000_LINK_UART_READ(HANDLE, FUC)
 link uart_read function
#define DRIVER_APM2000_LINK_UART_WRITE(HANDLE, FUC)
 link uart_write function
#define DRIVER_APM2000_LINK_UART_FLUSH(HANDLE, FUC)
 link uart_flush function
#define DRIVER_APM2000_LINK_IIC_INIT(HANDLE, FUC)
 link iic_init function
#define DRIVER_APM2000_LINK_IIC_DEINIT(HANDLE, FUC)
 link iic_deinit function
#define DRIVER_APM2000_LINK_IIC_WRITE_ADDRESS16(HANDLE, FUC)
 link iic_write_address16 function
#define DRIVER_APM2000_LINK_IIC_READ_ADDRESS16(HANDLE, FUC)
 link iic_read_address16 function
#define DRIVER_APM2000_LINK_DELAY_MS(HANDLE, FUC)
 link delay_ms function
#define DRIVER_APM2000_LINK_DEBUG_PRINT(HANDLE, FUC)
 link debug_print function

Typedefs

typedef struct apm2000_handle_s apm2000_handle_t
 apm2000 handle structure definition
typedef struct apm2000_pm_s apm2000_pm_t
 apm2000 pm structure definition
typedef struct apm2000_info_s apm2000_info_t
 apm2000 information structure definition

Enumerations

enum  apm2000_interface_t { APM2000_INTERFACE_IIC = 0x00 , APM2000_INTERFACE_UART = 0x01 }
 apm2000 interface enumeration definition More...

Functions

uint8_t apm2000_info (apm2000_info_t *info)
 get chip information
uint8_t apm2000_set_interface (apm2000_handle_t *handle, apm2000_interface_t interface)
 set the chip interface
uint8_t apm2000_get_interface (apm2000_handle_t *handle, apm2000_interface_t *interface)
 get the chip interface
uint8_t apm2000_init (apm2000_handle_t *handle)
 initialize the chip
uint8_t apm2000_deinit (apm2000_handle_t *handle)
 close the chip
uint8_t apm2000_read (apm2000_handle_t *handle, apm2000_pm_t *pm)
 read the result
uint8_t apm2000_read_pm2p5 (apm2000_handle_t *handle, uint16_t *pm2p5_ug_m3)
 read pm2.5
uint8_t apm2000_start_measurement (apm2000_handle_t *handle)
 start the measurement
uint8_t apm2000_stop_measurement (apm2000_handle_t *handle)
 stop the measurement
uint8_t apm2000_set_reg_iic (apm2000_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 set the chip register with iic interface
uint8_t apm2000_get_reg_iic (apm2000_handle_t *handle, uint16_t reg, uint8_t *buf, uint16_t len)
 get the chip register with iic interface
uint8_t apm2000_set_get_reg_uart (apm2000_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

Detailed Description

driver apm2000 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
2025-07-15

history

Date Version Author Description
2025/07/15 1.0 Shifeng Li first upload

Definition in file driver_apm2000.h.