libjaylink 0.3.1
Library to access J-Link devices
Loading...
Searching...
No Matches
Functions
c2.c File Reference

Silicon Labs 2-wire (C2) interface functions. More...

#include <stdint.h>
#include "libjaylink.h"
#include "libjaylink-internal.h"

Functions

int jaylink_c2_read_address (struct jaylink_device_handle *devh, uint8_t *address)
 Read the C2 address register.
 
int jaylink_c2_write_address (struct jaylink_device_handle *devh, uint8_t address)
 Write to the C2 address register.
 
int jaylink_c2_read_data (struct jaylink_device_handle *devh, uint8_t *data, uint8_t length)
 Read the C2 data register.
 
int jaylink_c2_write_data (struct jaylink_device_handle *devh, const uint8_t *data, uint8_t length)
 Write to the C2 data register.
 

Detailed Description

Silicon Labs 2-wire (C2) interface functions.

Function Documentation

◆ jaylink_c2_read_address()

int jaylink_c2_read_address ( struct jaylink_device_handle * devh,
uint8_t * address )

Read the C2 address register.

Note
This function must only be used if the JAYLINK_TIF_C2 interface is available and selected.
Parameters
[in,out]devhDevice handle.
[out]addressValue read from the address register on success, and undefined on failure.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERR_DEVUnspecified device error.
JAYLINK_ERROther error conditions.
Since
0.3.0

◆ jaylink_c2_read_data()

int jaylink_c2_read_data ( struct jaylink_device_handle * devh,
uint8_t * data,
uint8_t length )

Read the C2 data register.

Note
This function must only be used if the JAYLINK_TIF_C2 interface is available and selected.
Parameters
[in,out]devhDevice handle.
[out]dataBuffer to store the read data on success. Its content is undefined on failure.
[in]lengthNumber of bytes to read, but not more than JAYLINK_C2_MAX_LENGTH.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERR_DEVUnspecified device error.
JAYLINK_ERROther error conditions.
Since
0.3.0

◆ jaylink_c2_write_address()

int jaylink_c2_write_address ( struct jaylink_device_handle * devh,
uint8_t address )

Write to the C2 address register.

Note
This function must only be used if the JAYLINK_TIF_C2 interface is available and selected.
Parameters
[in,out]devhDevice handle.
[in]addressValue to write into the address register.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERR_DEVUnspecified device error.
JAYLINK_ERROther error conditions.
Since
0.3.0

◆ jaylink_c2_write_data()

int jaylink_c2_write_data ( struct jaylink_device_handle * devh,
const uint8_t * data,
uint8_t length )

Write to the C2 data register.

Note
This function must only be used if the JAYLINK_TIF_C2 interface is available and selected.
Parameters
[in,out]devhDevice handle.
[in]dataBuffer to be written into the data register.
[in]lengthNumber of bytes to write, but not more than JAYLINK_C2_MAX_LENGTH.
Return values
JAYLINK_OKSuccess.
JAYLINK_ERR_ARGInvalid arguments.
JAYLINK_ERR_TIMEOUTA timeout occurred.
JAYLINK_ERR_IOInput/output error.
JAYLINK_ERR_DEVUnspecified device error.
JAYLINK_ERROther error conditions.
Since
0.3.0