AFE_NXP_Arduino 1.0.3 Analog Front-End (AFE) device operation sample code for Arduino

Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | List of all members
NAFE13388_Base Class Reference

`#include <AFE_NXP.h>`

Inheritance diagram for NAFE13388_Base:

## Classes
struct | _reference_point
struct | _ref_points
class | LogicalChannel

## Public Types
enum | GainPGA : uint8_t { G_PGA_x_0_2 = 0 , G_PGA_x_0_4 , G_PGA_x_0_8 , G_PGA_x_1_0 , G_PGA_x_2_0 , G_PGA_x_4_0 , G_PGA_x_8_0 , G_PGA_x16_0 }
enum class | Register16 : uint16_t { CH_CONFIG0 = 0x20 , CH_CONFIG1 = 0x21 , CH_CONFIG2 = 0x22 , CH_CONFIG3 = 0x23 , CH_CONFIG4 = 0x24 , CRC_CONF_REGS = 0x25 , CRC_COEF_REGS = 0x26 , CRC_TRIM_REGS = 0x27 , GPI_DATA = 0x29 , GPIO_CONFIG0 = 0x2A , GPIO_CONFIG1 = 0x2B , GPIO_CONFIG2 = 0x2C , GPI_EDGE_POS = 0x2D , GPI_EDGE_NEG = 0x2E , GPO_DATA = 0x2F , SYS_CONFIG0 = 0x30 , SYS_STATUS0 = 0x31 , GLOBAL_ALARM_ENABLE = 0x32 , GLOBAL_ALARM_INTERRUPT = 0x33 , DIE_TEMP = 0x34 , CH_STATUS0 = 0x35 , CH_STATUS1 = 0x36 , THRS_TEMP = 0x37 , PN2 = 0x7C , PN1 = 0x7D , PN0 = 0x7E , CRC_TRIM_INT = 0x7F }
enum class | Register24 : uint16_t { CH_DATA0 = 0x40 , CH_DATA1 = 0x41 , CH_DATA2 = 0x42 , CH_DATA3 = 0x43 , CH_DATA4 = 0x44 , CH_DATA5 = 0x45 , CH_DATA6 = 0x46 , CH_DATA7 = 0x47 , CH_DATA8 = 0x48 , CH_DATA9 = 0x4A , CH_DATA10 = 0x4B , CH_DATA11 = 0x4C , CH_DATA13 = 0x4D , CH_DATA14 = 0x4E , CH_DATA15 = 0x4F , CH_CONFIG5_0 = 0x50 , CH_CONFIG5_1 = 0x51 , CH_CONFIG5_2 = 0x52 , CH_CONFIG5_3 = 0x53 , CH_CONFIG5_4 = 0x54 , CH_CONFIG5_5 = 0x55 , CH_CONFIG5_6 = 0x56 , CH_CONFIG5_7 = 0x57 , CH_CONFIG5_8 = 0x58 , CH_CONFIG5_9 = 0x59 , CH_CONFIG5_10 = 0x5A , CH_CONFIG5_11 = 0x5B , CH_CONFIG5_12 = 0x5C , CH_CONFIG5_13 = 0x5D , CH_CONFIG5_14 = 0x5E , CH_CONFIG5_15 = 0x5F , CH_CONFIG6_0 = 0x60 , CH_CONFIG6_1 = 0x61 , CH_CONFIG6_2 = 0x62 , CH_CONFIG6_3 = 0x63 , CH_CONFIG6_4 = 0x64 , CH_CONFIG6_5 = 0x65 , CH_CONFIG6_6 = 0x66 , CH_CONFIG6_7 = 0x67 , CH_CONFIG6_8 = 0x68 , CH_CONFIG6_9 = 0x69 , CH_CONFIG6_10 = 0x6A , CH_CONFIG6_11 = 0x6B , CH_CONFIG6_12 = 0x6C , CH_CONFIG6_13 = 0x6D , CH_CONFIG6_14 = 0x6E , CH_CONFIG6_15 = 0x6F , GAIN_COEFF0 = 0x80 , GAIN_COEFF1 = 0x81 , GAIN_COEFF2 = 0x82 , GAIN_COEFF3 = 0x83 , GAIN_COEFF4 = 0x84 , GAIN_COEFF5 = 0x85 , GAIN_COEFF6 = 0x86 , GAIN_COEFF7 = 0x87 , GAIN_COEFF8 = 0x88 , GAIN_COEFF9 = 0x89 , GAIN_COEFF10 = 0x8A , GAIN_COEFF11 = 0x8B , GAIN_COEFF12 = 0x8C , GAIN_COEFF13 = 0x8D , GAIN_COEFF14 = 0x8E , GAIN_COEFF15 = 0x8F , OFFSET_COEFF0 = 0x90 , OFFSET_COEFF1 = 0x91 , OFFSET_COEFF2 = 0x92 , OFFSET_COEFF3 = 0x93 , OFFSET_COEFF4 = 0x94 , OFFSET_COEFF5 = 0x95 , OFFSET_COEFF6 = 0x96 , OFFSET_COEFF7 = 0x97 , OFFSET_COEFF8 = 0x98 , OFFSET_COEFF9 = 0x99 , OFFSET_COEFF10 = 0x9A , OFFSET_COEFF11 = 0x9B , OFFSET_COEFF12 = 0x9C , OFFSET_COEFF13 = 0x9D , OFFSET_COEFF14 = 0x9E , OFFSET_COEFF15 = 0x9F , OPT_COEF0 = 0xA0 , OPT_COEF1 = 0xA1 , OPT_COEF2 = 0xA2 , OPT_COEF3 = 0xA3 , OPT_COEF4 = 0xA4 , OPT_COEF5 = 0xA5 , OPT_COEF6 = 0xA6 , OPT_COEF7 = 0xA7 , OPT_COEF8 = 0xA8 , OPT_COEF9 = 0xA9 , OPT_COEF10 = 0xAA , OPT_COEF11 = 0xAB , OPT_COEF12 = 0xAC , OPT_COEF13 = 0xAD , SERIAL1 = 0xAE , SERIAL0 = 0xAF }
enum | Command : uint16_t { CMD_CH0 = 0x0000 , CMD_CH1 = 0x0001 , CMD_CH2 = 0x0002 , CMD_CH3 = 0x0003 , CMD_CH4 = 0x0004 , CMD_CH5 = 0x0005 , CMD_CH6 = 0x0006 , CMD_CH7 = 0x0007 , CMD_CH8 = 0x0008 , CMD_CH9 = 0x0009 , CMD_CH10 = 0x000A , CMD_CH11 = 0x000B , CMD_CH12 = 0x000C , CMD_CH13 = 0x000D , CMD_CH14 = 0x000E , CMD_CH15 = 0x000F , CMD_ABORT = 0x0010 , CMD_END = 0x0011 , CMD_CLEAR_ALARM = 0x0012 , CMD_CLEAR_DATA = 0x0013 , CMD_RESET = 0x0014 , CMD_CLEAR_REG = 0x0015 , CMD_RELOAD = 0x0016 , TBD = 0x0017 , CMD_SS = 0x2000 , CMD_SC = 0x2001 , CMD_MM = 0x2002 , CMD_MC = 0x2003 , CMD_MS = 0x2004 , CMD_BURST_DATA = 0x2005 , CMD_CALC_CRC_CONFG = 0x2006 , CMD_CALC_CRC_COEF = 0x2007 , CMD_CALC_CRC_FAC = 0x2008 }
enum | CalibrationError : int { NoError = 0 , GainError = -1 , OffsetError = -2 }
using | ch_setting_t = uint16_t[ 4 ]
typedef struct NAFE13388_Base::_reference_point | reference_point
typedef struct NAFE13388_Base::_ref_points | ref_points
Public Types inherited from AFE_base
enum | LV_mux_sel : uint8_t { REF2_REF2 = 0 , GPIO0_GPIO1 , REFCOARSE_REF2 , VADD_REF2 , VHDD_REF2 , REF2_VHSS , HV_MUX }
using | raw_t = int32_t
using | microvolt_t = double
typedef void(* | callback_fp_t) (void)

