rstransceiver 2.1.0.0
rstransceiver.h File Reference

This file contains API for RS Transceiver Click Driver. More...

#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_i2c_master.h"
#include "drv_uart.h"

Go to the source code of this file.

Data Structures

struct  rstransceiver_t
 RS Transceiver Click context object. More...
 
struct  rstransceiver_cfg_t
 RS Transceiver Click configuration object. More...
 

Macros

#define RSTRANSCEIVER_REG_INPUT_PORT   0x00
 RS Transceiver description register.
 
#define RSTRANSCEIVER_REG_OUTPUT_PORT   0x01
 
#define RSTRANSCEIVER_REG_POLARITY_INV   0x02
 
#define RSTRANSCEIVER_REG_CONFIG   0x03
 
#define RSTRANSCEIVER_REG_SPECIAL_FUNC   0x50
 
#define RSTRANSCEIVER_NO_PIN_BIT_MASK   0x00
 RS Transceiver pin bit mask values.
 
#define RSTRANSCEIVER_PIN_0_BIT_MASK   0x01
 
#define RSTRANSCEIVER_PIN_1_BIT_MASK   0x02
 
#define RSTRANSCEIVER_PIN_2_BIT_MASK   0x04
 
#define RSTRANSCEIVER_PIN_3_BIT_MASK   0x08
 
#define RSTRANSCEIVER_ALL_PINS_BIT_MASK   0x0F
 
#define RSTRANSCEIVER_OUTPUT_DIRECTION   0x00
 RS Transceiver I/O pin direction values.
 
#define RSTRANSCEIVER_INPUT_DIRECTION   0x01
 
#define RSTRANSCEIVER_SPECIAL_FUNC_P3_AS_INT   0x80
 RS Transceiver special function values.
 
#define RSTRANSCEIVER_SPECIAL_FUNC_PU_DISABLED   0x40
 
#define RSTRANSCEIVER_SLEW_DISABLE   0x00
 RS Transceiver slew limiting values.
 
#define RSTRANSCEIVER_SLEW_ENABLE   0x01
 
#define RSTRANSCEIVER_OP_MODE_LOOPBACK   0x00
 RS Transceiver operation mode selection values.
 
#define RSTRANSCEIVER_OP_MODE_RS232   0x01
 
#define RSTRANSCEIVER_OP_MODE_HALF_DUPLEX   0x02
 
#define RSTRANSCEIVER_OP_MODE_FULL_DUPLEX   0x03
 
#define RSTRANSCEIVER_OP_MODE_PIN_BIT_MASK   0x09
 
#define RSTRANSCEIVER_DIR_DISABLE   0x00
 RS Transceiver DIR1 pin direction values.
 
#define RSTRANSCEIVER_DIR_T1_EN   0x01
 
#define RSTRANSCEIVER_DIR_T1_EN_R1_DIS   0x01
 
#define RSTRANSCEIVER_DIR_PIN_BIT_MASK   0x0E
 
#define RSTRANSCEIVER_TERM_DISABLE   0x00
 RS Transceiver receiver termination values.
 
#define RSTRANSCEIVER_TERM_ENABLE   0x01
 
#define RSTRANSCEIVER_TERM_DIS_PIN_BIT_MASK   0x07
 
#define RSTRANSCEIVER_TERM_EN_PIN_BIT_MASK   0x08
 
#define RSTRANSCEIVER_TX_DRV_BUFFER_SIZE   100
 RS Transceiver driver buffer size.
 
#define RSTRANSCEIVER_RX_DRV_BUFFER_SIZE   300
 
#define RSTRANSCEIVER_DEVICE_ADDRESS   0x41
 RS Transceiver device address setting.
 
#define RSTRANSCEIVER_MAP_MIKROBUS(cfg, mikrobus)
 MikroBUS pin mapping.
 

Enumerations

enum  rstransceiver_return_value_t { RSTRANSCEIVER_OK = 0 , RSTRANSCEIVER_ERROR = -1 }
 RS Transceiver Click return value data. More...
 

Functions

void rstransceiver_cfg_setup (rstransceiver_cfg_t *cfg)
 RS Transceiver configuration object setup function.
 
err_t rstransceiver_init (rstransceiver_t *ctx, rstransceiver_cfg_t *cfg)
 RS Transceiver initialization function.
 
err_t rstransceiver_default_cfg (rstransceiver_t *ctx)
 RS Transceiver default configuration function.
 
void rstransceiver_device_enable (rstransceiver_t *ctx)
 RS Transceiver enables the device function.
 
void rstransceiver_device_disable (rstransceiver_t *ctx)
 RS Transceiver disable the device function.
 
void rstransceiver_set_slew (rstransceiver_t *ctx, uint8_t slew)
 RS Transceiver sets the slew limit function.
 
void rstransceiver_set_rts (rstransceiver_t *ctx, uint8_t rts)
 RS Transceiver request to send function.
 
uint8_t rstransceiver_get_cts (rstransceiver_t *ctx)
 RS Transceiver clear to send function.
 
err_t rstransceiver_set_op_mode (rstransceiver_t *ctx, uint8_t op_mode)
 RS Transceiver sets the operating mode function.
 
err_t rstransceiver_mode_loopback (rstransceiver_t *ctx)
 RS Transceiver sets the loopback mode function.
 
err_t rstransceiver_mode_rs232 (rstransceiver_t *ctx, uint8_t slew)
 RS Transceiver sets the RS-232 mode function.
 
err_t rstransceiver_mode_half_duplex (rstransceiver_t *ctx, uint8_t slew, uint8_t dir1, uint8_t term)
 RS Transceiver sets the Half-Duplex mode function.
 
err_t rstransceiver_mode_full_duplex (rstransceiver_t *ctx, uint8_t slew, uint8_t dir1, uint8_t term)
 RS Transceiver sets the Full-Duplex mode function.
 
err_t rstransceiver_set_dir1 (rstransceiver_t *ctx, uint8_t dir1)
 RS Transceiver sets the DIR1 pin function.
 
err_t rstransceiver_term_enable (rstransceiver_t *ctx)
 RS Transceiver term enable function.
 
err_t rstransceiver_term_disable (rstransceiver_t *ctx)
 RS Transceiver term disable function.
 
err_t rstransceiver_generic_write (rstransceiver_t *ctx, char *data_in, uint16_t len)
 RS Transceiver data writing function.
 
err_t rstransceiver_generic_read (rstransceiver_t *ctx, char *data_out, uint16_t len)
 RS Transceiver data reading function.
 

Detailed Description

This file contains API for RS Transceiver Click Driver.

Enumeration Type Documentation

◆ rstransceiver_return_value_t

RS Transceiver Click return value data.

Predefined enum values for driver return values.

Enumerator
RSTRANSCEIVER_OK 
RSTRANSCEIVER_ERROR