InPlay API
IR driver

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...
 

Detailed Description

HAL IR.

Macro Definition Documentation

◆ IR_IDLE

#define IR_IDLE   0x1

IR mode.

Idle

Function Documentation

◆ hal_ir_close()

void hal_ir_close ( void *  hdl)

Close IR device.

Parameters
[in]hdlIR device handle

◆ hal_ir_open()

void* hal_ir_open ( int  id,
ir_init_t *  init 
)

Open IR device.

Parameters
[in]idIR device id
[in]initinit parameter.
See also
ir_init_t
Returns
Return IR device handle, NUll if failed.

◆ hal_ir_rx()

int hal_ir_rx ( void *  hdl,
uint32_t *  buf,
int  size,
uint32_t *  out_sz 
)

Start reciece data. Need call.

See also
ir_stop_recv to get last sample.
Parameters
[in]hdlIR device handle
[in]bufrecieve data buffer
[in]sizebuffer size
[out]out_szreceive size, max value is size.
Returns
See also
enum ir_error for return code.

◆ hal_ir_rx_freq()

int hal_ir_rx_freq ( void *  hdl,
uint32_t *  buf,
int  size,
uint32_t *  out_sz 
)

Start reciece data for frequence caculation. Need call.

See also
ir_stop_recv to get last sample.
Parameters
[in]hdlIR device handle
[in]bufrecieve data buffer
[in]sizebuffer size
[out]out_szreceive size, max value is size -1.
Returns
See also
enum ir_error for return code.

◆ hal_ir_set_clk()

int hal_ir_set_clk ( void *  hdl,
uint32_t  high_usec,
uint32_t  low_usec 
)

Set IR carrier clock mannually.

Parameters
[in]hdlIR device handle
[in]clkCarrier clock. Default is 38KHz
Returns
See also
enum ir_error for return code.

◆ hal_ir_stop_rx()

int hal_ir_stop_rx ( void *  hdl)

Stop reciece data.

Parameters
[in]hdlIR device handle
Returns
See also
enum ir_error for return code.

◆ hal_ir_stop_tx()

int hal_ir_stop_tx ( void *  hdl)

Stop send data.

Parameters
[in]hdlIR device handle
Returns
See also
enum ir_error for return code.

◆ hal_ir_tx()

int hal_ir_tx ( void *  hdl,
uint32_t *  buf,
int  size 
)

Start send data.

Parameters
[in]hdlIR device handle
[in]bufdata buffer
[in]sizebuffer size
Returns
See also
enum ir_error for return code.

◆ hal_ir_tx_repeat()

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.

Parameters
[in]hdlIR device handle
[in]bufdata buffer. Won't send data when buf is NULL.
[in]sizebuffer size
[in]repeat_bufdata buffer
[in]repeat_sizebuffer size
Returns
See also
enum ir_error for return code.