## Public Member Functions
| NAFE13388_Base (bool spi_addr, bool highspeed_variant, int nINT, int DRDY, int SYN, int nRESET)
virtual | ~NAFE13388_Base ()
virtual void | boot (void)
virtual void | reset (bool hardware_reset=false)
virtual void | open_logical_channel (int ch, uint16_t cc0, uint16_t cc1, uint16_t cc2, uint16_t cc3)
virtual void | open_logical_channel (int ch, const uint16_t(&cc)[4])
virtual void | close_logical_channel (int ch)
virtual void | close_logical_channel (void)
void | enable_logical_channel (int ch)
virtual void | start (int ch)
virtual void | start (void)
virtual void | start_continuous_conversion ()
virtual void | DRDY_by_sequencer_done (bool flag=true)
virtual raw_t | read (int ch)
virtual void | read (raw_t *data)
virtual void | read (microvolt_t *data)
virtual void | command (uint16_t com)
virtual void | reg (Register16 r, uint16_t value)
virtual void | reg (Register24 r, uint32_t value)
virtual uint16_t | reg (Register16 r)
virtual uint32_t | reg (Register24 r)
template<typename T>
uint32_t | bit_op (T rg, uint32_t mask, uint32_t value)
uint32_t | part_number (void)
uint8_t | revision_number (void)
uint64_t | serial_number (void)
float | temperature (void)
void | gain_offset_coeff (const ref_points &ref)
int | self_calibrate (int pga_gain_index, int channel_selection=15, int input_select=0, double reference_source_voltage=0, bool use_positive_side=true)
void | blink_leds (void)
Public Member Functions inherited from AFE_base
| AFE_base (bool spi_addr, bool highspeed_variant, int nINT, int DRDY, int SYN, int nRESET, int DRDY_input=2)
virtual | ~AFE_base ()
virtual void | begin (void)
virtual void | set_DRDY_callback (callback_fp_t fnc)
virtual raw_t | start_and_read (int ch)
template<typename T>
void | start_and_read (T data)
double | raw2uv (int ch, raw_t value)
double | raw2mv (int ch, raw_t value)
double | raw2v (int ch, raw_t value)
double | coeff_mV (int ch)
double | drdy_delay (int ch)
double | drdy_delay (void)
int | enabled_logical_channels (void)
void | use_DRDY_trigger (bool use=true)
Public Member Functions inherited from SPI_for_AFE
void | txrx (uint8_t *data, int size)
void | write_r16 (uint16_t reg)
void | write_r16 (uint16_t reg, uint16_t val)
uint16_t | read_r16 (uint16_t reg)
void | write_r24 (uint16_t reg, uint32_t val)
int32_t | read_r24 (uint16_t reg)
void | burst (uint32_t *data, int length, int width=3)

