|
AFE_NXP_Arduino 2.0.4
Analog Front-End (AFE) device operation sample code for Arduino
|
#include <SPI_for_AFE.h>
Public Member Functions | |
| virtual void | txrx (uint8_t *data, int size) |
| virtual void | write_r16 (uint16_t reg) |
| virtual void | write_r16 (uint16_t reg, uint16_t val) |
| virtual uint16_t | read_r16 (uint16_t reg) |
| virtual void | write_r24 (uint16_t reg, uint32_t val) |
| virtual int32_t | read_r24 (uint16_t reg) |
| virtual void | burst (uint32_t *data, int length, int width=3) |
| virtual void | spi_frequency (uint32_t frequency=1 '000 '000) |
Protected Member Functions | |
| void | init (void) |
Protected Attributes | |
| uint32_t | frequency |
Private Member Functions | |
| int32_t | get_data16 (uint8_t *vp) |
| int32_t | get_data24 (uint8_t *vp) |
Static Private Attributes | |
| static constexpr int | command_length = 2 |
NXP Analog Front End class library for Arduino
Copyright: 2023 Tedd OKANO Released under the MIT license
A SPI interface class for NXP Analog Front End: NAFE13388
Definition at line 22 of file SPI_for_AFE.h.
|
virtual |
Burst read of consecutive channel results
| data | pointer to buffer to store results |
| length | number of words to read |
| width | word width in bytes (default: 3 for 24-bit) |
Definition at line 59 of file SPI_for_AFE.cpp.
Referenced by NAFE13388_Base::read(), and NAFE33352_Base::read().
|
inlineprivate |
Definition at line 87 of file SPI_for_AFE.h.
Referenced by read_r16().
|
inlineprivate |
Definition at line 92 of file SPI_for_AFE.h.
Referenced by burst(), and read_r24().
|
protected |
Initialize SPI peripheral and chip-select pin
Definition at line 78 of file SPI_for_AFE.cpp.
Referenced by AFE_base::begin().
|
virtual |
Register read, 16 bit
| reg | register index |
Definition at line 29 of file SPI_for_AFE.cpp.
Referenced by NAFE13388_Base::reg(), and NAFE33352_Base::reg().
|
virtual |
Register read, 24 bit
| reg | register index |
Definition at line 48 of file SPI_for_AFE.cpp.
Referenced by NAFE13388_Base::reg(), and NAFE33352_Base::reg().
|
virtual |
Set SPI clock frequency
| frequency | SPI clock in Hz (default: 1 MHz) |
Definition at line 73 of file SPI_for_AFE.cpp.
Referenced by init().
|
virtual |
Send data
| data | pointer to data buffer |
| size | data size |
Definition at line 3 of file SPI_for_AFE.cpp.
Referenced by burst(), read_r16(), read_r24(), write_r16(), write_r16(), and write_r24().
|
virtual |
Command write (register address only, no data)
| reg | register/command index |
Definition at line 13 of file SPI_for_AFE.cpp.
Referenced by NAFE13388_Base::command(), NAFE33352_Base::command(), NAFE13388_Base::reg(), and NAFE33352_Base::reg().
|
virtual |
Register write, 16 bit
| reg | register index |
| val | data value |
Definition at line 21 of file SPI_for_AFE.cpp.
|
virtual |
Register write, 24 bit
| reg | register index |
| val | data value |
Reimplemented in NAFE33352_Base.
Definition at line 40 of file SPI_for_AFE.cpp.
Referenced by NAFE13388_Base::reg().
|
staticconstexprprivate |
Definition at line 102 of file SPI_for_AFE.h.
Referenced by burst(), read_r16(), and read_r24().
|
protected |
Definition at line 83 of file SPI_for_AFE.h.
Referenced by spi_frequency(), NAFE33352_Base::txrx(), and txrx().