uart1wire 2.0.0.0

Functions

void uart1wire_cfg_setup (uart1wire_cfg_t *cfg)
 Config Object Initialization function.
 
UART1WIRE_RETVAL uart1wire_init (uart1wire_t *ctx, uart1wire_cfg_t *cfg)
 Initialization function.
 
void uart1wire_generic_write (uart1wire_t *ctx, char *data_buf, uint16_t len)
 Generic write 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.
 
uint8_t uart1wire_read_byte (uart1wire_t *ctx)
 Read byte function.
 
void uart1wire_reset (uart1wire_t *ctx)
 Reset function.
 
int8_t uart1wire_read_data (uart1wire_t *ctx, uint8_t *data_out, uint8_t num_bytes)
 Read data function.
 
int8_t uart1wire_read_temperature (uart1wire_t *ctx, float *temperature, uint8_t resolution)
 Read temperature function.
 

Detailed Description

Function Documentation

◆ uart1wire_cfg_setup()

void uart1wire_cfg_setup ( uart1wire_cfg_t * cfg)

Config Object Initialization function.

Parameters
cfgClick configuration structure.

@description This function initializes click configuration structure to init state.

Note
All used pins will be set to unconnected state.

◆ uart1wire_generic_read()

int32_t uart1wire_generic_read ( uart1wire_t * ctx,
char * data_buf,
uint16_t max_len )

Generic read function.

Parameters
uart1wireClick object.
data_bufData buffer for read data.
max_lenThe maximum length of data that can be read.
Returns
Number of reads data.

◆ uart1wire_generic_write()

void uart1wire_generic_write ( uart1wire_t * ctx,
char * data_buf,
uint16_t len )

Generic write function.

Parameters
uart1wireClick object.
data_bufData buffer for sends.
lenNumber of bytes for sends.

◆ uart1wire_init()

UART1WIRE_RETVAL uart1wire_init ( uart1wire_t * ctx,
uart1wire_cfg_t * cfg )

Initialization function.

Parameters
uart1wireClick object.
cfgClick configuration structure.

@description This function initializes all necessary pins and peripherals used for this click.

◆ uart1wire_read_byte()

uint8_t uart1wire_read_byte ( uart1wire_t * ctx)

Read byte function.

Parameters
ctxClick object.
Returns
Read data byte.

@description This function reads one byte of data from the click module.

◆ uart1wire_read_data()

int8_t uart1wire_read_data ( uart1wire_t * ctx,
uint8_t * data_out,
uint8_t num_bytes )

Read data function.

Parameters
ctxClick object.
data_outData buffer for read data.
num_bytesThe maximum length of data that can be read.
Returns
  • 0 - Success,
  • -1 - Error.
@description This function reads a desired number of data bytes from the click module.

◆ uart1wire_read_temperature()

int8_t uart1wire_read_temperature ( uart1wire_t * ctx,
float * temperature,
uint8_t resolution )

Read temperature function.

Parameters
ctxClick object.
temperatureTemperature data.
resolutionTemperature sensor resolution.
Returns
  • 0 - Success,
  • -1 - Error.
@description This function reads the temperature from DALLAS one wire temperature sensors.

◆ uart1wire_reset()

void uart1wire_reset ( uart1wire_t * ctx)

Reset function.

Parameters
ctxClick object.

@description This function sends a reset pulse signal.

◆ uart1wire_write_command()

void uart1wire_write_command ( uart1wire_t * ctx,
uint8_t cmd )

Write command function.

Parameters
ctxClick object.
cmdCommand value.

@description This function sends an 8-bit command to the click module.