资料介绍
Table of Contents
ADPD188 - No-OS Driver
Supported Devices
Overview
The ADPD188BI is a complete photometric system for smoke detection using optical dual wavelength technology. The module integrates a highly efficient photometric front end, two light emitting diodes (LEDs), and two photodiodes (PDs). These items are housed in a custom package that prevents light from going directly from the LED to the photodiode without first entering the smoke detection chamber. The front end of the application specific integrated circuit (ASIC) consists of a control block, a 14-bit analog-to-digital converter (ADC) with a 20-bit burst accumulator, and three flexible, independently configurable LED drivers. The control circuitry includes flexible LED signaling and synchronous detection. The analog front end (AFE) features best-in-class rejection of signal offset and corruption due to modulated interference commonly caused by ambient light. The data output and functional configuration occur over a 1.8 V I2C interface or serial peripheral interface (SPI) port.
Applications:
- Smoke detection
Driver Description
The driver contains two parts:
- The driver for the ADPD188BI part, which may be used, without modifications, with any microcontroller.
- The Communication Drivers, where the specific communication functions for the desired type of processor and communication protocol have to be implemented. This driver implements the communication with the device and hides the actual details of the communication protocol to the ADI driver.
The Communication Driver has a standard interface, so the ADPD188BI driver can be used exactly as it is provided.
the Communication Drivers must include two things: I2C or SPI transmission methods and GPIO control methods. For the I2C method, the ADPD188BI driver calls four functions:
- i2c_init() – initializes the I2C communication peripheral.
- i2c_remove() – frees memory allocated by the I2C communication driver.
- i2c_write() – writes data to the device.
- i2c_read() – reads data from the device.
For the SPI method, the ADPD188BI driver calls three functions:
- spi_init() - initializes the SPI communication peripheral.
- spi_remove() – frees memory allocated by the SPI communication driver.
- spi_write_and_read() – conduct information transfer with the device.
For the GPIO control methods, the ADPD188BI driver calls three functions:
- gpio_get() - initialize GPIO peripheral and allocate memory for one GPIO control.
- gpio_remove() - frees memory allocated by the GPIO control driver.
- gpio_direction_input() - set GPIO as input.
Functions Declarations
Function | Description |
---|---|
int32_t adpd188_init(struct adpd188_dev **device, struct adpd188_init_param *init_param); | Initialize the ADPD188 driver. |
int32_t adpd188_remove(struct adpd188_dev *dev); | Free resources allocated by adpd188_init(). |
int32_t adpd188_reg_read(struct adpd188_dev *dev, uint8_t reg_addr, uint16_t *reg_val); | Read one 16 bit register of the ADPD188. |
int32_t adpd188_reg_write(struct adpd188_dev *dev, uint8_t reg_addr, uint16_t reg_val); | Write one 16 bit register of the ADPD188. |
int32_t adpd188_mode_get(struct adpd188_dev *dev, enum adpd188_mode *mode); | Get the mode of operation of the ADPD188. |
int32_t adpd188_mode_set(struct adpd188_dev *dev, enum adpd188_mode new_mode); | Set the mode of operation of the ADPD188. |
int32_t adpd188_fifo_status_get(struct adpd188_dev *dev, uint8_t *bytes_no); | Get the number of bytes currently present in FIFO. |
int32_t adpd188_fifo_clear(struct adpd188_dev *dev); | Empty the FIFO. |
int32_t adpd188_fifo_thresh_set(struct adpd188_dev *dev, uint8_t word_no); | Set the number of 16 bit words that need to be in the FIFO to trigger an interrupt. |
int32_t adpd188_interrupt_get(struct adpd188_dev *dev, uint8_t *flags); | Get the slot and FIFO interrupt flags. |
int32_t adpd188_interrupt_clear(struct adpd188_dev *dev, uint8_t flags); | Clear the slot and FIFO interrupt flags. |
int32_t adpd188_interrupt_en(struct adpd188_dev *dev, uint8_t flags); | Enable the slot and FIFO interrupt flags. |
int32_t adpd188_gpio_setup(struct adpd188_dev *dev, struct adpd188_gpio_config config); | Setup drive and polarity of the GPIOs. |
int32_t adpd188_gpio_alt_setup(struct adpd188_dev *dev, uint8_t gpio_id, enum adpd188_gpio_alt_config config); | Setup the GPIO source. |
int32_t adpd188_sw_reset(struct adpd188_dev *dev); | Do software reset of the device. |
int32_t adpd188_clk32mhz_cal(struct adpd188_dev *dev); | Do internal 32MHz clock calibration. |
int32_t adpd188_slot_setup(struct adpd188_dev *dev, struct adpd188_slot_config config); | Enable slot and setup its FIFO interaction. |
int32_t adpd188_adc_fsample_set(struct adpd188_dev *dev, float freq_hz); | Set sample frequency of the ADC. |
int32_t adpd188_adc_fsample_get(struct adpd188_dev *dev, float *freq_hz); | Get sample frequency of the ADC. |
int32_t adpd188_smoke_detect_setup(struct adpd188_dev *dev); | Do initial configuration of the device to use as a smoke detector. |
Types Declarations
/** * @union adpd188_phy_init * @brief Communication physical protocol initialization structure. Can be I2C * or SPI. */ union adpd188_phy_init { /** I2C initialization structure. */ struct i2c_init_param i2c_phy; /** SPI initialization structure. */ struct spi_init_param spi_phy; }; /** * @enum adpd188_phy_opt * @brief Types of physical communication protocol. */ enum adpd188_phy_opt { /** SPI communication. */ ADPD188_SPI, /** I2C communication. */ ADPD188_I2C }; /** * @enum adpd188_mode * @brief ADPD188 operation modes. */ enum adpd188_mode { /** Standby mode. */ ADPD188_STANDBY, /** Program mode. */ ADPD188_PROGRAM, /** Normal mode. */ ADPD188_NORMAL }; /** * @enum adpd188_interrupt * @brief Interrupt flags of the ADPD188. */ enum adpd188_interrupt { /** Slot A conversion interrupt flag. */ ADPD188_SLOTA_INT = 0x1, /** Slot B conversion interrupt flag. */ ADPD188_SLOTB_INT = 0x2, /** FIFO threshold reached interrupt flag. */ ADPD188_FIFO_INT = 0x4 }; /** * @struct adpd188_gpio_config * @brief GPIO level configuration. */ struct adpd188_gpio_config { /** GPIO ID (0 or 1) */ uint8_t gpio_id; /** GPIO polarity */ uint8_t gpio_pol; /** Status of the GPIO driver (driven or open-drain) */ uint8_t gpio_drv; /** GPIO enable (only for GPIO0) */ uint8_t gpio_en; }; /** * @enum adpd188_gpio_alt_config * @brief GPIO source configuration. */ enum adpd188_gpio_alt_config { /** GPIO backwards compatible with the ADPD103 INT functionality. */ ADPD188_ADPD103 = 0x00, /** Interrupt function provided on GPIO. */ ADPD188_INT_FUNC = 0x01, /** * Asserts at the start of the first time slot and deasserts at end of last * time slot. */ ADPD188_ACTIVE_PULSE = 0x02, /** Time Slot A pulse output. */ ADPD188_SLOTA_PULSE = 0x05, /** Time Slot B pulse output. */ ADPD188_SLOTB_PULSE = 0x06, /** Pulse output of both time slots. */ ADPD188_ANYSLOT_PULSE = 0x07, /** Output data cycle occurred for Time Slot A. */ ADPD188_SLOTA_OUT = 0x0C, /** Output data cycle occurred for Time Slot B. */ ADPD188_SLOTB_OUT = 0x0D, /** Output data cycle occurred. */ ADPD188_ANYSLOT_OUT = 0x0E, /** * Toggles on every sample, which provides a signal at half the sampling * rate. */ ADPD188_HALF_SAMPLING = 0x0F, /** Output = 0. */ ADPD188_OUT_LOW = 0x10, /** Output = 1. */ ADPD188_OUT_HIGH = 0x11, /** 32 kHz oscillator output. */ ADPD188_32KHZ_OSC = 0x13 }; /** * @enum adpd188_slots * @brief ADPD188 time slots. */ enum adpd188_slots { /** First slot. */ ADPD188_SLOTA, /** Second slot. */ ADPD188_SLOTB }; /** * @enum adpd188_slot_fifo_mode * @brief The way a time slot stores data in the FIFO. */ enum adpd188_slot_fifo_mode { /** No data to FIFO. */ ADPD188_NO_FIFO, /** 16-bit sum of all four channels. */ ADPD188_16BIT_SUM, /** 32-bit sum of all four channels. */ ADPD188_32BIT_SUM, /** Four channels of 16-bit sample data for the time slot. */ ADPD188_16BIT_4CHAN = 0x4, /** Four channels of 32-bit sample data for the time slot. */ ADPD188_32BIT_4CHAN = 0x6 }; /** * @struct adpd188_slot_config * @brief Slot configuration initialization structure. */ struct adpd188_slot_config { /** Time slot ID. */ enum adpd188_slots slot_id; /** Enable time slot. */ bool slot_en; /** Time slot FIFO mode. */ enum adpd188_slot_fifo_mode sot_fifo_mode; }; /** * @struct adpd188_dev * @brief Driver descriptor structure. */ struct adpd188_dev { /** Communication physical type. */ enum adpd188_phy_opt phy_opt; /** Communication physical descriptor. */ void *phy_desc; /** GPIO 0 descriptor. */ struct gpio_desc *gpio0; /** GPIO 1 descriptor. */ struct gpio_desc *gpio1; }; /** * @struct adpd188_init_param * @brief Driver initialization structure. */ struct adpd188_init_param { /** Communication physical type. */ enum adpd188_phy_opt phy_opt; /** Communication physical initialization structure. */ union adpd188_phy_init phy_init; /** GPIO 0 initialization structure. */ struct gpio_init_param gpio0_init; /** GPIO 0 initialization structure. */ struct gpio_init_param gpio1_init; }; |
Initialization example
This is an initialization example. After doing this the user must put the device in GO mode and read data as described in the datasheet.
#include |
Downloads
- 利用ADPD188BI光学烟雾和气雾剂检测模块来进行烟雾测试
- 利用ADPD188BI光学烟雾和气雾剂检测模块进行烟雾测试说明
- AD5449-微控制器无操作系统驱动程序
- AD7291-微控制器无操作系统驱动程序
- AD5790-微控制器无操作系统驱动程序
- AD5162-微控制器无操作系统驱动程序
- AD7298-微控制器无操作系统驱动程序
- AD7780-适用于单片机平台的无操作系统驱动程序
- AD5252-微控制器无操作系统驱动程序
- UG-1274:ADPD188BI评估板用户指南
- AD7799-微控制器无操作系统驱动程序
- AN-2033:校准ADPD188BI光学烟雾和气溶胶探测模块
- AD7887-微控制器无操作系统驱动程序
- AD7734-微控制器无操作系统驱动程序
- ADPD188BI:用于烟雾检测数据手册的集成光学模块(修订版0) 0次下载
- 怎么编写Framebuffer驱动程序 403次阅读
- 深度解析全球操作系统格局 676次阅读
- 校准ADPD188BI光学烟雾和气溶胶检测模块 2282次阅读
- 了解和使用无操作系统和平台驱动程序 1066次阅读
- 基于ADPD188BI集成光学模块系统 1566次阅读
- 嵌入式Linux内核的驱动程序开发是怎样的 1415次阅读
- 烟雾报警系统2.0——ADPD188BI的工作原理 1.2w次阅读
- 驱动的概念和分类及安全性 3940次阅读
- 浅谈电脑驱动程序的工作原理 详解电脑驱动程序意义 2.9w次阅读
- 基于嵌入式Linux内核的系统设备驱动程序开发设计 1113次阅读
- 基于Linux2.6.30开发DS18B20的驱动程序的类型和文件操作接口函数详解 1377次阅读
- 8255A驱动程序 3193次阅读
- 8155驱动程序 3057次阅读
- Xilinx设备的驱动程序 7967次阅读
- PCI驱动程序开发实例 6702次阅读
下载排行
本周
- 1电子威廉希尔官方网站 原理第七版PDF电子教材免费下载
- 0.00 MB | 1491次下载 | 免费
- 2单片机典型实例介绍
- 18.19 MB | 95次下载 | 1 积分
- 3S7-200PLC编程实例详细资料
- 1.17 MB | 27次下载 | 1 积分
- 4笔记本电脑主板的元件识别和讲解说明
- 4.28 MB | 18次下载 | 4 积分
- 5开关电源原理及各功能威廉希尔官方网站 详解
- 0.38 MB | 11次下载 | 免费
- 6100W短波放大威廉希尔官方网站 图
- 0.05 MB | 4次下载 | 3 积分
- 7基于单片机和 SG3525的程控开关电源设计
- 0.23 MB | 4次下载 | 免费
- 8基于AT89C2051/4051单片机编程器的实验
- 0.11 MB | 4次下载 | 免费
本月
- 1OrCAD10.5下载OrCAD10.5中文版软件
- 0.00 MB | 234313次下载 | 免费
- 2PADS 9.0 2009最新版 -下载
- 0.00 MB | 66304次下载 | 免费
- 3protel99下载protel99软件下载(中文版)
- 0.00 MB | 51209次下载 | 免费
- 4LabView 8.0 专业版下载 (3CD完整版)
- 0.00 MB | 51043次下载 | 免费
- 5555集成威廉希尔官方网站 应用800例(新编版)
- 0.00 MB | 33562次下载 | 免费
- 6接口威廉希尔官方网站 图大全
- 未知 | 30320次下载 | 免费
- 7Multisim 10下载Multisim 10 中文版
- 0.00 MB | 28588次下载 | 免费
- 8开关电源设计实例指南
- 未知 | 21539次下载 | 免费
总榜
- 1matlab软件下载入口
- 未知 | 935053次下载 | 免费
- 2protel99se软件下载(可英文版转中文版)
- 78.1 MB | 537793次下载 | 免费
- 3MATLAB 7.1 下载 (含软件介绍)
- 未知 | 420026次下载 | 免费
- 4OrCAD10.5下载OrCAD10.5中文版软件
- 0.00 MB | 234313次下载 | 免费
- 5Altium DXP2002下载入口
- 未知 | 233046次下载 | 免费
- 6威廉希尔官方网站 仿真软件multisim 10.0免费下载
- 340992 | 191183次下载 | 免费
- 7十天学会AVR单片机与C语言视频教程 下载
- 158M | 183277次下载 | 免费
- 8proe5.0野火版下载(中文版免费下载)
- 未知 | 138039次下载 | 免费
评论
查看更多