MT7687 API Reference  LinkIt SDK v4
IRRX

This section introduces the Infrared Receiver(IRRX) APIs including terms and acronyms, supported features, software architecture, details on how to use this driver, IRRX function groups, enums, structures and functions. More...

Overview

This section introduces the Infrared Receiver(IRRX) APIs including terms and acronyms, supported features, software architecture, details on how to use this driver, IRRX function groups, enums, structures and functions.

Terms and acronyms

Terms Details
IRRX Infrared Receiver that detects infrared radiation. For more information, please refer to introduction to IrDA in Wikipedia .

Supported features

How to use this driver

Functions

hal_irrx_status_t hal_irrx_init (void)
 This function initializes the IRRX hardware clock. More...
 
hal_irrx_status_t hal_irrx_deinit (void)
 This function deinitializes the IRRX hardware clock. More...
 
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. More...
 
hal_irrx_status_t hal_irrx_receive_rc5 (hal_irrx_rc5_code_t *code)
 This function receives the infrared radiation RC5 code. More...
 
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. More...
 
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. More...
 
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. More...
 

Modules

 Define
 
 Enum
 
 Struct
 
 Typedef
 

Function Documentation

hal_irrx_status_t hal_irrx_deinit ( void  )

This function deinitializes the IRRX hardware clock.

Returns
Indicates whether this function call is successful or not. If the return value is HAL_IRRX_STATUS_OK, the operation completed successfully. If the return value is HAL_IRRX_STATUS_INVALID_PARAM, it means a wrong parameter is given. The parameter needs to be verified.
Example
Sample code, please refer to How to use this driver.
See also
hal_irrx_init()
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.

Parameters
[out]running_statusis the current running status. HAL_IRRX_BUSY means the IRRX is in busy status. HAL_IRRX_IDLE means the IRRX is in idle status, user can use it to transfer data now.
Returns
Indicates whether this function call is successful or not. If the return value is HAL_IRRX_STATUS_OK, the operation completed successfully.
Example
Sample code, please refer to How to use this driver.
See also
hal_irrx_receive_pwd()
hal_irrx_status_t hal_irrx_init ( void  )

This function initializes the IRRX hardware clock.

Returns
Indicates whether this function call is successful or not. If the return value is HAL_IRRX_STATUS_OK, the operation completed successfully. If the return value is HAL_IRRX_STATUS_INVALID_PARAM, it means a wrong parameter is given. The parameter needs to be verified.
Example
Sample code, please refer to How to use this driver.
See also
hal_irrx_deinit()
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.

Parameters
[in]received_lengththe actual received length of code in the buffer.
[in]bufferthe buffer to be used to stored received code.
[in]buffer_lengththe length of buffer that can be used to store received code. The maximum is 68 bytes and it is suggested to prepare 68 bytes of space for buffer and specify 68 as buffer_length.
Returns
Indicates whether this function call is successful or not. If the return value is HAL_IRRX_STATUS_OK, the operation completed successfully. If the return value is HAL_IRRX_STATUS_INVALID_PARAM, it means a wrong parameter is given. The parameter needs to be verified.
Example
Sample code, please refer to How to use this driver.
See also
hal_irrx_receive_pwd()
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.

Parameters
[in]configit's used when the receive operation starts.
[in]callbackthe callback function to be called when the receive operation starts.
[out]precision_usthe PWD dectection precise time.
Returns
Indicates whether this function call is successful or not. If the return value is HAL_IRRX_STATUS_OK, the operation completed successfully. If the return value is HAL_IRRX_STATUS_INVALID_PARAM, it means a wrong parameter is given. The parameter needs to be verified.
Example
Sample code, please refer to How to use this driver.
See also
hal_irrx_receive_pwd()
hal_irrx_status_t hal_irrx_receive_rc5 ( hal_irrx_rc5_code_t code)

This function receives the infrared radiation RC5 code.

Parameters
[in]codethe infrared radiation RC5 code format definition. For more details about the parameter, please refer to hal_irrx_rc5_code_t.
Returns
Indicates whether this function call is successful or not. If the return value is HAL_IRRX_STATUS_OK, the operation completed successfully. If the return value is HAL_IRRX_STATUS_INVALID_PARAM, it means a wrong parameter is given. The parameter needs to be verified.
Example
Sample code, please refer to How to use this driver.
See also
hal_irrx_receive_rc5_start()
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.

Parameters
[in]formatthe combination of HAL_IRRX_RC5_RECEIVE_FORMAT_SIGNAL_INVERSE, and HAL_IRRX_RC5_RECEIVE_FORMAT_BIT_REVERSE.
[in]callbackthe callback function to be called when the receive operation is complete.
[in]parameterthe parameter to the caller when return.
Returns
Indicates whether this function call is successful or not. If the return value is HAL_IRRX_STATUS_OK, the operation completed successfully. If the return value is HAL_IRRX_STATUS_INVALID_PARAM, it means a wrong parameter is given. The parameter needs to be verified.
Example
Sample code, please refer to How to use this driver.
See also
hal_irrx_receive_rc5()