sensor_gm1351: make decoding user driven
This commit is contained in:
parent
58924500e3
commit
9d98ab21fc
|
@ -273,7 +273,7 @@ void sensor_gm1351_power_toggle(void)
|
|||
/** decode LCD pattern to displayed number
|
||||
* @return if number has been decoded correctly
|
||||
*/
|
||||
static bool sensor_gm1351_decode(void)
|
||||
bool sensor_gm1351_decode(void)
|
||||
{
|
||||
// do some sanity check
|
||||
if (sensor_gm1351_data[0] != 0xa0) { // set LCD segments header
|
||||
|
|
|
@ -19,15 +19,21 @@
|
|||
* @note peripherals used: GPIO @ref sensor_gm1351_gpio, SPI @ref sensor_gm1351_spi
|
||||
*/
|
||||
|
||||
/** measurement displayed on meter LCD */
|
||||
/** measurement displayed on meter LCD, in deci-dBa
|
||||
* @warning value is only valid if decoding is successful
|
||||
*/
|
||||
extern uint16_t sensor_gm1351_decidba;
|
||||
/** flag set when valid measurement has been received */
|
||||
/** flag set when LCD data 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
|
||||
* @warning the device will power off after 10 minutes
|
||||
*/
|
||||
void sensor_gm1351_power_toggle(void);
|
||||
|
||||
/** decode LCD data to displayed number
|
||||
* @return if number has been decoded correctly
|
||||
* @warning should be done before the next LCD data is being received (e.g. right after the flag is set)
|
||||
*/
|
||||
bool sensor_gm1351_decode(void);
|
||||
|
|
Loading…
Reference in New Issue