Files
core/src/ir_decoder/include/ir_decode.h

195 lines
5.4 KiB
C
Raw Normal View History

2017-01-09 20:23:01 +08:00
/**************************************************************************************
Filename: ir_decode.h
Revised: Date: 2016-10-01
Revision: Revision: 1.0
Description: This file provides algorithms for IR decode
Revision log:
* 2016-10-01: created by strawmanbobi
2017-01-09 20:23:01 +08:00
**************************************************************************************/
2016-12-14 21:37:56 +08:00
#ifndef _IRDA_DECODE_H_
#define _IRDA_DECODE_H_
2016-12-14 21:37:56 +08:00
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdio.h>
2017-01-02 18:38:22 +08:00
#include "ir_defs.h"
#include "ir_ac_control.h"
#include "ir_tv_control.h"
#define IR_DECODE_FAILED (-1)
#define IR_DECODE_SUCCEEDED (0)
/* exported functions */
///////////////////////////////////////////////// AC Begin /////////////////////////////////////////////////
/*
2017-01-02 19:06:31 +08:00
* function ir_ac_file_open
*
* parameters: file name of remote binary
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-01-02 19:06:31 +08:00
extern INT8 ir_ac_file_open(const char *file_name);
/*
2017-01-02 19:06:31 +08:00
* function ir_ac_lib_open
*
* parameters: binary (in) binary content
* binary_length (in) length of binary content
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-01-02 19:06:31 +08:00
extern INT8 ir_ac_lib_open(UINT8 *binary, UINT16 binary_length);
/*
2017-01-02 19:06:31 +08:00
* function ir_ac_lib_parse
*
* parameters:
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-01-02 19:06:31 +08:00
extern INT8 ir_ac_lib_parse();
/*
2017-01-02 19:06:31 +08:00
* function ir_ac_lib_control
*
* parameters: ac_status (in) indicates the current status of air conditioner to be controlled
* user_data (out) wave code array to be transmitted
* function_code (in) indicates the AC function to be updated
* change_wind_direction (in) indicates if the wind direction need to be changed
*
* return: length of wave code array
*/
2017-01-02 19:06:31 +08:00
extern UINT16 ir_ac_lib_control(remote_ac_status_t ac_status, UINT16 *user_data, UINT8 function_code,
BOOL change_wind_direction);
/*
2017-01-02 19:06:31 +08:00
* function ir_ac_lib_close
*
* parameters:
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-03-14 12:55:56 +08:00
extern INT8 ir_ac_lib_close();
///////////////////////////////////////////////// AC End /////////////////////////////////////////////////
///////////////////////////////////////////////// TV Begin /////////////////////////////////////////////////
/*
2017-01-02 19:06:31 +08:00
* function ir_tv_file_open
*
* parameters: file name of remote binary
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-03-25 22:39:20 +08:00
extern INT8 ir_tv_file_open(const char *file_name);
/*
2017-01-02 19:06:31 +08:00
* function ir_tv_lib_open
*
* parameters: binary (in) binary content
* binary_length (in) length of binary content
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-03-25 22:39:20 +08:00
extern INT8 ir_tv_lib_open(UINT8 *binary, UINT16 binary_length);
/*
2017-01-02 19:06:31 +08:00
* function ir_tv_lib_parse
*
* parameters:
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-01-21 20:28:52 +08:00
extern INT8 ir_tv_lib_parse(UINT8 ir_hex_encode);
/*
2017-01-02 19:06:31 +08:00
* function ir_tv_lib_control
*
* parameters: key_code (in) indicates the number of pressed key
* user_data (out) wave code array to be transmitted
*
* return: length of wave code array
*/
2017-01-02 19:06:31 +08:00
extern UINT16 ir_tv_lib_control(UINT8 key_code, UINT16 *user_data);
/*
2017-01-02 19:06:31 +08:00
* function ir_tv_lib_close
*
* parameters:
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-01-02 19:06:31 +08:00
extern INT8 ir_tv_lib_close();
///////////////////////////////////////////////// TV End /////////////////////////////////////////////////
///////////////////////////////////////////////// Utils Begin /////////////////////////////////////////////////
/*
* function get_temperature_range
*
* parameters: ac_mode (in) specify in which AC mode the application need to get temperature info
* temp_min (out) the min temperature supported in a specified AC mode
* temp_max (out) the max temperature supported in a specified AC mode
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-03-16 21:26:53 +08:00
extern INT8 get_temperature_range(UINT8 ac_mode, INT8 *temp_min, INT8 *temp_max);
/*
* function get_supported_mode
*
* parameters: supported_mode (out) mode supported by the remote in lower 5 bits
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-03-16 21:26:53 +08:00
extern INT8 get_supported_mode(UINT8 *supported_mode);
/*
* function get_supported_wind_speed
*
* parameters: ac_mode (in) specify in which AC mode the application need to get wind speed info
* supported_wind_speed (out) wind speed supported by the remote in lower 4 bits
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-03-16 21:26:53 +08:00
extern INT8 get_supported_wind_speed(UINT8 ac_mode, UINT8 *supported_wind_speed);
/*
* function get_supported_swing
*
* parameters: ac_mode (in) specify in which AC mode the application need to get swing info
* supported_swing (out) swing supported by the remote in lower 2 bits
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-03-16 21:26:53 +08:00
extern INT8 get_supported_swing(UINT8 ac_mode, UINT8 *supported_swing);
/*
* function get_supported_wind_direction
*
* parameters: supported_wind_direction (out) swing supported by the remote in lower 2 bits
*
* return: IR_DECODE_SUCCEEDED / IR_DECODE_FAILED
*/
2017-03-16 21:26:53 +08:00
extern INT8 get_supported_wind_direction(UINT8 *supported_wind_direction);
2017-01-02 18:38:22 +08:00
// private extern function
#if (defined BOARD_PC || defined BOARD_PC_DLL)
2017-03-16 21:26:53 +08:00
2017-01-21 20:28:52 +08:00
extern void ir_lib_free_inner_buffer();
2017-03-16 21:26:53 +08:00
2017-01-02 18:38:22 +08:00
#endif
///////////////////////////////////////////////// Utils End /////////////////////////////////////////////////
2016-12-14 21:37:56 +08:00
#ifdef __cplusplus
}
#endif
#endif // _IRDA_DECODE_H_