adswio2 2.0.0.0
|
Functions | |
void | adswio2_cfg_setup (adswio2_cfg_t *cfg) |
Config Object Initialization function. | |
ADSWIO2_RETVAL | adswio2_init (adswio2_t *ctx, adswio2_cfg_t *cfg) |
Initialization function. | |
void | adswio2_default_cfg (adswio2_t *ctx) |
Click Default Configuration function. | |
void | adswio2_generic_transfer (adswio2_t *ctx, uint8_t *wr_buf, uint16_t wr_len, uint8_t *rd_buf, uint16_t rd_len) |
Generic transfer function. | |
void | adswio2_reset (adswio2_t *ctx) |
Click Reset function. | |
uint8_t | adswio2_status_pin_ready (adswio2_t *ctx) |
Ready Pin Status Check function. | |
uint8_t | adswio2_status_pin_alert (adswio2_t *ctx) |
Alert Pin Status Check function. | |
void | adswio2_set_handler (adswio2_t *ctx, adswio2_handler_t handler) |
Error Handler Setup function. | |
void | adswio2_clear_handler (adswio2_t *ctx) |
Error Handler Clear function. | |
adswio2_err_t | adswio2_generic_write (adswio2_t *ctx, uint8_t reg_addr, uint16_t data_in) |
Generic Write function. | |
adswio2_err_t | adswio2_generic_read (adswio2_t *ctx, uint8_t reg_addr, uint16_t *data_out, uint8_t *rd_status) |
Generic Read function. | |
adswio2_err_t | adswio2_generic_multi_read (adswio2_t *ctx, adswio2_read_t *rd) |
Generic Multi Read function. | |
adswio2_err_t | adswio2_exe_command (adswio2_t *ctx, uint16_t cmd_key) |
Command Execute function. | |
void | adswio2_mask_alert_set (adswio2_t *ctx, uint16_t alert_mask) |
Alert Mask function. | |
adswio2_err_t | adswio2_status_live (adswio2_t *ctx, uint16_t *status, uint16_t status_mask) |
Live Status function. | |
adswio2_err_t | adswio2_status_data_ready (adswio2_t *ctx, uint8_t *drdy, uint16_t *conv_target) |
Data Ready Status function. | |
adswio2_err_t | adswio2_status_alert (adswio2_t *ctx, uint16_t *status, uint16_t status_mask) |
Alert Status function. | |
adswio2_err_t | adswio2_set_conv_mode (adswio2_t *ctx, uint8_t mode) |
Conversion Mode Setup function. | |
adswio2_err_t | adswio2_enable_ch (adswio2_t *ctx, uint8_t channel) |
Channel Enable function. | |
adswio2_err_t | adswio2_enable_diag (adswio2_t *ctx, uint8_t diagnostic) |
Diagnostic Enable function. | |
adswio2_err_t | adswio2_set_ch_func (adswio2_t *ctx, uint8_t channel, uint8_t ch_func) |
Channel Function Setup function. | |
adswio2_err_t | adswio2_assign_diag (adswio2_t *ctx, uint8_t diagnostic, uint8_t duty) |
Diagnostic Assign function. | |
adswio2_err_t | adswio2_get_conv_results (adswio2_t *ctx, uint8_t channel, uint16_t *data_out) |
Channel Results Get function. | |
adswio2_err_t | adswio2_get_diag_results (adswio2_t *ctx, uint8_t diagnostic, uint16_t *data_out) |
Diagnostic Results Get function. | |
adswio2_err_t adswio2_assign_diag | ( | adswio2_t * | ctx, |
uint8_t | diagnostic, | ||
uint8_t | duty ) |
Diagnostic Assign function.
ctx | Click object. |
diagnostic | Selects diagnostic to be assigned. |
duty | Selects new duty to be assigned. |
0 - Ok, 3 - Readback status error, 8 - Invalid diagnostic selection, 9 - CRC error, 13 - Diagnostic assign error.
@description This function allows user to assign the new duty for the selected diagnostic.
void adswio2_cfg_setup | ( | adswio2_cfg_t * | cfg | ) |
Config Object Initialization function.
cfg | Click configuration structure. |
@description This function initializes click configuration structure to init state.
void adswio2_clear_handler | ( | adswio2_t * | ctx | ) |
Error Handler Clear function.
ctx | Click object. |
@description This function will set the error handler to NULL (unused).
void adswio2_default_cfg | ( | adswio2_t * | ctx | ) |
Click Default Configuration function.
ctx | Click object. |
@description This function executes default configuration for AD SWIO 2 click.
adswio2_err_t adswio2_enable_ch | ( | adswio2_t * | ctx, |
uint8_t | channel ) |
Channel Enable function.
ctx | Click object. |
channel | Selects channel/s to be enabled. |
0 - Ok, 3 - Readback status error, 7 - Invalid channel selection, 9 - CRC error.
@description This function allows user to enable the desired channel/channels.
adswio2_err_t adswio2_enable_diag | ( | adswio2_t * | ctx, |
uint8_t | diagnostic ) |
Diagnostic Enable function.
ctx | Click object. |
diagnostic | Selects diagnostic/s to be enabled. |
0 - Ok, 3 - Readback status error, 8 - Invalid diagnostic selection, 9 - CRC error.
@description This function allows user to enable the desired diagnostic/diagnostics.
adswio2_err_t adswio2_exe_command | ( | adswio2_t * | ctx, |
uint16_t | cmd_key ) |
Command Execute function.
ctx | Click object. |
cmd_key | Command key to be executed. |
@description This function executes an entered command key.
adswio2_err_t adswio2_generic_multi_read | ( | adswio2_t * | ctx, |
adswio2_read_t * | rd ) |
Generic Multi Read function.
ctx | Click object. |
reg_addr | Address which from data reading be started. |
data_out | Memory where read data be stored. |
rd_mode | 0 - Auto read disable; 2 - Auto read enable. |
n_words | Selects number of data words to be read. The range is from 1 to 4. |
0 - Ok, 3 - Readback status error, 4 - Auto read setup error, 5 - Number of words is out of range, 9 - CRC error, 10 - Invalid register address.
@description This function reads the desired number of 16-bit data words starting from the selected register.
adswio2_err_t adswio2_generic_read | ( | adswio2_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t * | data_out, | ||
uint8_t * | rd_status ) |
Generic Read function.
ctx | Click object. |
reg_addr | Address which from data be read. |
data_out | Memory where read data be stored. |
rd_status | Readback status. |
0 - Ok, 3 - Readback status error, 9 - CRC error, 10 - Invalid register address.
@description This function reads 16-bit data from the selected register and also shows the readback status.
void adswio2_generic_transfer | ( | adswio2_t * | ctx, |
uint8_t * | wr_buf, | ||
uint16_t | wr_len, | ||
uint8_t * | rd_buf, | ||
uint16_t | rd_len ) |
Generic transfer function.
ctx | Click object. |
wr_buf | Write data buffer |
wr_len | Number of byte in write data buffer |
rd_buf | Read data buffer |
rd_len | Number of byte in read data buffer |
@description Generic SPI transfer, for sending and receiving packages
adswio2_err_t adswio2_generic_write | ( | adswio2_t * | ctx, |
uint8_t | reg_addr, | ||
uint16_t | data_in ) |
Generic Write function.
ctx | Click object. |
reg_addr | Address where data be written. |
data_in | Data to be written. |
@description This function writes 16-bit data to the selected register.
adswio2_err_t adswio2_get_conv_results | ( | adswio2_t * | ctx, |
uint8_t | channel, | ||
uint16_t * | data_out ) |
Channel Results Get function.
ctx | Click object. |
channel | Choose channel results. |
data_out | Results of channel conversion. |
0 - Ok, 3 - Readback status error, 7 - Invalid channel selection, 9 - CRC error.
@description This function allows user to get the converted results of the selected channel.
adswio2_err_t adswio2_get_diag_results | ( | adswio2_t * | ctx, |
uint8_t | diagnostic, | ||
uint16_t * | data_out ) |
Diagnostic Results Get function.
ctx | Click object. |
diagnostic | Choose diagnostic results. |
data_out | Results of target diagnostic. |
0 - Ok, 3 - Readback status error, 8 - Invalid diagnostic selection, 9 - CRC error.
@description This function allows user to get the results of the selected diagnostic.
ADSWIO2_RETVAL adswio2_init | ( | adswio2_t * | ctx, |
adswio2_cfg_t * | cfg ) |
Initialization function.
ctx | Click object. |
cfg | Click configuration structure. |
@description This function initializes all necessary pins and peripherals used for this click.
void adswio2_mask_alert_set | ( | adswio2_t * | ctx, |
uint16_t | alert_mask ) |
Alert Mask function.
ctx | Click object. |
alert_mask | Selects alerts to be masked. |
@description This function allows user to mask the irrelevant alerts.
void adswio2_reset | ( | adswio2_t * | ctx | ) |
Click Reset function.
@description This function executes a hardware reset of the click board.
adswio2_err_t adswio2_set_ch_func | ( | adswio2_t * | ctx, |
uint8_t | channel, | ||
uint8_t | ch_func ) |
Channel Function Setup function.
ctx | Click object. |
channel | Selects channel to be modified. |
ch_func | Selects new channel function. |
@description This function allows user to modify the functionality of the selected channel.
adswio2_err_t adswio2_set_conv_mode | ( | adswio2_t * | ctx, |
uint8_t | mode ) |
Conversion Mode Setup function.
ctx | Click object. |
mode | Mode to be set. |
0 - Ok, 3 - Readback status error, 9 - CRC error, 11 - Invalid conversion mode.
@description This function sets the conversion mode and performs power control of the click.
void adswio2_set_handler | ( | adswio2_t * | ctx, |
adswio2_handler_t | handler ) |
Error Handler Setup function.
ctx | Click object. |
handler | Function to be executed. |
@description This function executes an error handler setup.
adswio2_err_t adswio2_status_alert | ( | adswio2_t * | ctx, |
uint16_t * | status, | ||
uint16_t | status_mask ) |
Alert Status function.
ctx | Click object. |
status | Alert status of the click. |
status_mask | Irrelevant status flags to be masked. |
@description This function allows user to check the alert status, masking the irrelevant status flags.
adswio2_err_t adswio2_status_data_ready | ( | adswio2_t * | ctx, |
uint8_t * | drdy, | ||
uint16_t * | conv_target ) |
Data Ready Status function.
ctx | Click object. |
drdy | Data ready status; 0 - not ready, 1 - ready. |
conv_target | Current executed ADC measurement. |
@description This function allows user to check the data ready status and gives an information about current executed AD conversion.
adswio2_err_t adswio2_status_live | ( | adswio2_t * | ctx, |
uint16_t * | status, | ||
uint16_t | status_mask ) |
Live Status function.
ctx | Click object. |
status | Live status of the click. |
status_mask | Irrelevant status flags to be masked. |
@description This function allows user to check the live status of the click, masking the irrelevant status flags.
uint8_t adswio2_status_pin_alert | ( | adswio2_t * | ctx | ) |
Alert Pin Status Check function.
ctx | Click object. |
@description This function checks the status of the alert pin.
uint8_t adswio2_status_pin_ready | ( | adswio2_t * | ctx | ) |
Ready Pin Status Check function.
ctx | Click object. |
@description This function checks the status of the ready pin.