35#ifndef RS232ISOLATOR_H
36#define RS232ISOLATOR_H
42#ifdef PREINIT_SUPPORTED
46#ifdef MikroCCoreVersion
47 #if MikroCCoreVersion >= 1
52#include "drv_digital_out.h"
53#include "drv_digital_in.h"
66#define RS232ISOLATOR_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX ); \
69 cfg.cts = MIKROBUS( mikrobus, MIKROBUS_CS ); \
70 cfg.rts = MIKROBUS( mikrobus, MIKROBUS_INT )
77#define RS232ISOLATOR_RETVAL uint8_t
79#define RS232ISOLATOR_OK 0x00
80#define RS232ISOLATOR_INIT_ERROR 0xFF
87#define DRV_RX_BUFFER_SIZE 500
#define DRV_RX_BUFFER_SIZE
Definition rs232isolator.h:87
#define RS232ISOLATOR_RETVAL
Definition rs232isolator.h:77
void rs232isolator_cfg_setup(rs232isolator_cfg_t *cfg)
Config Object Initialization function.
RS232ISOLATOR_RETVAL rs232isolator_init(rs232isolator_t *ctx, rs232isolator_cfg_t *cfg)
Initialization function.
int16_t rs232isolator_generic_read(rs232isolator_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void rs232isolator_generic_write(rs232isolator_t *ctx, char *data_buf, uint16_t len)
Generic write function.
uint8_t rs232_2_get_cts(rs232isolator_t *ctx)
Read CTS state.
void rs232_2_set_rts(rs232isolator_t *ctx, uint8_t state)
Function settings RTS state.
void rs232isolator_send_command(rs232isolator_t *ctx, char *command)
Function for send command.
uint8_t rs232isolator_error_t
Error type.
Definition rs232isolator.h:146
Click configuration structure definition.
Definition rs232isolator.h:122
pin_name_t rts
Definition rs232isolator.h:131
uint32_t baud_rate
Definition rs232isolator.h:135
pin_name_t cts
Definition rs232isolator.h:130
bool uart_blocking
Definition rs232isolator.h:136
uart_data_bits_t data_bit
Definition rs232isolator.h:137
pin_name_t tx_pin
Definition rs232isolator.h:126
pin_name_t rx_pin
Definition rs232isolator.h:125
uart_stop_bits_t stop_bit
Definition rs232isolator.h:139
uart_parity_t parity_bit
Definition rs232isolator.h:138
Click ctx object definition.
Definition rs232isolator.h:100
uart_t uart
Definition rs232isolator.h:111
digital_in_t rts
Definition rs232isolator.h:107
digital_out_t cts
Definition rs232isolator.h:103