39#ifdef PREINIT_SUPPORTED
43#ifdef MikroCCoreVersion
44 #if MikroCCoreVersion >= 1
49#include "drv_digital_out.h"
50#include "drv_digital_in.h"
73#define IR2_STATE_HIGH 0x01
74#define IR2_STATE_LOW 0x00
80#define IR2_DEF_FREQ 38000
81#define IR2_DEF_DUTY_CYCLE 0.25
99#define IR2_MAP_MIKROBUS( cfg, mikrobus ) \
100 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
101 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
102 cfg.pwm = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
103 cfg.int_pin = MIKROBUS( mikrobus, MIKROBUS_INT );
err_t ir2_nec_read_data(ir2_t *ctx, uint8_t *address, uint8_t *data_out)
IR 2 NEC read data function.
void ir2_drv_interface_selection(ir2_cfg_t *cfg, ir2_drv_t drv_sel)
IR 2 driver interface setup function.
void ir2_nec_send_data(ir2_t *ctx, uint8_t address, uint8_t data_in)
IR 2 NEC send data function.
uint8_t ir2_get_out_pin(ir2_t *ctx)
IR 2 get OUT pin function.
void ir2_cfg_setup(ir2_cfg_t *cfg)
IR 2 configuration object setup function.
err_t ir2_init(ir2_t *ctx, ir2_cfg_t *cfg)
IR 2 initialization function.
ir2_return_value_t
IR 2 Click return value data.
Definition ir2.h:160
@ IR2_OK
Definition ir2.h:161
@ IR2_ERROR
Definition ir2.h:162
ir2_drv_t
IR 2 Click driver selector.
Definition ir2.h:113
@ IR2_DRV_SEL_GPIO
Definition ir2.h:114
@ IR2_DRV_SEL_UART
Definition ir2.h:115
IR 2 Click configuration object.
Definition ir2.h:142
ir2_drv_t drv_sel
Definition ir2.h:151
pin_name_t tx_pin
Definition ir2.h:147
uint32_t dev_pwm_freq
Definition ir2.h:149
pin_name_t rx_pin
Definition ir2.h:146
pin_name_t int_pin
Definition ir2.h:145
pin_name_t pwm
Definition ir2.h:144
IR 2 Click context object.
Definition ir2.h:123
ir2_drv_t drv_sel
Definition ir2.h:133
uint32_t pwm_freq
Definition ir2.h:131
digital_in_t out_pin
Definition ir2.h:125
pwm_t pwm
Definition ir2.h:128