2018-10-28 22:46:52 +01:00
|
|
|
/** library to decode InfraRed NEC code
|
|
|
|
* @file
|
|
|
|
* @author King Kévin <kingkevin@cuvoodoo.info>
|
2020-06-06 14:35:55 +02:00
|
|
|
* @copyright SPDX-License-Identifier: GPL-3.0-or-later
|
2020-02-17 14:00:48 +01:00
|
|
|
* @date 2018-2020
|
2018-10-28 22:46:52 +01:00
|
|
|
* @note peripherals used: timer channel @ref ir_nec_timer
|
|
|
|
*/
|
|
|
|
#pragma once
|
2020-11-24 15:56:00 +01:00
|
|
|
#error not converted for STM32F4
|
2018-10-28 22:46:52 +01:00
|
|
|
|
|
|
|
/** set when an IR NEC code has been received */
|
|
|
|
extern volatile bool ir_nec_code_received_flag;
|
|
|
|
|
|
|
|
/** IR NEC code */
|
|
|
|
struct ir_nec_code_t {
|
|
|
|
bool repeat; /**< if this is only a code repeat (received 42.42 ms after the code, 98.75 ms after a repeat) */
|
|
|
|
uint16_t address; /**< code address (8-bit for non-extended, 16-bit for extended) */
|
|
|
|
uint8_t command; /**< code command */
|
|
|
|
};
|
|
|
|
|
|
|
|
/** last IR NEC code received */
|
|
|
|
extern struct ir_nec_code_t ir_nec_code_received;
|
|
|
|
|
|
|
|
/** setup peripherals to receive IR NEC codes
|
|
|
|
* @param[in] extended if the command address is extended (using 16 bits instead of 8, at the cost of error checking)
|
|
|
|
*/
|
|
|
|
void ir_nec_setup(bool extended);
|