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 OPTO7_PIN_STATE_HIGH 0x01
74#define OPTO7_PIN_STATE_LOW 0x00
81#define OPTO7_TX_DRV_BUFFER_SIZE 100
82#define OPTO7_RX_DRV_BUFFER_SIZE 300
100#define OPTO7_MAP_MIKROBUS( cfg, mikrobus ) \
101 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
102 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
103 cfg.gp1 = MIKROBUS( mikrobus, MIKROBUS_PWM ); \
104 cfg.gp2 = MIKROBUS( mikrobus, MIKROBUS_INT );
#define OPTO7_TX_DRV_BUFFER_SIZE
Opto 7 driver buffer size.
Definition opto7.h:81
#define OPTO7_RX_DRV_BUFFER_SIZE
Definition opto7.h:82
err_t opto7_generic_read(opto7_t *ctx, uint8_t *data_out, uint16_t len)
Opto 7 data reading function.
err_t opto7_default_cfg(opto7_t *ctx)
Opto 7 default configuration function.
uint8_t opto7_get_gp2_pin(opto7_t *ctx)
Opto 7 get GP2 pin function.
err_t opto7_generic_write(opto7_t *ctx, uint8_t *data_in, uint16_t len)
Opto 7 data writing function.
void opto7_set_gp1_pin(opto7_t *ctx, uint8_t pin_state)
Opto 7 set GP1 pin function.
void opto7_cfg_setup(opto7_cfg_t *cfg)
Opto 7 configuration object setup function.
err_t opto7_init(opto7_t *ctx, opto7_cfg_t *cfg)
Opto 7 initialization function.
void opto7_drv_interface_selection(opto7_cfg_t *cfg, opto7_drv_t drv_sel)
Opto 7 driver interface setup function.
opto7_drv_t
Opto 7 Click driver selector.
Definition opto7.h:114
@ OPTO7_DRV_SEL_GPIO
Definition opto7.h:115
@ OPTO7_DRV_SEL_UART
Definition opto7.h:116
opto7_return_value_t
Opto 7 Click return value data.
Definition opto7.h:172
@ OPTO7_OK
Definition opto7.h:173
@ OPTO7_ERROR
Definition opto7.h:174
Opto 7 Click configuration object.
Definition opto7.h:148
uint32_t baud_rate
Definition opto7.h:158
opto7_drv_t drv_sel
Definition opto7.h:163
pin_name_t gp2
Definition opto7.h:155
bool uart_blocking
Definition opto7.h:159
uart_data_bits_t data_bit
Definition opto7.h:160
pin_name_t tx_pin
Definition opto7.h:151
pin_name_t rx_pin
Definition opto7.h:150
uart_stop_bits_t stop_bit
Definition opto7.h:162
pin_name_t gp1
Definition opto7.h:154
uart_parity_t parity_bit
Definition opto7.h:161
Opto 7 Click context object.
Definition opto7.h:125
opto7_drv_t drv_sel
Definition opto7.h:139
digital_in_t gp2
Definition opto7.h:130
uart_t uart
Definition opto7.h:133
digital_out_t gp1
Definition opto7.h:127