uarti2cspi 2.0.0.0
uarti2cspi.h File Reference

This file contains API for UART I2C/SPI Click driver. More...

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

Go to the source code of this file.

Data Structures

struct  uarti2cspi_s
 Click ctx object definition. More...
 
struct  uarti2cspi_cfg_t
 Click configuration structure definition. More...
 

Macros

#define UARTI2CSPI_MAP_MIKROBUS(cfg, mikrobus)
 
#define UARTI2CSPI_MASTER_I2C   0
 
#define UARTI2CSPI_MASTER_SPI   1
 
#define UARTI2CSPI_RETVAL   uint8_t
 
#define UARTI2CSPI_OK   0x00
 
#define UARTI2CSPI_INIT_ERROR   0xFF
 
#define UARTI2CSPI_OSCILATOR_FREQ   1843200.0
 
#define UARTI2CSPI_PRESCALER_DEF   1.0
 
#define UARTI2CSPI_ADDR   0x48
 
#define UARTI2CSPI_RHR   0x00 << 3
 
#define UARTI2CSPI_THR   0x00 << 3
 
#define UARTI2CSPI_IER   0x01 << 3
 
#define UARTI2CSPI_FCR   0x02 << 3
 
#define UARTI2CSPI_IIR   0x02 << 3
 
#define UARTI2CSPI_LCR   0x03 << 3
 
#define UARTI2CSPI_MCR   0x04 << 3
 
#define UARTI2CSPI_LSR   0x05 << 3
 
#define UARTI2CSPI_MSR   0x06 << 3
 
#define UARTI2CSPI_SPR   0x07 << 3
 
#define UARTI2CSPI_TCR   0x06 << 3
 
#define UARTI2CSPI_TLR   0x07 << 3
 
#define UARTI2CSPI_TXLVL   0x08 << 3
 
#define UARTI2CSPI_RXLVL   0x09 << 3
 
#define UARTI2CSPI_EFCR   0x0F << 3
 
#define UARTI2CSPI_DLL   0x00 << 3
 
#define UARTI2CSPI_DLH   0x01 << 3
 
#define UARTI2CSPI_EFR   0x02 << 3
 
#define UARTI2CSPI_XON1   0x04 << 3
 
#define UARTI2CSPI_XON2   0x05 << 3
 
#define UARTI2CSPI_XOFF1   0x06 << 3
 
#define UARTI2CSPI_XOFF2   0x07 << 3
 
#define UARTI2CSPI_UART_5_BIT_DATA   0x00
 
#define UARTI2CSPI_UART_6_BIT_DATA   0x01
 
#define UARTI2CSPI_UART_7_BIT_DATA   0x02
 
#define UARTI2CSPI_UART_8_BIT_DATA   0x03
 
#define UARTI2CSPI_UART_NOPARITY   0x00
 
#define UARTI2CSPI_UART_EVENPARITY   0x18
 
#define UARTI2CSPI_UART_ODDPARITY   0x08
 
#define UARTI2CSPI_UART_PARITY_ONE   0x38
 
#define UARTI2CSPI_UART_PARITY_ZERO   0x28
 
#define UARTI2CSPI_UART_ONE_STOPBIT   0x00
 
#define UARTI2CSPI_UART_TWO_STOPBITS   0x04
 
#define UARTI2CSPI_CTS_INT_EN   0x80
 
#define UARTI2CSPI_RTS_INT_EN   0x40
 
#define UARTI2CSPI_XOFF_INT_EN   0x20
 
#define UARTI2CSPI_SLEEP_INT_EN   0x10
 
#define UARTI2CSPI_MODEM_STATUS_INT_EN   0x08
 
#define UARTI2CSPI_RECEIVE_LINE_STATUS_INT_EN   0x04
 
#define UARTI2CSPI_THR_EMPTY_INT_EN   0x02
 
#define UARTI2CSPI_RXD_INT_EN   0x01
 
#define UARTI2CSPI_DATA_READY   0x01
 
#define UARTI2CSPI_DATA_NOT_READY   0x00
 

Typedefs

typedef uint8_t uarti2cspi_select_t
 Communication type.
 
typedef void(* uarti2cspi_master_write_t) (struct uarti2cspi_s *, uint8_t, uint8_t)
 
typedef void(* uarti2cspi_master_read_t) (struct uarti2cspi_s *, uint8_t, uint8_t *)
 
typedef struct uarti2cspi_s uarti2cspi_t
 Click ctx object definition.
 

Functions

void uarti2cspi_cfg_setup (uarti2cspi_cfg_t *cfg)
 Config Object Initialization function.
 
UARTI2CSPI_RETVAL uarti2cspi_init (uarti2cspi_t *ctx, uarti2cspi_cfg_t *cfg)
 Initialization function.
 
void uarti2cspi_generic_write (uarti2cspi_t *ctx, uint8_t reg, uint8_t data_buf)
 Generic write function.
 
void uarti2cspi_generic_read (uarti2cspi_t *ctx, uint8_t reg, uint8_t *data_buf)
 Generic read function.
 
void uarti2cspi_set_reset (uarti2cspi_t *ctx, uint8_t state)
 Set RST pin state function.
 
void uarti2cspi_advanced_init (uarti2cspi_t *ctx, uint32_t baud_rate, uint8_t data_bits, uint8_t parity_mode, uint8_t stop_bits)
 Advanced initialization function.
 
void uarti2cspi_interrupt_enable (uarti2cspi_t *ctx, uint8_t vector)
 Interrupt enable function.
 
void uarti2cspi_uart_write_text (uarti2cspi_t *ctx, uint8_t *w_text)
 Uart write text function.
 
void uarti2cspi_uart_write (uarti2cspi_t *ctx, uint8_t w_byte)
 Uart write function.
 
uint8_t uarti2cspi_uart_data_ready (uarti2cspi_t *ctx)
 Uart data ready function.
 
uint8_t uarti2cspi_uart_read (uarti2cspi_t *ctx)
 Uart read function.
 

Detailed Description

This file contains API for UART I2C/SPI Click driver.