## Public Attributes
LogicalChannel | logical_channel [16]

## Static Public Attributes
static double | pga_gain [] = { 0.2, 0.4, 0.8, 1, 2, 4, 8, 16 }
Static Public Attributes inherited from AFE_base
static AFE_base * | instance = nullptr

## Private Member Functions
double | calc_delay (int ch)
void | channel_info_update (uint16_t value)

## Additional Inherited Members
Protected Member Functions inherited from AFE_base
int | bit_count (uint32_t value)
void | default_drdy_cb ()
virtual void | init (void)
int | wait_conversion_complete (double delay=-1.0)
Static Protected Member Functions inherited from AFE_base
static void | static_default_drdy_cb ()
static void | DRDY_cb ()
Protected Attributes inherited from AFE_base
bool | dev_add
bool | highspeed_variant
int | pin_nINT
int | pin_DRDY
int | pin_SYN
int | pin_nRESET
int | pin_DRDY_input
int | enabled_channels
uint8_t | sequence_order [16]
double | coeff_uV [16]
int | mux_setting [16]
double | ch_delay [16]
double | total_delay
uint32_t | drdy_count
volatile bool | drdy_flag
Static Protected Attributes inherited from AFE_base
static double | delay_accuracy = 1.2
static constexpr uint32_t | timeout_limit = 10000000
static callback_fp_t | cbf_DRDY = nullptr

## Detailed Description

Definition at line 325 of file AFE_NXP.h.

## Member Typedef Documentation

## ◆ ch_setting_t

using NAFE13388_Base::ch_setting_t = uint16_t[ 4 ]

Definition at line 328 of file AFE_NXP.h.

## ◆ ref_points

typedef struct NAFE13388_Base::_ref_points NAFE13388_Base::ref_points

