|
| 1 | +/** |
| 2 | + * @file example_drv_ir.h |
| 3 | + * @brief Infrared communication example driver interface for Tuya IoT devices. |
| 4 | + * |
| 5 | + * This header file provides the interface definitions for demonstrating |
| 6 | + * infrared communication capabilities using Tuya's IR peripheral drivers. |
| 7 | + * It serves as an educational and testing framework for developers to |
| 8 | + * understand and implement IR functionality in their Tuya IoT applications. |
| 9 | + * |
| 10 | + * The example demonstrates: |
| 11 | + * - Hardware registration and configuration for IR devices |
| 12 | + * - Driver initialization and setup procedures |
| 13 | + * - Basic IR transmission and reception operations |
| 14 | + * - Integration with Tuya's TDD (Tuya Device Driver) and TDL (Tuya Device Layer) systems |
| 15 | + * |
| 16 | + * This interface abstracts the complexity of IR hardware management and |
| 17 | + * provides simple functions for registering IR hardware, opening drivers, |
| 18 | + * and running IR communication examples. It supports multiple hardware |
| 19 | + * platforms and can be configured for different IR protocols including |
| 20 | + * NEC protocol and raw timecode transmission. |
| 21 | + * |
| 22 | + * The example is designed to work with various Tuya-supported microcontroller |
| 23 | + * platforms and provides a foundation for developing custom IR-enabled |
| 24 | + * IoT applications. |
| 25 | + * |
| 26 | + * @copyright Copyright (c) 2021-2025 Tuya Inc. All Rights Reserved. |
| 27 | + * |
| 28 | + */ |
| 29 | + |
| 30 | +#ifndef __EXAMPLE_IR_H__ |
| 31 | +#define __EXAMPLE_IR_H__ |
| 32 | + |
| 33 | +#include "tuya_cloud_types.h" |
| 34 | + |
| 35 | +#ifdef __cplusplus |
| 36 | +extern "C" { |
| 37 | +#endif |
| 38 | + |
| 39 | +/*********************************************************** |
| 40 | +*********************** macro define *********************** |
| 41 | +***********************************************************/ |
| 42 | + |
| 43 | + |
| 44 | +/*********************************************************** |
| 45 | +********************** typedef define ********************** |
| 46 | +***********************************************************/ |
| 47 | + |
| 48 | + |
| 49 | +/*********************************************************** |
| 50 | +******************* function declaration ******************* |
| 51 | +***********************************************************/ |
| 52 | +/** |
| 53 | + * @brief register hardware |
| 54 | + * |
| 55 | + * @param[in] : the name of the driver |
| 56 | + * |
| 57 | + * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h |
| 58 | + */ |
| 59 | +OPERATE_RET reg_ir_hardware(char *device_name); |
| 60 | + |
| 61 | +/** |
| 62 | + * @brief open driver |
| 63 | + * |
| 64 | + * @param[in] : the name of the driver |
| 65 | + * |
| 66 | + * @return OPRT_OK on success. Others on error, please refer to tuya_error_code.h |
| 67 | + */ |
| 68 | +OPERATE_RET open_ir_driver(char *device_name); |
| 69 | + |
| 70 | +#ifdef __cplusplus |
| 71 | +} |
| 72 | +#endif |
| 73 | + |
| 74 | +#endif /* __EXAMPLE_IR_H__ */ |
0 commit comments