ir2 2.0.0.0
ir2.h File Reference

This file contains API for IR 2 Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_pwm.h"

Go to the source code of this file.

Data Structures

struct  ir2_t
 IR 2 Click context object. More...
 
struct  ir2_cfg_t
 IR 2 Click configuration object. More...
 

Macros

#define IR2_STATE_HIGH   0x01
 IR 2 control commands.
 
#define IR2_STATE_LOW   0x00
 
#define IR2_DEF_FREQ   38000
 IR 2 default PWM frequency and duty cycle.
 
#define IR2_DEF_DUTY_CYCLE   0.25
 
#define IR2_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  ir2_drv_t { IR2_DRV_SEL_GPIO , IR2_DRV_SEL_UART }
 IR 2 Click driver selector. More...
 
enum  ir2_return_value_t { IR2_OK = 0 , IR2_ERROR = -1 }
 IR 2 Click return value data. More...
 

Functions

void ir2_cfg_setup (ir2_cfg_t *cfg)
 IR 2 configuration object setup function.
 
void ir2_drv_interface_selection (ir2_cfg_t *cfg, ir2_drv_t drv_sel)
 IR 2 driver interface setup function.
 
err_t ir2_init (ir2_t *ctx, ir2_cfg_t *cfg)
 IR 2 initialization function.
 
uint8_t ir2_get_out_pin (ir2_t *ctx)
 IR 2 get OUT pin function.
 
void ir2_nec_send_data (ir2_t *ctx, uint8_t address, uint8_t data_in)
 IR 2 NEC send data function.
 
err_t ir2_nec_read_data (ir2_t *ctx, uint8_t *address, uint8_t *data_out)
 IR 2 NEC read data function.
 

Detailed Description

This file contains API for IR 2 Click Driver.

Enumeration Type Documentation

◆ ir2_drv_t

enum ir2_drv_t

IR 2 Click driver selector.

Selects target driver interface of IR Click driver.

Enumerator
IR2_DRV_SEL_GPIO 

GPIO driver descriptor.

IR2_DRV_SEL_UART 

UART driver descriptor.

◆ ir2_return_value_t

IR 2 Click return value data.

Predefined enum values for driver return values.

Enumerator
IR2_OK 
IR2_ERROR