## ◆ reference_point

typedef struct NAFE13388_Base::_reference_point NAFE13388_Base::reference_point

## Member Enumeration Documentation

## ◆ CalibrationError

enum NAFE13388_Base::CalibrationError : int

Enumerator
NoError |
GainError |
OffsetError |

Definition at line 707 of file AFE_NXP.h.

## ◆ Command

enum NAFE13388_Base::Command : uint16_t

Enumerator
CMD_CH0 |
CMD_CH1 |
CMD_CH2 |
CMD_CH3 |
CMD_CH4 |
CMD_CH5 |
CMD_CH6 |
CMD_CH7 |
CMD_CH8 |
CMD_CH9 |
CMD_CH10 |
CMD_CH11 |
CMD_CH12 |
CMD_CH13 |
CMD_CH14 |
CMD_CH15 |
CMD_ABORT |
CMD_END |
CMD_CLEAR_ALARM |
CMD_CLEAR_DATA |
CMD_RESET |
CMD_CLEAR_REG |
CMD_RELOAD |
TBD |
CMD_SS |
CMD_SC |
CMD_MM |
CMD_MC |
CMD_MS |
CMD_BURST_DATA |
CMD_CALC_CRC_CONFG |
CMD_CALC_CRC_COEF |
CMD_CALC_CRC_FAC |

Definition at line 584 of file AFE_NXP.h.

## ◆ GainPGA

enum NAFE13388_Base::GainPGA : uint8_t

Enumerator
G_PGA_x_0_2 |
G_PGA_x_0_4 |
G_PGA_x_0_8 |
G_PGA_x_1_0 |
G_PGA_x_2_0 |
G_PGA_x_4_0 |
G_PGA_x_8_0 |
G_PGA_x16_0 |

Definition at line 445 of file AFE_NXP.h.

## ◆ Register16

enum class NAFE13388_Base::Register16 : uint16_t
| strong

Enumerator
CH_CONFIG0 |
CH_CONFIG1 |
CH_CONFIG2 |
CH_CONFIG3 |
CH_CONFIG4 |
CRC_CONF_REGS |
CRC_COEF_REGS |
CRC_TRIM_REGS |
GPI_DATA |
GPIO_CONFIG0 |
GPIO_CONFIG1 |
GPIO_CONFIG2 |
GPI_EDGE_POS |
GPI_EDGE_NEG |
GPO_DATA |
SYS_CONFIG0 |
SYS_STATUS0 |
GLOBAL_ALARM_ENABLE |
GLOBAL_ALARM_INTERRUPT |
DIE_TEMP |
CH_STATUS0 |
CH_STATUS1 |
THRS_TEMP |
PN2 |
PN1 |
PN0 |
CRC_TRIM_INT |

Definition at line 456 of file AFE_NXP.h.

## ◆ Register24

enum class NAFE13388_Base::Register24 : uint16_t
| strong

