2019-12-04 00:49:29 -04:00
# pragma once
# include "AP_Proximity_Backend.h"
2021-03-25 04:32:09 -03:00
# if HAL_PROXIMITY_ENABLED
2019-12-04 00:49:29 -04:00
class AP_Proximity_Backend_Serial : public AP_Proximity_Backend
{
public :
AP_Proximity_Backend_Serial ( AP_Proximity & _frontend ,
2022-07-05 04:28:24 -03:00
AP_Proximity : : Proximity_State & _state ,
2022-07-12 02:29:35 -03:00
AP_Proximity_Params & _params ,
uint8_t serial_instance ) ;
2022-07-05 04:28:24 -03:00
2019-12-04 00:49:29 -04:00
// static detection function
2022-07-12 02:29:35 -03:00
// detect if a proximity sensor is connected by looking for a configured serial port
// serial_instance affects which serial port is used. Should be 0 or 1 depending on whether this is the 1st or 2nd proximity sensor with a serial interface
static bool detect ( uint8_t serial_instance ) ;
2019-12-04 00:49:29 -04:00
protected :
virtual uint16_t rxspace ( ) const { return 0 ; } ;
AP_HAL : : UARTDriver * _uart ; // uart for communicating with sensor
} ;
2021-03-25 04:32:09 -03:00
# endif // HAL_PROXIMITY_ENABLED