[FL-3762] Configurable Infrared TX output (#3484)

* Implement Gui for the feature
* Implement furi_hal side
* Implement IR module detection
* Fix PVS warnings
* Add comments

Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Georgii Surkov
2024-03-25 11:56:56 +03:00
committed by GitHub
parent 6de2934394
commit adafe96924
10 changed files with 326 additions and 43 deletions

View File

@@ -16,6 +16,12 @@ extern "C" {
#define INFRARED_MAX_FREQUENCY 56000
#define INFRARED_MIN_FREQUENCY 10000
typedef enum {
FuriHalInfraredTxPinInternal,
FuriHalInfraredTxPinExtPA7,
FuriHalInfraredTxPinMax,
} FuriHalInfraredTxPin;
typedef enum {
FuriHalInfraredTxGetDataStateOk, /**< New data obtained */
FuriHalInfraredTxGetDataStateDone, /**< New data obtained, and this is end of package */
@@ -143,6 +149,29 @@ void furi_hal_infrared_async_tx_set_signal_sent_isr_callback(
FuriHalInfraredTxSignalSentISRCallback callback,
void* context);
/** Detect which pin has an external IR module connected.
*
* External IR modules are detected by enabling a weak pull-up
* on supported pins and testing whether the input is still low.
*
* This method works best on modules that employ a FET with a
* strong pull-down or a BJT for driving IR LEDs.
*
* The module MUST pull the input voltage down to at least 0.9V
* or lower in order for it to be detected.
*
* If no module has been detected, FuriHalInfraredTxPinInternal is returned.
*
* @return numeric identifier of the first pin with a module detected.
*/
FuriHalInfraredTxPin furi_hal_infrared_detect_tx_output(void);
/** Set which pin will be used to transmit infrared signals.
*
* @param[in] tx_pin pin to be used for signal transmission.
*/
void furi_hal_infrared_set_tx_output(FuriHalInfraredTxPin tx_pin);
#ifdef __cplusplus
}
#endif