Enumerator
CH_DATA0 |
CH_DATA1 |
CH_DATA2 |
CH_DATA3 |
CH_DATA4 |
CH_DATA5 |
CH_DATA6 |
CH_DATA7 |
CH_DATA8 |
CH_DATA9 |
CH_DATA10 |
CH_DATA11 |
CH_DATA13 |
CH_DATA14 |
CH_DATA15 |
CH_CONFIG5_0 |
CH_CONFIG5_1 |
CH_CONFIG5_2 |
CH_CONFIG5_3 |
CH_CONFIG5_4 |
CH_CONFIG5_5 |
CH_CONFIG5_6 |
CH_CONFIG5_7 |
CH_CONFIG5_8 |
CH_CONFIG5_9 |
CH_CONFIG5_10 |
CH_CONFIG5_11 |
CH_CONFIG5_12 |
CH_CONFIG5_13 |
CH_CONFIG5_14 |
CH_CONFIG5_15 |
CH_CONFIG6_0 |
CH_CONFIG6_1 |
CH_CONFIG6_2 |
CH_CONFIG6_3 |
CH_CONFIG6_4 |
CH_CONFIG6_5 |
CH_CONFIG6_6 |
CH_CONFIG6_7 |
CH_CONFIG6_8 |
CH_CONFIG6_9 |
CH_CONFIG6_10 |
CH_CONFIG6_11 |
CH_CONFIG6_12 |
CH_CONFIG6_13 |
CH_CONFIG6_14 |
CH_CONFIG6_15 |
GAIN_COEFF0 |
GAIN_COEFF1 |
GAIN_COEFF2 |
GAIN_COEFF3 |
GAIN_COEFF4 |
GAIN_COEFF5 |
GAIN_COEFF6 |
GAIN_COEFF7 |
GAIN_COEFF8 |
GAIN_COEFF9 |
GAIN_COEFF10 |
GAIN_COEFF11 |
GAIN_COEFF12 |
GAIN_COEFF13 |
GAIN_COEFF14 |
GAIN_COEFF15 |
OFFSET_COEFF0 |
OFFSET_COEFF1 |
OFFSET_COEFF2 |
OFFSET_COEFF3 |
OFFSET_COEFF4 |
OFFSET_COEFF5 |
OFFSET_COEFF6 |
OFFSET_COEFF7 |
OFFSET_COEFF8 |
OFFSET_COEFF9 |
OFFSET_COEFF10 |
OFFSET_COEFF11 |
OFFSET_COEFF12 |
OFFSET_COEFF13 |
OFFSET_COEFF14 |
OFFSET_COEFF15 |
OPT_COEF0 |
OPT_COEF1 |
OPT_COEF2 |
OPT_COEF3 |
OPT_COEF4 |
OPT_COEF5 |
OPT_COEF6 |
OPT_COEF7 |
OPT_COEF8 |
OPT_COEF9 |
OPT_COEF10 |
OPT_COEF11 |
OPT_COEF12 |
OPT_COEF13 |
SERIAL1 |
SERIAL0 |

Definition at line 486 of file AFE_NXP.h.

## Constructor & Destructor Documentation

## ◆ NAFE13388_Base()

NAFE13388_Base::NAFE13388_Base | ( | bool | spi_addr,
|  | bool | highspeed_variant,
|  | int | nINT,
|  | int | DRDY,
|  | int | SYN,
|  | int | nRESET )

Constructor to create a AFE_base instance

Definition at line 202 of file AFE_NXP.cpp.

Referenced by NAFE13388::NAFE13388(), and NAFE13388_UIM::NAFE13388_UIM().

## ◆ ~NAFE13388_Base()

NAFE13388_Base::~NAFE13388_Base | ( |  | ) |
| virtual

Destractor

Definition at line 212 of file AFE_NXP.cpp.

## Member Function Documentation

## ◆ bit_op()

template<typename T>

uint32_t NAFE13388_Base::bit_op | ( | T | rg,
|  | uint32_t | mask,
|  | uint32_t | value )
| inline

Register bit operation

overwrite bits i a register

Parameters

  reg | register specified by Register16 or Register24 member
  mask | mask bits
  reg | value to over write

Definition at line 664 of file AFE_NXP.h.

Referenced by close_logical_channel(), DRDY_by_sequencer_done(), and enable_logical_channel().

## ◆ blink_leds()

void NAFE13388_Base::blink_leds | ( | void |  | ) |

Blinks LEDs on GPIO pins

Definition at line 605 of file AFE_NXP.cpp.

## ◆ boot()

void NAFE13388_Base::boot | ( | void |  | ) |
| virtual

Set system-level config registers

Implements AFE_base.

Definition at line 216 of file AFE_NXP.cpp.

## ◆ calc_delay()

double NAFE13388_Base::calc_delay | ( | int | ch | ) |
| private

Definition at line 301 of file AFE_NXP.cpp.

Referenced by open_logical_channel().

## ◆ channel_info_update()

void NAFE13388_Base::channel_info_update | ( | uint16_t | value | ) |
| private

Definition at line 276 of file AFE_NXP.cpp.

Referenced by close_logical_channel(), close_logical_channel(), and enable_logical_channel().

## ◆ close_logical_channel() [1/2]

void NAFE13388_Base::close_logical_channel | ( | int | ch | ) |
| virtual

Logical channel disable

Parameters

  ch | logical channel number (0 ~ 15)

Implements AFE_base.

Definition at line 365 of file AFE_NXP.cpp.

## ◆ close_logical_channel() [2/2]

void NAFE13388_Base::close_logical_channel | ( | void |  | ) |
| virtual

