Loading...
Searching...
No Matches
mq3.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2014 Freie Universität Berlin
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser General
5 * Public License v2.1. See the file LICENSE in the top level directory for more
6 * details.
7 */
8
21#ifndef MQ3_H
22#define MQ3_H
23
24#include "periph/adc.h"
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
33#define MQ3_MAX_RAW_VALUE (1023U)
34
38typedef struct {
40} mq3_t;
41
56int mq3_init(mq3_t *dev, adc_t adc_line);
57
65int16_t mq3_read_raw(const mq3_t *dev);
66
74int16_t mq3_read(const mq3_t *dev);
75
76#ifdef __cplusplus
77}
78#endif
79
80#endif /* MQ3_H */
Low-level ADC peripheral driver interface definitions.
int16_t mq3_read(const mq3_t *dev)
Read the scaled sensor value of PPM of alcohol.
int16_t mq3_read_raw(const mq3_t *dev)
Read the RAW sensor value, can be between 0 and MQ3_MAX_RAW_VALUE.
int mq3_init(mq3_t *dev, adc_t adc_line)
Initialize a MQ-3 alcohol sensor.
uint_fast8_t adc_t
Define default ADC type identifier.
Definition adc.h:72
device descriptor for a MQ-3 sensor
Definition mq3.h:38
adc_t adc_line
the used ADC line
Definition mq3.h:39