rtd2 2.0.0.0
|
This file contains API for RTD 2 Click driver. More...
#include "drv_digital_out.h"
#include "drv_digital_in.h"
#include "drv_spi_master.h"
#include "spi_specifics.h"
Go to the source code of this file.
Data Structures | |
struct | rtd2_t |
Click ctx object definition. More... | |
struct | rtd2_cfg_t |
Click configuration structure definition. More... | |
Macros | |
#define | RTD2_MAP_MIKROBUS(cfg, mikrobus) |
#define | RTD2_SET_DATA_SAMPLE_EDGE SET_SPI_DATA_SAMPLE_EDGE |
Data sample selection. | |
#define | RTD2_SET_DATA_SAMPLE_MIDDLE SET_SPI_DATA_SAMPLE_MIDDLE |
#define | RTD2_REG_MUX0 0x00 |
#define | RTD2_REG_VBIAS 0x01 |
#define | RTD2_REG_MUX1 0x02 |
#define | RTD2_REG_SYS0 0x03 |
#define | RTD2_REG_OFC0 0x04 |
#define | RTD2_REG_OFC1 0x05 |
#define | RTD2_REG_OFC2 0x06 |
#define | RTD2_REG_FSC0 0x07 |
#define | RTD2_REG_FSC1 0x08 |
#define | RTD2_REG_FSC2 0x09 |
#define | RTD2_REG_IDAC0 0x0A |
#define | RTD2_REG_IDAC1 0x0B |
#define | RTD2_REG_GPIOCFG 0x0C |
#define | RTD2_REG_GPIODIR 0x0D |
#define | RTD2_REG_GPIODAT 0x0E |
#define | RTD2_CMD_WAKEUP 0x01 |
#define | RTD2_CMD_SLEEP 0x03 |
#define | RTD2_CMD_SYNC 0x05 |
#define | RTD2_CMD_RESET 0x07 |
#define | RTD2_CMD_NOP 0xFF |
#define | RTD2_CMD_RDATA 0x12 |
#define | RTD2_CMD_RDATAC 0x14 |
#define | RTD2_CMD_SDATAC 0x16 |
#define | RTD2_CMD_RREG 0x20 |
#define | RTD2_CMD_WREG 0x40 |
#define | RTD2_CMD_SYSOCAL 0x60 |
#define | RTD2_CMD_SYSGCAL 0x61 |
#define | RTD2_CMD_SELFOCAL 0x62 |
#define | RTD2_RW_DUMMY 0xFF |
#define | RTD2_BCS_OFF 0x00 |
#define | RTD2_BCS_500 0x40 |
#define | RTD2_BCS_2 0x80 |
#define | RTD2_BCS_10 0xC0 |
#define | RTD2_AINP0 0x00 |
#define | RTD2_AINP1 0x08 |
#define | RTD2_AINP2 0x10 |
#define | RTD2_AINP3 0x18 |
#define | RTD2_AIN_POS 0x38 |
#define | RTD2_AINN0 0x00 |
#define | RTD2_AINN1 0x01 |
#define | RTD2_AINN2 0x02 |
#define | RTD2_AINN3 0x03 |
#define | RTD2_AIN_NEG 0x07 |
#define | RTD2_VBIAS_OFF 0x00 |
#define | RTD2_VBIAS0 0x01 |
#define | RTD2_VBIAS1 0x02 |
#define | RTD2_VBIAS2 0x04 |
#define | RTD2_VBIAS3 0x08 |
#define | RTD2_INT_VREF_OFF 0x00 |
#define | RTD2_INT_VREF_ON 0x20 |
#define | RTD2_INT_VREF_CONV 0x40 |
#define | RTD2_REF0 0x00 |
#define | RTD2_INT 0x10 |
#define | RTD2_INT_REF0 0x18 |
#define | RTD2_MEAS_NORM 0x00 |
#define | RTD2_MEAS_OFFSET 0x01 |
#define | RTD2_MEAS_GAIN 0x02 |
#define | RTD2_MEAS_TEMP 0x03 |
#define | RTD2_MEAS_REF0 0x05 |
#define | RTD2_MEAS_AVDD 0x06 |
#define | RTD2_MEAS_DVDD 0x07 |
#define | RTD2_GAIN_1 0x00 |
#define | RTD2_GAIN_2 0x10 |
#define | RTD2_GAIN_4 0x20 |
#define | RTD2_GAIN_8 0x30 |
#define | RTD2_GAIN_16 0x40 |
#define | RTD2_GAIN_32 0x50 |
#define | RTD2_GAIN_64 0x60 |
#define | RTD2_GAIN_128 0x70 |
#define | RTD2_DR_5 0x00 |
#define | RTD2_DR_10 0x01 |
#define | RTD2_DR_20 0x02 |
#define | RTD2_DR_40 0x03 |
#define | RTD2_DR_80 0x04 |
#define | RTD2_DR_160 0x05 |
#define | RTD2_DR_320 0x06 |
#define | RTD2_DR_640 0x07 |
#define | RTD2_DR_1000 0x08 |
#define | RTD2_DR_2000 0x0F |
#define | RTD2_IDAC_ID 0x90 |
#define | RTD2_DRDY_OFF 0x00 |
#define | RTD2_DRDY_ON 0x08 |
#define | RTD2_IDAC_OFF 0x00 |
#define | RTD2_IDAC_50 0x01 |
#define | RTD2_IDAC_100 0x02 |
#define | RTD2_IDAC_250 0x03 |
#define | RTD2_IDAC_500 0x04 |
#define | RTD2_IDAC_750 0x05 |
#define | RTD2_IDAC_1000 0x06 |
#define | RTD2_IDAC_1500 0x07 |
#define | RTD2_IDAC1_A0 0xCC |
#define | RTD2_IDAC1_A1 0xDC |
#define | RTD2_IDAC1_A2 0xEC |
#define | RTD2_IDAC1_A3 0xFC |
#define | RTD2_IDAC2_A0 0xCC |
#define | RTD2_IDAC2_A1 0xCD |
#define | RTD2_IDAC2_A2 0xCE |
#define | RTD2_IDAC2_A3 0xCF |
#define | RTD2_GPIO_0 0x01 |
#define | RTD2_GPIO_1 0x02 |
#define | RTD2_GPIO_2 0x04 |
#define | RTD2_GPIO_3 0x08 |
#define | RTD2_IO_0 0x01 |
#define | RTD2_IO_1 0x02 |
#define | RTD2_IO_2 0x04 |
#define | RTD2_IO_3 0x08 |
#define | RTD2_OUT_0 0x01 |
#define | RTD2_OUT_1 0x02 |
#define | RTD2_OUT_2 0x04 |
#define | RTD2_OUT_3 0x08 |
#define | RTD2_PIN_LOW 0x00 |
#define | RTD2_PIN_HIGH 0x01 |
#define | RTD2_ERROR 0x00 |
#define | RTD2_SUCCESS 0x01 |
#define | RTD2_START_CONVERSION_DISABLE 0x00 |
#define | RTD2_START_CONVERSION_ENABLE 0x01 |
#define | RTD2_NEW_DATA_IS_NOT_READY 0x00 |
#define | RTD2_NEW_DATA_IS_READY 0x01 |
#define | COEFF_PT100_RESISTANCE_OHMS_0_C 100.00000000 |
#define | COEFF_ALPHA 0.3920000000 |
#define | COEFF_ADC_RES_RT_P 0.0000753846 |
#define | COEFF_ADC_COR_FACT 50.980300000 |
Functions | |
void | rtd2_cfg_setup (rtd2_cfg_t *cfg) |
Config Object Initialization function. | |
err_t | rtd2_init (rtd2_t *ctx, rtd2_cfg_t *cfg) |
Initialization function. | |
void | rtd2_default_cfg (rtd2_t *ctx) |
Set default configuration function. | |
void | rtd2_hw_reset (rtd2_t *ctx) |
Hardware reset function. | |
void | rtd2_toggle_cs (rtd2_t *ctx, uint8_t cs_state) |
Toggle CS pin function. | |
void | rtd2_enable_start (rtd2_t *ctx, uint8_t en_start) |
Enable conversion start function. | |
uint8_t | rtd2_check_interupt (rtd2_t *ctx) |
Check interrupt status function. | |
void | rtd2_send_cmd (rtd2_t *ctx, uint8_t cmd) |
Send command function. | |
void | rtd2_set_wakeup (rtd2_t *ctx) |
Set wakeup function. | |
void | rtd2_set_sleep (rtd2_t *ctx) |
Set to sleep function. | |
void | rtd2_set_sync (rtd2_t *ctx) |
Set sync function. | |
void | rtd2_set_reset (rtd2_t *ctx) |
Set reset function. | |
void | rtd2_set_read_data_once (rtd2_t *ctx) |
Set read data once function. | |
void | rtd2_set_read_data_continuous (rtd2_t *ctx) |
Set read data continuous function. | |
void | rtd2_set_stop_data (rtd2_t *ctx) |
Set stop data function. | |
void | rtd2_write_continuous (rtd2_t *ctx, uint8_t reg, uint8_t *p_tx_data, uint8_t n_bytes) |
Continuous write the data function. | |
void | rtd2_read_continuous (rtd2_t *ctx, uint8_t reg, uint8_t *p_rx_data, uint8_t n_bytes) |
Continuous read the data function. | |
void | rtd2_write_reg (rtd2_t *ctx, uint8_t reg, uint8_t tx_data) |
Write the register function. | |
uint8_t | rtd2_read_reg (rtd2_t *ctx, uint8_t reg) |
Read the register function. | |
uint8_t | rtd2_set_burn_out_source (rtd2_t *ctx, uint8_t burn_out) |
Set burn out source function. | |
void | rtd2_set_mux_sel (rtd2_t *ctx, uint8_t adc_pos, uint8_t adc_neg) |
Set multiplexer selection function. | |
uint8_t | rtd2_set_bias (rtd2_t *ctx, uint8_t bias) |
Set bias function. | |
uint8_t | rtd2_set_int_ref (rtd2_t *ctx, uint8_t s_ref) |
Set int ref function. | |
void | rtd2_set_system_monitor (rtd2_t *ctx, uint8_t sys_mon) |
Set system monitor function. | |
void | rtd2_set_system_control (rtd2_t *ctx, uint8_t gain, uint8_t output_rate) |
Set system control function. | |
void | rtd2_set_idac_current_mag (rtd2_t *ctx, uint8_t c_idac) |
Set IDAC current magnitude function. | |
void | rtd2_set_idac_current_out (rtd2_t *ctx, uint8_t c_out_1, uint8_t c_out_2) |
Set IDAC current out function. | |
uint8_t | rtd2_check_new_data_ready (rtd2_t *ctx) |
Check new data ready function. | |
int32_t | rtd2_read_output_data (rtd2_t *ctx) |
Read output data function. | |
float | rtd2_calc_temperature (int32_t adc_val) |
Calculate temperature function. | |
float | rtd2_get_temperature (rtd2_t *ctx) |
Get temperature function. | |
This file contains API for RTD 2 Click driver.