diff --git a/lib/sensor_gm1351.h b/lib/sensor_gm1351.h new file mode 100644 index 0000000..030c6e8 --- /dev/null +++ b/lib/sensor_gm1351.h @@ -0,0 +1,33 @@ +/* This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + */ +/** library to read measurements from GM1351 sound level meter + * @file + * @author King Kévin + * @date 2020 + * @note peripherals used: GPIO @ref sensor_gm1351_gpio, SPI @ref sensor_gm1351_spi + */ + +/** measurement displayed on meter LCD */ +extern uint16_t sensor_gm1351_decidba; +/** flag set when valid measurement has been received */ +extern volatile bool sensor_gm1351_received_flag; + +/** initialise interface to GM1351 sound level meter */ +void sensor_gm1351_setup(void); +/** switch power of meter + * @warning: the device will power off after 10 minutes + */ +void sensor_gm1351_power_toggle(void); +