All logical channel disable

Implements AFE_base.

Definition at line 373 of file AFE_NXP.cpp.

Referenced by self_calibrate().

## ◆ command()

void NAFE13388_Base::command | ( | uint16_t | com | ) |
| virtual

Command

Parameters

  com | "Comand" type or uint16_t value

Definition at line 420 of file AFE_NXP.cpp.

Referenced by boot(), calc_delay(), open_logical_channel(), reset(), self_calibrate(), start(), start(), and start_continuous_conversion().

## ◆ DRDY_by_sequencer_done()

void NAFE13388_Base::DRDY_by_sequencer_done | ( | bool | flag = true | ) |
| virtual

DRDY event select

Parameters

  set | true for DRDY by sequencer is done

Implements AFE_base.

Definition at line 395 of file AFE_NXP.cpp.

Referenced by boot().

## ◆ enable_logical_channel()

void NAFE13388_Base::enable_logical_channel | ( | int | ch | ) |
| virtual

Logical channel enable

Parameters

  ch | logical channel number (0 ~ 15)

Implements AFE_base.

Definition at line 357 of file AFE_NXP.cpp.

Referenced by open_logical_channel().

## ◆ gain_offset_coeff()

void NAFE13388_Base::gain_offset_coeff | ( | const ref_points & | ref | ) |

Gain and offset coefficient customization

Sets gain and offset coefficients with given target ADC read-out values at two reference voltaeg points

Parameters

  ref | struct to define the target coefficient index and two reference poins and reference pre-calibrated coeffs

Definition at line 469 of file AFE_NXP.cpp.

## ◆ open_logical_channel() [1/2]

void NAFE13388_Base::open_logical_channel | ( | int | ch,
|  | const uint16_t(&) | cc[4] )
| virtual

Configure logical channel

Parameters

  ch | logical channel number (0 ~ 15)
  cc | array for CH_CONFIG0, CH_CONFIG1, CH_CONFIG2 and CH_CONFIG3 values

Implements AFE_base.

Definition at line 253 of file AFE_NXP.cpp.

## ◆ open_logical_channel() [2/2]

void NAFE13388_Base::open_logical_channel | ( | int | ch,
|  | uint16_t | cc0,
|  | uint16_t | cc1,
|  | uint16_t | cc2,
|  | uint16_t | cc3 )
| virtual

Configure logical channel

Parameters

  ch | logical channel number (0 ~ 15)
  cc0 | 16bit value to be set CH_CONFIG0 register (0x20)
  cc1 | 16bit value to be set CH_CONFIG1 register (0x21)
  cc2 | 16bit value to be set CH_CONFIG2 register (0x22)
  cc3 | 16bit value to be set CH_CONFIG3 register (0x23)

Implements AFE_base.

Definition at line 351 of file AFE_NXP.cpp.

Referenced by open_logical_channel(), and self_calibrate().

## ◆ part_number()

uint32_t NAFE13388_Base::part_number | ( | void |  | ) |

Read part_number

Returns
  0x13388B40

Definition at line 445 of file AFE_NXP.cpp.

## ◆ read() [1/3]

int32_t NAFE13388_Base::read | ( | int | ch | ) |
| virtual

Read ADC for single channel

Parameters

  ch | logical channel number (0 ~ 15)

Implements AFE_base.

Definition at line 400 of file AFE_NXP.cpp.

Referenced by read().

## ◆ read() [2/3]

void NAFE13388_Base::read | ( | microvolt_t * | data | ) |
| virtual

Read ADC for all channel

Parameters

  data_ptr | pointer to array to store ADC data

Implements AFE_base.

Definition at line 410 of file AFE_NXP.cpp.

## ◆ read() [3/3]

void NAFE13388_Base::read | ( | raw_t * | data | ) |
| virtual

Read ADC for all channel

Parameters

  data_ptr | pointer to array to store ADC data

Implements AFE_base.

Definition at line 405 of file AFE_NXP.cpp.

## ◆ reg() [1/4]

uint16_t NAFE13388_Base::reg | ( | Register16 | r | ) |
| virtual

Read register

Reads register. Register width is selected by reg type (Register16 ot Register24)

Parameters

  reg | register specified by Register16 member

Returns
  readout value

Definition at line 435 of file AFE_NXP.cpp.

## ◆ reg() [2/4]

void NAFE13388_Base::reg | ( | Register16 | r,
|  | uint16_t | value )
| virtual

Write register

Writes register. Register width is selected by reg type (Register16 ot Register24)

Parameters

  reg | register specified by Register16 member

Definition at line 425 of file AFE_NXP.cpp.

Referenced by bit_op(), NAFE13388_UIM::blink_leds(), calc_delay(), close_logical_channel(), gain_offset_coeff(), open_logical_channel(), part_number(), read(), reset(), revision_number(), self_calibrate(), serial_number(), and temperature().

## ◆ reg() [3/4]

uint32_t NAFE13388_Base::reg | ( | Register24 | r | ) |
| virtual

Read register

Reads register. Register width is selected by reg type (Register16 ot Register24)

Parameters

  reg | register specified by Register24 member

Returns
  readout value

Definition at line 440 of file AFE_NXP.cpp.

## ◆ reg() [4/4]

void NAFE13388_Base::reg | ( | Register24 | r,
|  | uint32_t | value )
| virtual

Write register

Writes register. Register width is selected by reg type (Register16 ot Register24)

Parameters

  reg | register specified by Register24 member

Definition at line 430 of file AFE_NXP.cpp.

## ◆ reset()

void NAFE13388_Base::reset | ( | bool | hardware_reset = false | ) |
| virtual

Issue RESET command

Implements AFE_base.

Definition at line 224 of file AFE_NXP.cpp.

## ◆ revision_number()

uint8_t NAFE13388_Base::revision_number | ( | void |  | ) |

Read rivision number

Returns
  PN0 register value & 0xF

Definition at line 450 of file AFE_NXP.cpp.

## ◆ self_calibrate()

int NAFE13388_Base::self_calibrate | ( | int | pga_gain_index,
|  | int | channel_selection = 15,
|  | int | input_select = 0,
|  | double | reference_source_voltage = 0,
|  | bool | use_positive_side = true )

On-board calibration with specified input and voltage

Updates coefficients at pga_gain_index

Parameters

  pga_gain_index | PGA gain index to measure and update the coefficients
  channel_selection | Logical channel number for calibration use
  reference_source_voltage | Reference voltage. This is not required if internal reference is used
  input_select | Physical input channel selection. It will use internal voltage reference if this value is 0
  use_positive_side | Physical input channel selection AnP or AnN

Returns
  CalibrationError Error code

Definition at line 501 of file AFE_NXP.cpp.

## ◆ serial_number()

uint64_t NAFE13388_Base::serial_number | ( | void |  | ) |

Read serial number

Returns
  serial number

Definition at line 455 of file AFE_NXP.cpp.

Referenced by serial_number().

## ◆ start() [1/2]

void NAFE13388_Base::start | ( | int | ch | ) |
| virtual

Start ADC

Parameters

  ch | logical channel number (0 ~ 15)

Implements AFE_base.

Definition at line 379 of file AFE_NXP.cpp.

## ◆ start() [2/2]

void NAFE13388_Base::start | ( | void |  | ) |
| virtual

Start ADC on all logical channel

Implements AFE_base.

Definition at line 385 of file AFE_NXP.cpp.

## ◆ start_continuous_conversion()

void NAFE13388_Base::start_continuous_conversion | ( | void |  | ) |
| virtual

Start continuous AD conversion

Implements AFE_base.

Definition at line 390 of file AFE_NXP.cpp.

## ◆ temperature()

float NAFE13388_Base::temperature | ( | void |  | ) |

Die temperature

Returns
  die temperature in celsius

Definition at line 464 of file AFE_NXP.cpp.

## Member Data Documentation

## ◆ logical_channel

LogicalChannel NAFE13388_Base::logical_channel[16]

Definition at line 381 of file AFE_NXP.h.

Referenced by NAFE13388_Base().

## ◆ pga_gain

double NAFE13388_Base::pga_gain = { 0.2, 0.4, 0.8, 1, 2, 4, 8, 16 }
| static

Definition at line 664 of file AFE_NXP.h.

Referenced by open_logical_channel(), and self_calibrate().

The documentation for this class was generated from the following files:

- AFE_NXP.h
- AFE_NXP.cpp