mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2024-12-23 11:13:09 +00:00
6c74ea65c2
* Add saving to SD-Card (not ready yet) * Add saving to SD-card (done) * Select previous menu item * Fix central button * Fix current_button * Refactoring * Add notifications * [FL-1417] Add IRDA CLI CLI commands: 1) ir_rx Receives all IR-trafic, decodes and prints result to stdout 2) ir_tx <protocol> <address> <command> Transmits IR-signal. Address and command are hex-formatted * Fix BUG with random memory corruption at random time in random place in random universe in random unknown space and time forever amen * Fix submenu set_selected_item * Bring protocol order back * Add TODO sdcard check
61 lines
1.3 KiB
C
61 lines
1.3 KiB
C
#pragma once
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* Signature of callback function for receiving continuous IRDA rx signal.
|
|
*
|
|
* @param level - level of input IRDA rx signal
|
|
* @param duration - duration of continuous rx signal level in us
|
|
*/
|
|
typedef void (*TimerISRCallback)(void* ctx, bool level, uint32_t duration);
|
|
|
|
|
|
/**
|
|
* Initialize IRDA RX timer to receive interrupts.
|
|
* It provides interrupts for every RX-signal edge changing
|
|
* with its duration.
|
|
*/
|
|
void api_hal_irda_rx_irq_init(void);
|
|
|
|
/**
|
|
* Deinitialize IRDA RX interrupt.
|
|
*/
|
|
void api_hal_irda_rx_irq_deinit(void);
|
|
|
|
/**
|
|
* Setup callback for previously initialized IRDA RX interrupt.
|
|
*
|
|
* @param callback - callback to call when RX signal edge changing occurs
|
|
* @param ctx - context for callback
|
|
*/
|
|
void api_hal_irda_rx_irq_set_callback(TimerISRCallback callback, void *ctx);
|
|
|
|
/**
|
|
* Start generating IRDA TX PWM. Provides PWM initialization on
|
|
* defined frequency.
|
|
*
|
|
* @param duty_cycle - duty cycle
|
|
* @param freq - PWM frequency to generate
|
|
*/
|
|
void api_hal_irda_pwm_set(float duty_cycle, float freq);
|
|
|
|
/**
|
|
* Stop generating IRDA PWM signal.
|
|
*/
|
|
void api_hal_irda_pwm_stop();
|
|
|
|
/**
|
|
* Check if IRDA is in use now.
|
|
* @return false - IRDA is busy, true otherwise.
|
|
*/
|
|
bool api_hal_irda_rx_irq_is_busy(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|