InPlay API
|
HAL IR. More...
Macros | |
#define | IR_IDLE 0x1 |
IR mode. More... | |
#define | IR_SEND 0x2 |
Send data. | |
#define | IR_RECV 0x4 |
Recieve data. | |
#define | IR_RECV_FREQ 0x10 |
Reciece data for calculate frequence. | |
#define | IR_FREQ_BUF_LEN 6 |
Buffer length for calculate frequence. Must be divided evenly by 3, and minimum value is 3. | |
Enumerations | |
enum | |
IR device ID. | |
Functions | |
void * | hal_ir_open (int id, ir_init_t *init) |
Open IR device. More... | |
void | hal_ir_close (void *hdl) |
Close IR device. More... | |
int | hal_ir_rx (void *hdl, uint32_t *buf, int size, uint32_t *out_sz) |
Start reciece data. Need call. More... | |
int | hal_ir_rx_freq (void *hdl, uint32_t *buf, int size, uint32_t *out_sz) |
Start reciece data for frequence caculation. Need call. More... | |
int | hal_ir_stop_rx (void *hdl) |
Stop reciece data. More... | |
int | hal_ir_tx (void *hdl, uint32_t *buf, int size) |
Start send data. More... | |
int | hal_ir_stop_tx (void *hdl) |
Stop send data. More... | |
int | hal_ir_tx_repeat (void *hdl, uint32_t *buf, int size, uint32_t *repeat_buf, int repeat_size) |
Send data and then send repeated data continually. More... | |
int | hal_ir_set_clk (void *hdl, uint32_t high_usec, uint32_t low_usec) |
Set IR carrier clock mannually. More... | |
HAL IR.
#define IR_IDLE 0x1 |
IR mode.
Idle
void hal_ir_close | ( | void * | hdl | ) |
Close IR device.
[in] | hdl | IR device handle |
void* hal_ir_open | ( | int | id, |
ir_init_t * | init | ||
) |
Open IR device.
[in] | id | IR device id |
[in] | init | init parameter. |
int hal_ir_rx | ( | void * | hdl, |
uint32_t * | buf, | ||
int | size, | ||
uint32_t * | out_sz | ||
) |
Start reciece data. Need call.
[in] | hdl | IR device handle |
[in] | buf | recieve data buffer |
[in] | size | buffer size |
[out] | out_sz | receive size, max value is size. |
int hal_ir_rx_freq | ( | void * | hdl, |
uint32_t * | buf, | ||
int | size, | ||
uint32_t * | out_sz | ||
) |
Start reciece data for frequence caculation. Need call.
[in] | hdl | IR device handle |
[in] | buf | recieve data buffer |
[in] | size | buffer size |
[out] | out_sz | receive size, max value is size -1. |
int hal_ir_set_clk | ( | void * | hdl, |
uint32_t | high_usec, | ||
uint32_t | low_usec | ||
) |
Set IR carrier clock mannually.
[in] | hdl | IR device handle |
[in] | clk | Carrier clock. Default is 38KHz |
int hal_ir_stop_rx | ( | void * | hdl | ) |
Stop reciece data.
[in] | hdl | IR device handle |
int hal_ir_stop_tx | ( | void * | hdl | ) |
Stop send data.
[in] | hdl | IR device handle |
int hal_ir_tx | ( | void * | hdl, |
uint32_t * | buf, | ||
int | size | ||
) |
Start send data.
[in] | hdl | IR device handle |
[in] | buf | data buffer |
[in] | size | buffer size |
int hal_ir_tx_repeat | ( | void * | hdl, |
uint32_t * | buf, | ||
int | size, | ||
uint32_t * | repeat_buf, | ||
int | repeat_size | ||
) |
Send data and then send repeated data continually.
[in] | hdl | IR device handle |
[in] | buf | data buffer. Won't send data when buf is NULL. |
[in] | size | buffer size |
[in] | repeat_buf | data buffer |
[in] | repeat_size | buffer size |