Skip to content

Commit bd30b73

Browse files
committed
projects: admt4000: Add documentation for ADMT4000 examples
Add README.rst documentation file for project alongside other documentation related files.
1 parent a3ee834 commit bd30b73

File tree

6 files changed

+308
-1
lines changed

6 files changed

+308
-1
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../../../../drivers/magnetometer/admt4000/README.rst

doc/sphinx/source/drivers_doc.rst

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,4 +123,11 @@ POTENTIOMETER
123123
.. toctree::
124124
:maxdepth: 1
125125

126-
drivers/ad5293
126+
drivers/ad5293
127+
128+
MAGNETOMETER
129+
================
130+
.. toctree::
131+
:maxdepth: 1
132+
133+
drivers/admt4000
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.. include:: ../../../../projects/admt4000/README.rst

doc/sphinx/source/projects_doc.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,3 +103,10 @@ TEMPERATURE
103103

104104
projects/max31827-evkit
105105
projects/ltc2983
106+
107+
MAGNETOMETER
108+
==============
109+
.. toctree::
110+
:maxdepth: 1
111+
112+
projects/admt4000
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
ADP5055 no-OS driver
2+
====================
3+
4+
Supported Devices
5+
-----------------
6+
7+
`ADMT4000 <https://www.analog.com/en/products/admt4000.html>`_
8+
9+
Overview
10+
--------
11+
12+
TThe ADMT4000 is a magnetic turn count sensor capable
13+
of recording the number of rotations of a magnetic
14+
system even while the device is powered down.
15+
On power-up, the device can be interrogated to report the
16+
absolute position of the system. The absolute position
17+
is reported through a serial-peripheral interface (SPI).
18+
The ADMT4000 counts up to 46-turns of an external
19+
magnetic field, which increments the absolute position
20+
in the clockwise (CW) direction.
21+
The device includes three magnetic sensors, a giant
22+
magneto resistance (GMR) turn count sensor, which is
23+
used to count the number of rotations on the system, a
24+
GMR quadrant detecting sensor, and an anisotropic
25+
magnetoresistance (AMR) angle sensor. The AMR angle
26+
sensor is used in combination with a GMR quadrant
27+
detecting sensor to determine the absolute position of
28+
the system within 360°. Combining the GMR turn count
29+
sensor output with the AMR angle sensor output
30+
enables the device to report the position of the system
31+
with a high degree of angular accuracy.
32+
33+
Applications
34+
------------
35+
* Rotation count detection and storage without power
36+
* Contactless absolute position measurement
37+
* Brushless DC motor control and positioning
38+
* Actuator control and positioning
39+
40+
ADMT4000 Device Configuration
41+
-----------------------------
42+
43+
Driver Initialization
44+
---------------------
45+
46+
In order to be able to use the device, you will have to provide the support
47+
for the communication protocol (SPI).
48+
49+
Status Configuration
50+
--------------------
51+
52+
Register values of the device can be read using **admt4000_read** API.
53+
Additionally the register values can be written using **admt4000_write** API.
54+
55+
56+
ADMT4000 Driver Initialization Example
57+
--------------------------------------
58+
59+
.. code-block:: bash
60+
61+
struct admt4000_desc *admt4000_desc;
62+
const struct no_os_spi_init_param admt_spi_ip = {
63+
.device_id = SPI_DEVICE_ID,
64+
.max_speed_hz = SPI_BAUDRATE,
65+
.chip_select = SPI_CS,
66+
.mode = NO_OS_SPI_MODE_0,
67+
.bit_order = NO_OS_SPI_BIT_ORDER_MSB_FIRST,
68+
.platform_ops = SPI_OPS,
69+
.extra = SPI_EXTRA,
70+
};
71+
struct admt4000_init_param admt4000_ip = {
72+
.spi_init = admt_spi_ip,
73+
.gpio_coil_rs = gpio_coil_rs_ip,
74+
.gpio_gpio0_busy = gpio_gpio0_busy_ip,
75+
.gpio_shdn_n = gpio_shdn_n_ip,
76+
.dev_vdd = ADMT4000_3P3V,
77+
};
78+
ret = admt4000_init(&admt4000_desc, admt4000_ip);
79+
if (ret)
80+
goto exit;
81+
82+
83+
84+
ADMT4000 no-OS IIO support
85+
--------------------------
86+
The ADMT4000 IIO driver comes on top of the ADMT4000 driver and offers support
87+
for interfacing IIO clients through libiio.
88+
89+
ADMT4000 IIO Device Configuration
90+
---------------------------------
91+
Attributes
92+
----------
93+
94+
* ``page - sets and reads the page of the register map to be accessed``
95+
* ``sequencer_mode - to``
96+
* ``angle_filt - toggles the filter for the angle sensor``
97+
* ``conversion_mode - toggles and reads the conversion mode``
98+
* ``h8_ctrl - toggles the H8 control``
99+
* ``sdp_gpio0_busy - gets the status of the GPIO0 busy pin``
100+
* ``sdp_coil_rs - sets the coil for GMR reset``
101+
102+
ADMT4000 IIO Driver Initialization Example
103+
------------------------------------------
104+
105+
.. code-block:: bash
106+
107+
int ret;
108+
109+
struct admt4000_iio_dev *admt4000_iio_desc;
110+
111+
struct admt4000_iio_dev_init_param admt4000_iio_ip = {
112+
.admt4000_dev_init = &admt_ip,
113+
};
114+
115+
struct iio_app_desc *app;
116+
struct iio_app_init_param app_init_param = { 0 };
117+
118+
ret = admt4000_iio_init(&admt4000_iio_desc, &admt4000_iio_ip);
119+
if (ret)
120+
goto exit;
121+
122+
struct iio_app_device iio_devices[] = {
123+
{
124+
.name = "admt4000",
125+
.dev = admt4000_iio_desc,
126+
.dev_descriptor = admt4000_iio_desc->iio_dev,
127+
},
128+
};
129+
130+
app_init_param.devices = iio_devices;
131+
app_init_param.nb_devices = NO_OS_ARRAY_SIZE(iio_devices);
132+
app_init_param.uart_init_params = uart_ip;
133+
134+
ret = iio_app_init(&app, app_init_param);
135+
if (ret)
136+
goto iio_admt4000_remove;
137+
138+
ret = iio_app_run(app);
139+
140+
iio_app_remove(app);

projects/admt4000/README.rst

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
Evaluating the ADMT4000
2+
=======================
3+
4+
5+
Contents
6+
--------
7+
8+
.. contents:: Table of Contents
9+
:depth: 3
10+
11+
Supported Evaluation Boards
12+
---------------------------
13+
14+
* NOT YET AVAILABLE IN PRODUCT PAGE
15+
16+
Overview
17+
--------
18+
19+
The ADMT4000 is a magnetic turn, counter sensor capable of recording turns of an
20+
external magnetic field with zero power. The absolute position, including the
21+
number of turns, is reported via a serial peripheral interface (SPI).
22+
23+
Hardware Specifications
24+
-----------------------
25+
26+
Power Supply Requirements
27+
^^^^^^^^^^^^^^^^^^^^^^^^^
28+
29+
A power supply of 5V via USB Type-C is needed.
30+
31+
**Pin Description**:
32+
33+
+-----+----------+-------------------------------------------+
34+
| Pin | Name | Description |
35+
+-----+----------+-------------------------------------------+
36+
| 1 | DV18 | Decoupling cap |
37+
+-----+----------+-------------------------------------------+
38+
| 2 | ACALC | Output signal |
39+
+-----+----------+-------------------------------------------+
40+
| 3 | GPIO4 | I/O |
41+
+-----+----------+-------------------------------------------+
42+
| 4 | BOOTLOAD | I2C Serial Clock |
43+
+-----+----------+-------------------------------------------+
44+
| 5 | VDD | Supply |
45+
+-----+----------+-------------------------------------------+
46+
| 15 | SDO | Serial Data out |
47+
+-----+----------+-------------------------------------------+
48+
| 16 | SDI | Serial Data input |
49+
+-----+----------+-------------------------------------------+
50+
| 17 | SCLK | Serial Clock |
51+
+-----+----------+-------------------------------------------+
52+
| 18 | CS | Chip Select |
53+
+-----+----------+-------------------------------------------+
54+
| 19 | BUSY | Busy signal |
55+
+-----+----------+-------------------------------------------+
56+
| 20 | CNV | Conversion signal |
57+
+-----+----------+-------------------------------------------+
58+
| 21 | VDRIVE | Logic power supply |
59+
+-----+----------+-------------------------------------------+
60+
| 22 | RESET | GMR Reset |
61+
+-----+----------+-------------------------------------------+
62+
63+
64+
No-OS Build Setup
65+
-----------------
66+
67+
Please see: https://wiki.analog.com/resources/no-os/build
68+
69+
No-OS Supported Examples
70+
------------------------
71+
72+
The initialization data used in the examples is taken out from:
73+
`Project Common Data Path <https://github.com/analogdevicesinc/no-OS/tree/main/projects/lt3074/src/common>`_
74+
75+
The macros used in Common Data are defined in platform specific files found in:
76+
`Project Platform Configuration Path <https://github.com/analogdevicesinc/no-OS/tree/main/projects/lt3074/src/platform>`_
77+
78+
IIO example
79+
^^^^^^^^^^^
80+
81+
The IIO device driver contains the IIO specific implementations for the ADMT4000.
82+
The functions in this driver invoke functions from the ADMT4000 driver; however,
83+
formatted in such a way that it is compatible with IIO hosts, such as IIO oscilloscope.
84+
Items such as, but not limited to, available measurement channels, channel attribute
85+
implementations, device-specific IIO attributes, IIO device name, and register debug functions
86+
are included in the IIO drivers. The IIO driver works together with the IIO example
87+
project to create firmware that transforms the ADMT4000 and the controller to a valid IIO device.
88+
89+
If you are not familiar with ADI IIO Application, please take a look at:
90+
`IIO No-OS <https://wiki.analog.com/resources/tools-software/no-os-software/iio>`_
91+
92+
If you are not familiar with ADI IIO-Oscilloscope Client, please take a look at:
93+
`IIO Oscilloscope <https://wiki.analog.com/resources/tools-software/linux-software/iio_oscilloscope>`_
94+
95+
In order to build the IIO project:
96+
97+
.. code-block:: bash
98+
99+
make EXAMPLE=iio_example
100+
101+
102+
No-OS Supported Platforms
103+
-------------------------
104+
105+
MBED Platform
106+
^^^^^^^^^^^^^^
107+
108+
**Used hardware**
109+
110+
* `SDP-K1 <https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/sdp-k1.html>`_
111+
112+
**Connections**:
113+
114+
P5:
115+
+----------+-----------------------+
116+
| ADMT4000 | SDP-K1 Arduino header |
117+
+----------+-----------------------+
118+
| SPI_SCK | D13 |
119+
+----------+-----------------------+
120+
| SPI_MISO | D12 |
121+
+----------+-----------------------+
122+
| SPI_MOSI | D11 |
123+
+----------+-----------------------+
124+
| SPI_CS | D10 |
125+
+----------+-----------------------+
126+
127+
P4:
128+
+----------+-----------------------+
129+
| ADMT4000 | SDP-K1 Arduino header |
130+
+----------+-----------------------+
131+
| ACALC | D6 |
132+
+----------+-----------------------+
133+
| CNV | D5 |
134+
+----------+-----------------------+
135+
| COIL_RS | D4 |
136+
+----------+-----------------------+
137+
| BUSY | D3 |
138+
+----------+-----------------------+
139+
| SHDN_N | D2 |
140+
+----------+-----------------------+
141+
142+
**Build Command**
143+
144+
.. code-block:: bash
145+
146+
# to delete current build
147+
make reset
148+
# to build the project
149+
make PLATFORM=mbed
150+
# to flash the code
151+
make run

0 commit comments

Comments
 (0)