c420mat2 2.1.0.0
|
API for configuring and manipulating 4-20mA T 2 Click driver. More...
Topics | |
4-20mA T 2 Registers List | |
List of registers of 4-20mA T 2 Click driver. | |
4-20mA T 2 Registers Settings | |
Settings for registers of 4-20mA T 2 Click driver. | |
4-20mA T 2 MikroBUS Map | |
MikroBUS pin mapping of 4-20mA T 2 Click driver. | |
Functions | |
void | c420mat2_cfg_setup (c420mat2_cfg_t *cfg) |
4-20mA T 2 configuration object setup function. | |
err_t | c420mat2_init (c420mat2_t *ctx, c420mat2_cfg_t *cfg) |
4-20mA T 2 initialization function. | |
err_t | c420mat2_default_cfg (c420mat2_t *ctx) |
4-20mA T 2 default configuration function. | |
err_t | c420mat2_write_data (c420mat2_t *ctx, uint8_t reg, uint16_t data_in) |
4-20mA T 2 data writing function. | |
err_t | c420mat2_read_data (c420mat2_t *ctx, uint8_t cmd, uint16_t *data_out) |
4-20mA T 2 data reading function. | |
err_t | c420mat2_protected_write (c420mat2_t *ctx, uint8_t reg, uint16_t data_in) |
4-20mA T 2 protected data writing function. | |
err_t | c420mat2_sw_reset (c420mat2_t *ctx) |
4-20mA T 2 soft reset function. | |
err_t | c420mat2_set_dac_data (c420mat2_t *ctx, uint16_t dac_output_code) |
4-20mA T 2 set DAC data function. | |
err_t | c420mat2_set_lower_limit (c420mat2_t *ctx, float lower_limit_ma) |
4-20mA T 2 set lower limit function. | |
err_t | c420mat2_set_upper_limit (c420mat2_t *ctx, float upper_limit_ma) |
4-20mA T 2 set upper limit function. | |
err_t | c420mat2_set_output_current (c420mat2_t *ctx, float current_ma) |
4-20mA T 2 set output current function. | |
err_t | c420mat2_get_status (c420mat2_t *ctx, c420mat2_status_t *status) |
4-20mA T 2 set status function. | |
uint8_t | c420mat2_get_err_pin (c420mat2_t *ctx) |
4-20mA T 2 get error flag pin state function. | |
API for configuring and manipulating 4-20mA T 2 Click driver.
Any initialization code needed for MCU to function properly. Do not remove this line or clock might not be set correctly.
void c420mat2_cfg_setup | ( | c420mat2_cfg_t * | cfg | ) |
4-20mA T 2 configuration object setup function.
This function initializes click configuration structure to initial values.
[out] | cfg | : Click configuration structure. See c420mat2_cfg_t object definition for detailed explanation. |
err_t c420mat2_default_cfg | ( | c420mat2_t * | ctx | ) |
4-20mA T 2 default configuration function.
This function executes a default configuration of 4-20mA T 2 click board.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. uint8_t c420mat2_get_err_pin | ( | c420mat2_t * | ctx | ) |
4-20mA T 2 get error flag pin state function.
This function get states of the ERR ( INT pin ) of the DAC161S997 16-Bit SPI-Programmable DAC for 4-20 mA Loops on the 4-20mA T 2 Click board™.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
0
- Low pin state, 1
- High pin state. See #err_t definition for detailed explanation. err_t c420mat2_get_status | ( | c420mat2_t * | ctx, |
c420mat2_status_t * | status ) |
4-20mA T 2 set status function.
This functionset set status data object of the DAC161S997 16-Bit SPI-Programmable DAC for 4-20 mA Loops on the 4-20mA T 2 Click board™.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[out] | status | : Status data object. (range from 4mA to 20mA). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_init | ( | c420mat2_t * | ctx, |
c420mat2_cfg_t * | cfg ) |
4-20mA T 2 initialization function.
This function initializes all necessary pins and peripherals used for this click board.
[out] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[in] | cfg | : Click configuration structure. See c420mat2_cfg_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_protected_write | ( | c420mat2_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
4-20mA T 2 protected data writing function.
This function protected writes a desired byte of data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Protected data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_read_data | ( | c420mat2_t * | ctx, |
uint8_t | cmd, | ||
uint16_t * | data_out ) |
4-20mA T 2 data reading function.
This function reads a desired byte of data from the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[out] | data_out | : Output read data. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_set_dac_data | ( | c420mat2_t * | ctx, |
uint16_t | dac_output_code ) |
4-20mA T 2 set DAC data function.
This function writes a DAC data to the C420MAT2_REG_DACCODE register of the DAC161S997 16-Bit SPI-Programmable DAC for 4-20 mA Loops on the 4-20mA T 2 Click board™.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[in] | dac_output_code | : DAC data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_set_lower_limit | ( | c420mat2_t * | ctx, |
float | lower_limit_ma ) |
4-20mA T 2 set lower limit function.
This functionset lower error conditions the output current of the DAC161S997 16-Bit SPI-Programmable DAC for 4-20 mA Loops on the 4-20mA T 2 Click board™.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[in] | lower_limit_ma | : Error conditions the output current (range from 0mA to 12mA). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_set_output_current | ( | c420mat2_t * | ctx, |
float | current_ma ) |
4-20mA T 2 set output current function.
This functionset set analog output current transfer over an industry standard 4-20mA current loop of the DAC161S997 16-Bit SPI-Programmable DAC for 4-20 mA Loops on the 4-20mA T 2 Click board™.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[in] | current_ma | : Output loop current value (range from 4mA to 20mA). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_set_upper_limit | ( | c420mat2_t * | ctx, |
float | upper_limit_ma ) |
4-20mA T 2 set upper limit function.
This functionset upper error conditions the output current of the DAC161S997 16-Bit SPI-Programmable DAC for 4-20 mA Loops on the 4-20mA T 2 Click board™.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[in] | upper_limit_ma | : Error conditions the output current (range from 12mA to 20mA). |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_sw_reset | ( | c420mat2_t * | ctx | ) |
4-20mA T 2 soft reset function.
This function performs software reset of the DAC161S997 16-Bit SPI-Programmable DAC for 4-20 mA Loops on the 4-20mA T 2 Click board™.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation. err_t c420mat2_write_data | ( | c420mat2_t * | ctx, |
uint8_t | reg, | ||
uint16_t | data_in ) |
4-20mA T 2 data writing function.
This function writes a desired byte of data to the selected register by using SPI serial interface.
[in] | ctx | : Click context object. See c420mat2_t object definition for detailed explanation. |
[in] | reg | : Start register address. |
[in] | data_in | : Data to be written. |
0
- Success, -1
- Error. See #err_t definition for detailed explanation.