Skip to content

Commit 1d600f7

Browse files
committed
projects: eval-adhv4710: Add adhv4711 support
- Add ADHV4710_DEV_ID macro (default ID_ADHV4710) in common_data.h and set adhv4710_ip.id from it in main.c. - Add README.rst documenting both boards, the variant-selection mechanism and the Maxim build commands. ID_ADHV4710 is enum value 0, so zero-initialized init params default to the ADHV4710 variant and existing callers are unaffected. Signed-off-by: Radu Etz <radu.etz@analog.com>
1 parent 6099435 commit 1d600f7

3 files changed

Lines changed: 138 additions & 0 deletions

File tree

projects/eval-adhv4710/README.rst

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
EVAL-ADHV4710 no-OS Example Project
2+
===================================
3+
4+
.. no-os-doxygen::
5+
6+
.. contents:: Table of Contents
7+
:depth: 3
8+
9+
Supported Evaluation Boards
10+
----------------------------
11+
12+
* `EVAL-ADHV4710 <https://www.analog.com/ADHV4710>`_
13+
* `EVAL-ADHV4711 <https://www.analog.com/ADHV4711>`_
14+
15+
Overview
16+
--------
17+
18+
The ADHV4710 and ADHV4711 are high voltage, high precision amplifiers
19+
controlled over an SPI interface. The two parts are variants of the same
20+
device and share the same register map and control logic; they differ
21+
only in the value reported by the product-version (chip-id) register
22+
(``CTRL_REG_26``): ``0x46`` for the ADHV4710 and ``0x47`` for the
23+
ADHV4711. A single no-OS driver (``drivers/amplifiers/adhv4710``)
24+
supports both variants, selected at initialization time.
25+
26+
The firmware initializes the amplifier, configures its overcurrent
27+
(source and sink), overvoltage (positive and negative) and
28+
overtemperature protection limits, and then periodically polls the alarm
29+
status register, reporting any triggered protection over UART and
30+
re-enabling the amplifier from a latched shutdown.
31+
32+
Applications
33+
------------
34+
35+
* High voltage signal conditioning
36+
* Piezoelectric transducer and MEMS driving
37+
* Programmable power supplies
38+
* Automated test equipment (ATE)
39+
40+
Selecting the Device Variant
41+
----------------------------
42+
43+
The driver distinguishes the two parts through the ``id`` field of
44+
``struct adhv4710_init_param``, using ``enum adhv4710_type``:
45+
46+
.. code-block:: c
47+
48+
enum adhv4710_type {
49+
ID_ADHV4710,
50+
ID_ADHV4711,
51+
};
52+
53+
At initialization the driver reads ``CTRL_REG_26`` and validates it
54+
against the expected product-version value for the selected variant
55+
(returning ``-ENXIO`` on mismatch). The variant used by the example is
56+
controlled by the ``ADHV4710_DEV_ID`` macro in the
57+
`Project Common Data Path <https://github.com/analogdevicesinc/no-OS/tree/main/projects/eval-adhv4710/src/common>`__:
58+
59+
.. code-block:: c
60+
61+
/* Device variant: ID_ADHV4710 or ID_ADHV4711 */
62+
#define ADHV4710_DEV_ID ID_ADHV4710
63+
64+
Set this to ``ID_ADHV4711`` when running against an ADHV4711 board.
65+
66+
Hardware Specifications
67+
------------------------
68+
69+
Board Connections
70+
~~~~~~~~~~~~~~~~~~~
71+
72+
The evaluation board is controlled over a 4-wire SPI interface plus a
73+
GPIO used for hardware reset. The example also toggles a user LED to
74+
indicate liveness. The SPI, reset and LED pins are defined in the
75+
`Project Platform Configuration Path <https://github.com/analogdevicesinc/no-OS/tree/main/projects/eval-adhv4710/src/platform>`__.
76+
77+
No-OS Build Setup
78+
-----------------
79+
80+
Please see: `No-OS Build Guide <https://wiki.analog.com/resources/no-os/build>`_
81+
82+
No-OS Supported Examples
83+
------------------------
84+
85+
The initialization data used in the example is taken out from the
86+
`Project Common Data Path <https://github.com/analogdevicesinc/no-OS/tree/main/projects/eval-adhv4710/src/common>`__.
87+
88+
The macros used in Common Data are defined in platform specific files
89+
found in the
90+
`Project Platform Configuration Path <https://github.com/analogdevicesinc/no-OS/tree/main/projects/eval-adhv4710/src/platform>`__.
91+
92+
ADHV4710 example
93+
~~~~~~~~~~~~~~~~~
94+
95+
The ``adhv4710_example`` initializes the UART console and the SPI
96+
interface, performs a hardware reset of the amplifier, and initializes
97+
the device for the variant selected by ``ADHV4710_DEV_ID``. It then
98+
clears the shutdown latch, enables all alarm latches, programs the
99+
nominal quiescent current, and configures the overcurrent (source and
100+
sink), overvoltage (positive and negative) and overtemperature
101+
protection limits from the user-defined values in ``common_data.h``.
102+
103+
In its main loop the example periodically reads the alarm status
104+
register (``CTRL_REG_14``), prints any triggered protection over UART,
105+
clears the latched alarm flags, and re-enables the amplifier from
106+
shutdown when required, toggling the user LED each cycle.
107+
108+
Used Hardware
109+
^^^^^^^^^^^^^
110+
111+
* `EVAL-ADHV4710 <https://www.analog.com/ADHV4710>`_ or
112+
`EVAL-ADHV4711 <https://www.analog.com/ADHV4711>`_
113+
* `MAX32690EVKIT <https://www.analog.com/MAX32690>`_
114+
115+
Connections
116+
^^^^^^^^^^^
117+
118+
Connect the evaluation board to the MAX32690 SPI pins (CS, MOSI, MISO,
119+
SCLK), the reset GPIO and ground/power as configured in the platform
120+
files.
121+
122+
Build Command
123+
^^^^^^^^^^^^^
124+
125+
.. code-block:: bash
126+
127+
# to delete current build
128+
make reset
129+
# to build the project
130+
make PLATFORM=maxim TARGET=max32690
131+
# to flash the code
132+
make run

projects/eval-adhv4710/src/common/common_data.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ extern struct no_os_gpio_init_param gpio_reset_ip;
6262
/* check for triggered alarms interval */
6363
#define READ_INTERVAL 2000000
6464

65+
/* Device variant: ID_ADHV4710 or ID_ADHV4711 */
66+
#define ADHV4710_DEV_ID ID_ADHV4710
67+
6568
/* Setup values for ADHV4710 */
6669
/* Current resolution */
6770
#define ADHV4710_CURRENT_RESOLUTION 15.625

projects/eval-adhv4710/src/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,9 @@ int main(void)
106106
/* Init the reset */
107107
adhv4710_ip.gpio_reset = &gpio_reset_ip;
108108

109+
/* Select the device variant */
110+
adhv4710_ip.id = ADHV4710_DEV_ID;
111+
109112
no_os_uart_stdio(uart_desc);
110113

111114
pr_info("\n");

0 commit comments

Comments
 (0)