Class to manage a MIKROE 4-20 mA T Click Board (MIKROE-1296).
More...
#include <MIKROE_4_20mA_RT_Click.h>
|
| T_Click (uint8_t CS_pin, const RT_Click_Calibration calib) |
| Construct a new T Click object. More...
|
|
void | set_SPI_clock (uint32_t clk_freq_Hz) |
| Adjust the initially set SPI clock frequency of 1 MHz to another frequency. More...
|
|
void | begin () |
| Start SPI and set up the cable select pin. The output current will be set to 4 mA.
|
|
uint16_t | mA2bitval (float mA) |
| Transform the current [mA] into a bit value given the calibration parameters. More...
|
|
void | set_mA (float mA) |
| Set the output current of the T Click Board in mA. More...
|
|
uint16_t | get_last_set_bitval () |
| Return the bit value belonging to the last set current by set_mA(). More...
|
|
Class to manage a MIKROE 4-20 mA T Click Board (MIKROE-1296).
◆ T_Click()
Construct a new T Click object.
- Parameters
-
CS_pin | Cable select SPI pin |
calib | Structure holding the [bitval] to [mA] calibration parameters |
◆ set_SPI_clock()
void T_Click::set_SPI_clock |
( |
uint32_t |
clk_freq_Hz | ) |
|
Adjust the initially set SPI clock frequency of 1 MHz to another frequency.
The maximum SPI clock frequency listed by the datasheet of the MCP4921 DAC chip of the T Click Board is 20 MHz.
- Parameters
-
clk_freq_Hz | The SPI clock frequency in Hz |
◆ mA2bitval()
uint16_t T_Click::mA2bitval |
( |
float |
mA | ) |
|
Transform the current [mA] into a bit value given the calibration parameters.
- Parameters
-
- Returns
- The bit value
◆ set_mA()
void T_Click::set_mA |
( |
float |
mA | ) |
|
Set the output current of the T Click Board in mA.
- Parameters
-
mA | The current to output in mA |
◆ get_last_set_bitval()
uint16_t T_Click::get_last_set_bitval |
( |
| ) |
|
Return the bit value belonging to the last set current by set_mA().
- Returns
- The bit value
The documentation for this class was generated from the following files: