digiisolator 2.1.0.0
|
API for configuring and manipulating DIGI Isolator Click driver. More...
Topics | |
DIGI Isolator Registers Settings | |
Settings for registers of DIGI Isolator Click driver. | |
DIGI Isolator MikroBUS Map | |
MikroBUS pin mapping of DIGI Isolator Click driver. | |
Functions | |
void | digiisolator_cfg_setup (digiisolator_cfg_t *cfg) |
DIGI Isolator configuration object setup function. | |
err_t | digiisolator_init (digiisolator_t *ctx, digiisolator_cfg_t *cfg) |
DIGI Isolator initialization function. | |
err_t | digiisolator_spi_write (digiisolator_t *ctx, uint8_t *data_in, uint8_t len) |
DIGI Isolator SPI data writing function. | |
err_t | digiisolator_spi_read (digiisolator_t *ctx, uint8_t *data_out, uint8_t len) |
DIGI Isolator SPI data reading function. | |
err_t | digiisolator_spi_write_read (digiisolator_t *ctx, uint8_t *data_in, uint8_t len_in, uint8_t *data_out, uint8_t len_out) |
DIGI Isolator SPI write then read function. | |
err_t | digiisolator_spi_transfer (digiisolator_t *ctx, uint8_t *data_in, uint8_t *data_out, uint8_t len) |
DIGI Isolator SPI transfer function. | |
err_t | digiisolator_uart_write (digiisolator_t *ctx, char *data_in, uint16_t len) |
DIGI Isolator UART data writing function. | |
err_t | digiisolator_uart_read (digiisolator_t *ctx, char *data_out, uint16_t len) |
DIGI Isolator UART data reading function. | |
err_t | digiisolator_get_d1_pin_value (digiisolator_t *ctx, uint16_t *data_out) |
DIGI Isolator read D1 pin value function. | |
err_t | digiisolator_get_d1_pin_voltage (digiisolator_t *ctx, float *data_out) |
DIGI Isolator read D1 pin voltage level function. | |
uint8_t | digiisolator_get_d2 (digiisolator_t *ctx) |
DIGI Isolator get D2 function. | |
API for configuring and manipulating DIGI Isolator Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void digiisolator_cfg_setup | ( | digiisolator_cfg_t * | cfg | ) |
DIGI Isolator configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See digiisolator_cfg_t object definition for detailed explanation. |
err_t digiisolator_get_d1_pin_value | ( | digiisolator_t * | ctx, |
uint16_t * | data_out ) |
DIGI Isolator read D1 pin value function.
This function reads results of AD conversion of the D1 pin.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[out] | data_out | : Output ADC result. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t digiisolator_get_d1_pin_voltage | ( | digiisolator_t * | ctx, |
float * | data_out ) |
DIGI Isolator read D1 pin voltage level function.
This function reads results of AD conversion of the D1 pin and converts them to proportional voltage level.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[out] | data_out | : Output voltage level of the analog pin [V]. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t digiisolator_get_d2 | ( | digiisolator_t * | ctx | ) |
DIGI Isolator get D2 function.
This function get states of the D2 ( INT ) pin.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. err_t digiisolator_init | ( | digiisolator_t * | ctx, |
digiisolator_cfg_t * | cfg ) |
DIGI Isolator initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See digiisolator_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t digiisolator_spi_read | ( | digiisolator_t * | ctx, |
uint8_t * | data_out, | ||
uint8_t | len ) |
DIGI Isolator SPI data reading function.
This function reads a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t digiisolator_spi_transfer | ( | digiisolator_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t * | data_out, | ||
uint8_t | len ) |
DIGI Isolator SPI transfer function.
This function writes and reads a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be transferred (written/read). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t digiisolator_spi_write | ( | digiisolator_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | len ) |
DIGI Isolator SPI data writing function.
This function writes a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t digiisolator_spi_write_read | ( | digiisolator_t * | ctx, |
uint8_t * | data_in, | ||
uint8_t | len_in, | ||
uint8_t * | data_out, | ||
uint8_t | len_out ) |
DIGI Isolator SPI write then read function.
This function writes and then reads a desired number of data bytes by using SPI serial interface.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | len_in | : Number of bytes to be written. |
[out] | data_out | : Output read data. |
[in] | len_out | : Number of bytes to be read. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t digiisolator_uart_read | ( | digiisolator_t * | ctx, |
char * | data_out, | ||
uint16_t | len ) |
DIGI Isolator UART data reading function.
This function reads a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[out] | data_out | : Output read data. |
[in] | len | : Number of bytes to be read. |
>0
- Number of data bytes read, <=0
- Error/Empty Ring buffer. See #err_t definition for detailed explanation. err_t digiisolator_uart_write | ( | digiisolator_t * | ctx, |
char * | data_in, | ||
uint16_t | len ) |
DIGI Isolator UART data writing function.
This function writes a desired number of data bytes by using UART serial interface.
[in] | ctx | : Click context object. See digiisolator_t object definition for detailed explanation. |
[in] | data_in | : Data to be written. |
[in] | len | : Number of bytes for sending. |
>=0
- Success, <0
- Error. See #err_t definition for detailed explanation.