LCDDriver_NXP_Arduino 0.7.6
Analog Front-End (AFE) device operation sample code for Arduino
|
#include <AFE_NXP.h>
Public Types | |
using | raw_t = int32_t |
using | microvolt_t = double |
Public Member Functions | |
AFE_base (int nINT, int DRDY, int SYN, int nRESET) | |
virtual | ~AFE_base () |
virtual void | begin (void) |
virtual void | boot (void)=0 |
virtual void | reset (bool hardware_reset=false)=0 |
virtual void | logical_ch_config (int ch, uint16_t cc0, uint16_t cc1, uint16_t cc2, uint16_t cc3)=0 |
virtual void | logical_ch_config (int ch, const uint16_t(&cc)[4])=0 |
virtual void | logical_ch_disable (int ch)=0 |
virtual int32_t | adc_read (int ch)=0 |
template<class T> | |
T | read (int ch, float delay=default_delay) |
virtual void | start (int ch)=0 |
template<> | |
int32_t | read (int ch, float delay) |
template<> | |
double | read (int ch, float delay) |
![]() | |
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) |
Public Attributes | |
int | enabled_channels |
double | coeff_uV [16] |
double | ch_delay [16] |
Static Public Attributes | |
static constexpr float | immidiate_read = -1.0 |
static constexpr float | default_delay = INFINITY |
static double | delay_accuracy = 1.1 |
Protected Member Functions | |
int | bit_count (uint32_t value) |
Protected Attributes | |
int | pin_nINT |
int | pin_DRDY |
int | pin_SYN |
int | pin_nRESET |
Private Member Functions | |
void | start_and_delay (int ch, float delay) |
NXP Analog Front End class library for Arduino
Copyright: 2023 - 2024 Tedd OKANO Released under the MIT license
A simple class library for NXP Analog Front End: NAFE13388 evaluation boards
using AFE_base::microvolt_t = double |
using AFE_base::raw_t = int32_t |
AFE_base::AFE_base | ( | int | nINT, |
int | DRDY, | ||
int | SYN, | ||
int | nRESET ) |
Constructor to create a AFE_base instance
Definition at line 16 of file AFE_NXP.cpp.
Referenced by NAFE13388_Base::NAFE13388_Base().
|
virtual |
Destractor
Definition at line 31 of file AFE_NXP.cpp.
|
pure virtual |
ADC channel read
ch | logical channel number (0 ~ 15) |
Implemented in NAFE13388_Base.
Referenced by read().
|
virtual |
Begin the device operation
NAFE13388 initialization. It does following steps (1) Call reset() (2) Call boot()
Definition at line 35 of file AFE_NXP.cpp.
|
protected |
Definition at line 66 of file AFE_NXP.cpp.
Referenced by NAFE13388_Base::logical_ch_config(), and NAFE13388_Base::logical_ch_disable().
|
pure virtual |
|
pure virtual |
Configure logical channel
ch | logical channel number (0 ~ 15) |
cc | array for CH_CONFIG0, CH_CONFIG1, CH_CONFIG2 and CH_CONFIG3 values |
Implemented in NAFE13388_Base.
|
pure virtual |
Configure logical channel
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) |
Implemented in NAFE13388_Base.
|
pure virtual |
int32_t AFE_base::read | ( | int | ch, |
float | delay ) |
Definition at line 42 of file AFE_NXP.cpp.
double AFE_base::read | ( | int | ch, |
float | delay ) |
Definition at line 52 of file AFE_NXP.cpp.
T AFE_base::read | ( | int | ch, |
float | delay = default_delay ) |
Read ADC Performs ADC read. If the delay is not given, just the ADC register is read. If the delay is given, measurement is started in this method and read-out after delay. The delay between start and read-out is specified in seconds.
This method need to be called with return type as double value = read<NAFE13388::microvolt_t>( 0, 0.01 ); int32_t value = read<NAFE13388::raw_t>( 0, 0.01 );
ch | logical channel number (0 ~ 15) |
delay | ADC result read-out delay after measurement start if given |
Referenced by read(), and NAFE13388_Base::recalibrate().
|
pure virtual |
|
pure virtual |
Start ADC
ch | logical channel number (0 ~ 15) |
Implemented in NAFE13388_Base.
Referenced by start_and_delay().
|
private |
Definition at line 57 of file AFE_NXP.cpp.
Referenced by read().
double AFE_base::ch_delay[16] |
Channel delay
Definition at line 106 of file AFE_NXP.h.
Referenced by NAFE13388_Base::calc_delay(), NAFE13388_Base::logical_ch_config(), and read().
double AFE_base::coeff_uV[16] |
Coefficient to convert from ADC read value to micro-volt
Definition at line 103 of file AFE_NXP.h.
Referenced by NAFE13388_Base::logical_ch_config(), and read().
|
staticconstexpr |
|
static |
int AFE_base::enabled_channels |
Number of enabled logical channels
Definition at line 100 of file AFE_NXP.h.
Referenced by AFE_base(), NAFE13388_Base::logical_ch_config(), and NAFE13388_Base::logical_ch_disable().
|
protected |
Definition at line 116 of file AFE_NXP.h.
Referenced by AFE_base().
|
protected |
Definition at line 115 of file AFE_NXP.h.
Referenced by AFE_base().
|
protected |
Definition at line 118 of file AFE_NXP.h.
Referenced by AFE_base(), and NAFE13388_Base::reset().
|
protected |
Definition at line 117 of file AFE_NXP.h.
Referenced by AFE_base().