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 UART1WIRE_MAP_MIKROBUS( cfg, mikrobus ) \
67 cfg.tx_pin = MIKROBUS( mikrobus, MIKROBUS_TX ); \
68 cfg.rx_pin = MIKROBUS( mikrobus, MIKROBUS_RX )
75#define UART1WIRE_RETVAL uint8_t
78#define UART1WIRE_ERROR -1
85#define UART1WIRE_COMMAND_MODE 0xE3
86#define UART1WIRE_DATA_MODE 0xE1
87#define UART1WIRE_RESET 0xC1
88#define UART1WIRE_SKIP_ROM 0xCC
89#define UART1WIRE_CONVERT_TEMPERATURE 0x44
90#define UART1WIRE_READ_SCRATCHPAD 0xBE
91#define UART1WIRE_READ_SEQ 0xFF
92#define UART1WIRE_TEMP_SENSOR_RESOLUTION_12BIT 12
93#define UART1WIRE_TEMP_SENSOR_RESOLUTION_11BIT 11
94#define UART1WIRE_TEMP_SENSOR_RESOLUTION_10BIT 10
95#define UART1WIRE_TEMP_SENSOR_RESOLUTION_9BIT 9
102#define DRV_RX_BUFFER_SIZE 300
103#define DRV_TX_BUFFER_SIZE 100
#define DRV_RX_BUFFER_SIZE
Definition uart1wire.h:102
#define DRV_TX_BUFFER_SIZE
Definition uart1wire.h:103
#define UART1WIRE_RETVAL
Definition uart1wire.h:75
int8_t uart1wire_read_data(uart1wire_t *ctx, uint8_t *data_out, uint8_t num_bytes)
Read data function.
UART1WIRE_RETVAL uart1wire_init(uart1wire_t *ctx, uart1wire_cfg_t *cfg)
Initialization function.
uint8_t uart1wire_read_byte(uart1wire_t *ctx)
Read byte function.
void uart1wire_reset(uart1wire_t *ctx)
Reset function.
void uart1wire_cfg_setup(uart1wire_cfg_t *cfg)
Config Object Initialization function.
int32_t uart1wire_generic_read(uart1wire_t *ctx, char *data_buf, uint16_t max_len)
Generic read function.
void uart1wire_write_command(uart1wire_t *ctx, uint8_t cmd)
Write command function.
void uart1wire_generic_write(uart1wire_t *ctx, char *data_buf, uint16_t len)
Generic write function.
int8_t uart1wire_read_temperature(uart1wire_t *ctx, float *temperature, uint8_t resolution)
Read temperature function.
uint8_t uart1wire_error_t
Error type.
Definition uart1wire.h:149
Click configuration structure definition.
Definition uart1wire.h:130
uint32_t baud_rate
Definition uart1wire.h:138
bool uart_blocking
Definition uart1wire.h:139
uart_data_bits_t data_bit
Definition uart1wire.h:140
pin_name_t tx_pin
Definition uart1wire.h:134
pin_name_t rx_pin
Definition uart1wire.h:133
uart_stop_bits_t stop_bit
Definition uart1wire.h:142
uart_parity_t parity_bit
Definition uart1wire.h:141
Click ctx object definition.
Definition uart1wire.h:116
uart_t uart
Definition uart1wire.h:119