MT7687 API Reference  LinkIt SDK v4
hal_irrx.h
1 /* Copyright Statement:
2  *
3  * (C) 2005-2016 MediaTek Inc. All rights reserved.
4  *
5  * This software/firmware and related documentation ("MediaTek Software") are
6  * protected under relevant copyright laws. The information contained herein
7  * is confidential and proprietary to MediaTek Inc. ("MediaTek") and/or its licensors.
8  * Without the prior written permission of MediaTek and/or its licensors,
9  * any reproduction, modification, use or disclosure of MediaTek Software,
10  * and information contained herein, in whole or in part, shall be strictly prohibited.
11  * You may only use, reproduce, modify, or distribute (as applicable) MediaTek Software
12  * if you have agreed to and been bound by the applicable license agreement with
13  * MediaTek ("License Agreement") and been granted explicit permission to do so within
14  * the License Agreement ("Permitted User"). If you are not a Permitted User,
15  * please cease any access or use of MediaTek Software immediately.
16  * BY OPENING THIS FILE, RECEIVER HEREBY UNEQUIVOCALLY ACKNOWLEDGES AND AGREES
17  * THAT MEDIATEK SOFTWARE RECEIVED FROM MEDIATEK AND/OR ITS REPRESENTATIVES
18  * ARE PROVIDED TO RECEIVER ON AN "AS-IS" BASIS ONLY. MEDIATEK EXPRESSLY DISCLAIMS ANY AND ALL
19  * WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
20  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE OR NONINFRINGEMENT.
21  * NEITHER DOES MEDIATEK PROVIDE ANY WARRANTY WHATSOEVER WITH RESPECT TO THE
22  * SOFTWARE OF ANY THIRD PARTY WHICH MAY BE USED BY, INCORPORATED IN, OR
23  * SUPPLIED WITH MEDIATEK SOFTWARE, AND RECEIVER AGREES TO LOOK ONLY TO SUCH
24  * THIRD PARTY FOR ANY WARRANTY CLAIM RELATING THERETO. RECEIVER EXPRESSLY ACKNOWLEDGES
25  * THAT IT IS RECEIVER'S SOLE RESPONSIBILITY TO OBTAIN FROM ANY THIRD PARTY ALL PROPER LICENSES
26  * CONTAINED IN MEDIATEK SOFTWARE. MEDIATEK SHALL ALSO NOT BE RESPONSIBLE FOR ANY MEDIATEK
27  * SOFTWARE RELEASES MADE TO RECEIVER'S SPECIFICATION OR TO CONFORM TO A PARTICULAR
28  * STANDARD OR OPEN FORUM. RECEIVER'S SOLE AND EXCLUSIVE REMEDY AND MEDIATEK'S ENTIRE AND
29  * CUMULATIVE LIABILITY WITH RESPECT TO MEDIATEK SOFTWARE RELEASED HEREUNDER WILL BE,
30  * AT MEDIATEK'S OPTION, TO REVISE OR REPLACE MEDIATEK SOFTWARE AT ISSUE,
31  * OR REFUND ANY SOFTWARE LICENSE FEES OR SERVICE CHARGE PAID BY RECEIVER TO
32  * MEDIATEK FOR SUCH MEDIATEK SOFTWARE AT ISSUE.
33  */
34 
35 #ifndef __HAL_IRRX_H__
36 #define __HAL_IRRX_H__
37 
38 #include "hal_platform.h"
39 
40 #ifdef HAL_IRRX_MODULE_ENABLED
41 
150 #ifdef __cplusplus
151 extern "C" {
152 #endif
153 
154 
155 
162 typedef enum {
167 
168 
170 typedef enum {
174 
176 typedef enum {
180 
181 
198 typedef void (*hal_irrx_callback_t)(hal_irrx_event_t event, void *user_data);
199 
209 typedef struct {
210  uint8_t bits;
211  uint32_t code[2];
213 
214 
216 typedef struct {
217  uint8_t inverse;
220 
233 #define HAL_IRRX_RC5_RECEIVE_FORMAT_SIGNAL_INVERSE (0x1)
237 #define HAL_IRRX_RC5_RECEIVE_FORMAT_BIT_REVERSE (0x10)
253 hal_irrx_status_t hal_irrx_init(void);
254 
255 
267 
268 
269 
287  hal_irrx_callback_t callback,
288  void *parameter);
301 
302 
317  const hal_irrx_pwd_config_t *config,
318  hal_irrx_callback_t callback,
319  uint32_t *precision_us);
320 
321 
336 hal_irrx_status_t hal_irrx_receive_pwd(uint8_t *received_length,
337  uint8_t *buffer,
338  uint8_t buffer_length);
339 
340 
354 
355 
356 
357 #ifdef __cplusplus
358 }
359 #endif
360 
366 #endif /*HAL_IRRX_MODULE_ENABLED*/
367 #endif /* __HAL_IRRX_H__ */
368 
369 
370 
IRRX invalid parameter.
Definition: hal_irrx.h:163
IRRX not support status.
Definition: hal_irrx.h:164
uint8_t inverse
PWD signal format inverse.
Definition: hal_irrx.h:217
hal_irrx_status_t hal_irrx_receive_pwd(uint8_t *received_length, uint8_t *buffer, uint8_t buffer_length)
This function receives the infrared radiation PWD code.
hal_irrx_event_t
IRRX transaction error.
Definition: hal_irrx.h:170
uint32_t terminate_threshold
PWD terminate threshold count number,to calucate thresold time:uint is us.
Definition: hal_irrx.h:218
hal_irrx_status_t hal_irrx_get_running_status(hal_irrx_running_status_t *running_status)
This function gets the current state of the IRRX.
IRRX transaction error.
Definition: hal_irrx.h:171
hal_irrx_status_t hal_irrx_receive_rc5(hal_irrx_rc5_code_t *code)
This function receives the infrared radiation RC5 code.
uint8_t bits
RC5 recevied bits number.
Definition: hal_irrx.h:210
void(* hal_irrx_callback_t)(hal_irrx_event_t event, void *user_data)
This defines the callback function prototype.
Definition: hal_irrx.h:198
hal_irrx_status_t
RC5 and PWD modes are supported.
Definition: hal_irrx.h:162
IRRX busy.
Definition: hal_irrx.h:178
Pulse-Width-Modulation receive config.
Definition: hal_irrx.h:216
hal_irrx_status_t hal_irrx_receive_rc5_start(uint8_t format, hal_irrx_callback_t callback, void *parameter)
This function starts to receive the infrared radiation RC5 code.
IRRX idle.
Definition: hal_irrx.h:177
RC5 code.
Definition: hal_irrx.h:209
hal_irrx_status_t hal_irrx_deinit(void)
This function deinitializes the IRRX hardware clock.
IRRX transaction success.
Definition: hal_irrx.h:172
hal_irrx_running_status_t
IRRX running status.
Definition: hal_irrx.h:176
IRRX status ok.
Definition: hal_irrx.h:165
hal_irrx_status_t hal_irrx_receive_pwd_start(const hal_irrx_pwd_config_t *config, hal_irrx_callback_t callback, uint32_t *precision_us)
This function starts to receive the infrared radiation PWD code.