@@ -294,11 +294,14 @@ namespace SimRacing {
294294 /* *
295295 * Class constructor
296296 *
297- * @param dataPtr pointer to the analog input data managed by the class, stored elsewhere
298- * @param nPedals the number of pedals stored in said data pointer
299- * @param detectPin the digital pin for device detection (high is detected)
297+ * @param dataPtr pointer to the analog input data managed by the class,
298+ * stored elsewhere
299+ * @param nPedals the number of pedals stored in said data pointer
300+ * @param detectPin the digital pin for device detection
301+ * @param detectActiveLow whether the device is detected on a high signal (false,
302+ * default) or a low signal (true)
300303 */
301- Pedals (AnalogInput* dataPtr, uint8_t nPedals, PinNum detectPin);
304+ Pedals (AnalogInput* dataPtr, uint8_t nPedals, PinNum detectPin, bool detectActiveLow = false );
302305
303306 /* * @copydoc Peripheral::begin() */
304307 virtual void begin ();
@@ -394,11 +397,16 @@ namespace SimRacing {
394397 /* *
395398 * Class constructor
396399 *
397- * @param pinGas the analog pin for the gas pedal potentiometer
398- * @param pinBrake the analog pin for the brake pedal potentiometer
399- * @param pinDetect the digital pin for device detection (high is detected)
400+ * @param pinGas the analog pin for the gas pedal potentiometer
401+ * @param pinBrake the analog pin for the brake pedal potentiometer
402+ * @param pinDetect the digital pin for device detection
403+ * @param detectActiveLow whether the device is detected on a high signal (false,
404+ * default) or a low signal (true)
400405 */
401- TwoPedals (PinNum pinGas, PinNum pinBrake, PinNum pinDetect = UnusedPin);
406+ TwoPedals (
407+ PinNum pinGas, PinNum pinBrake,
408+ PinNum pinDetect = UnusedPin, bool detectActiveLow = false
409+ );
402410
403411 /* *
404412 * Sets the calibration data (min/max) for the pedals
@@ -422,12 +430,17 @@ namespace SimRacing {
422430 /* *
423431 * Class constructor
424432 *
425- * @param pinGas the analog pin for the gas pedal potentiometer
426- * @param pinBrake the analog pin for the brake pedal potentiometer
427- * @param pinClutch the analog pin for the clutch pedal potentiometer
428- * @param pinDetect the digital pin for device detection (high is detected)
433+ * @param pinGas the analog pin for the gas pedal potentiometer
434+ * @param pinBrake the analog pin for the brake pedal potentiometer
435+ * @param pinClutch the analog pin for the clutch pedal potentiometer
436+ * @param pinDetect the digital pin for device detection
437+ * @param detectActiveLow whether the device is detected on a high signal (false,
438+ * default) or a low signal (true)
429439 */
430- ThreePedals (PinNum pinGas, PinNum pinBrake, PinNum pinClutch, PinNum pinDetect = UnusedPin);
440+ ThreePedals (
441+ PinNum pinGas, PinNum pinBrake, PinNum pinClutch,
442+ PinNum pinDetect = UnusedPin, bool detectActiveLow = false
443+ );
431444
432445 /* *
433446 * Sets the calibration data (min/max) for the pedals
@@ -550,12 +563,18 @@ namespace SimRacing {
550563 /* *
551564 * Class constructor
552565 *
553- * @param pinX the analog input pin for the X axis
554- * @param pinY the analog input pin for the Y axis
555- * @param pinRev the digital input pin for the 'reverse' button
556- * @param pinDetect the digital pin for device detection (high is detected)
566+ * @param pinX the analog input pin for the X axis
567+ * @param pinY the analog input pin for the Y axis
568+ * @param pinRev the digital input pin for the 'reverse' button
569+ * @param pinDetect the digital pin for device detection
570+ * @param detectActiveLow whether the device is detected on a high signal (false,
571+ * default) or a low signal (true)
557572 */
558- AnalogShifter (PinNum pinX, PinNum pinY, PinNum pinRev = UnusedPin, PinNum pinDetect = UnusedPin);
573+ AnalogShifter (
574+ PinNum pinX, PinNum pinY,
575+ PinNum pinRev = UnusedPin,
576+ PinNum pinDetect = UnusedPin, bool detectActiveLow = false
577+ );
559578
560579 /* *
561580 * Initializes the hardware pins for reading the gear states.
@@ -691,10 +710,15 @@ namespace SimRacing {
691710 /* *
692711 * Class constructor
693712 *
694- * @param pinAx analog pin number for the handbrake axis
695- * @param pinDetect the digital pin for device detection (high is detected)
713+ * @param pinAx analog pin number for the handbrake axis
714+ * @param pinDetect the digital pin for device detection
715+ * @param detectActiveLow whether the device is detected on a high signal (false,
716+ * default) or a low signal (true)
696717 */
697- Handbrake (PinNum pinAx, PinNum pinDetect = UnusedPin);
718+ Handbrake (
719+ PinNum pinAx,
720+ PinNum pinDetect = UnusedPin, boolean detectActiveLow = false
721+ );
698722
699723 /* *
700724 * Initializes the pin for reading from the handbrake.
@@ -760,7 +784,15 @@ namespace SimRacing {
760784 */
761785 class LogitechPedals : public ThreePedals {
762786 public:
763- /* * @copydoc ThreePedals::ThreePedals */
787+ /* *
788+ * Class constructor
789+ *
790+ * @param pinGas the analog pin for the gas pedal potentiometer, DE-9 pin 2
791+ * @param pinBrake the analog pin for the brake pedal potentiometer, DE-9 pin 3
792+ * @param pinClutch the analog pin for the clutch pedal potentiometer, DE-9 pin 4
793+ * @param pinDetect the digital pin for device detection, DE-9 pin 6. Requires a
794+ * pull-down resistor.
795+ */
764796 LogitechPedals (PinNum pinGas, PinNum pinBrake, PinNum pinClutch, PinNum pinDetect = UnusedPin);
765797 };
766798
@@ -775,7 +807,14 @@ namespace SimRacing {
775807 */
776808 class LogitechDrivingForceGT_Pedals : public TwoPedals {
777809 public:
778- /* * @copydoc TwoPedals::TwoPedals */
810+ /* *
811+ * Class constructor
812+ *
813+ * @param pinGas the analog pin for the gas pedal potentiometer, DE-9 pin 2
814+ * @param pinBrake the analog pin for the brake pedal potentiometer, DE-9 pin 3
815+ * @param pinDetect the digital pin for device detection, DE-9 pin 4. Requires a
816+ * pull-down resistor.
817+ */
779818 LogitechDrivingForceGT_Pedals (PinNum pinGas, PinNum pinBrake, PinNum pinDetect = UnusedPin);
780819 };
781820
@@ -787,7 +826,18 @@ namespace SimRacing {
787826 */
788827 class LogitechShifter : public AnalogShifter {
789828 public:
790- /* * @copydoc AnalogShifter::AnalogShifter */
829+ /* *
830+ * Class constructor
831+ *
832+ * @param pinX the analog input pin for the X axis, DE-9 pin 4
833+ * @param pinY the analog input pin for the Y axis, DE-9 pin 8
834+ * @param pinRev the digital input pin for the 'reverse' button, DE-9 pin 2
835+ * @param pinDetect the digital pin for device detection, DE-9 pin 7. Requires
836+ * a pull-down resistor.
837+ *
838+ * @note In order to get the 'reverse' signal from the shifter, the chip select
839+ * pin (DE-9 pin 3) needs to be pulled up to VCC.
840+ */
791841 LogitechShifter (PinNum pinX, PinNum pinY, PinNum pinRev = UnusedPin, PinNum pinDetect = UnusedPin);
792842 };
793843
0 commit comments