Loading...
Searching...
No Matches
mq3.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2014 Freie Universität Berlin
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
19
20#include "periph/adc.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
29#define MQ3_MAX_RAW_VALUE (1023U)
30
34typedef struct {
36} mq3_t;
37
52int mq3_init(mq3_t *dev, adc_t adc_line);
53
61int16_t mq3_read_raw(const mq3_t *dev);
62
70int16_t mq3_read(const mq3_t *dev);
71
72#ifdef __cplusplus
73}
74#endif
75
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:68
device descriptor for a MQ-3 sensor
Definition mq3.h:34
adc_t adc_line
the used ADC line
Definition mq3.h:35