Skip to content

Commit 39d1d88

Browse files
committed
projects: admt4000: Add documentation for ADMT4000 examples
Add README.rst documentation file for project alongside other documentation related files.
1 parent 402f68d commit 39d1d88

File tree

6 files changed

+303
-1
lines changed

6 files changed

+303
-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: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
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
36+
power
37+
* Contactless absolute position measurement
38+
* Brushless DC motor control and positioning
39+
* Actuator control and positioning
40+
41+
ADMT4000 Device Configuration
42+
----------------------------
43+
44+
Driver Initialization
45+
---------------------
46+
47+
In order to be able to use the device, you will have to provide the support
48+
for the communication protocol (SPI).
49+
50+
Status Configuration
51+
--------------------
52+
53+
Register values of the device can be read using **admt4000_read** API.
54+
Additionally the register values can be written using **admt4000_write** API.
55+
56+
57+
ADMT4000 Driver Initialization Example
58+
-------------------------------------
59+
60+
.. code-block:: bash
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+
int ret;
107+
108+
struct admt4000_iio_dev *admt4000_iio_desc;
109+
110+
struct admt4000_iio_dev_init_param admt4000_iio_ip = {
111+
.admt4000_dev_init = &admt_ip,
112+
};
113+
114+
struct iio_app_desc *app;
115+
struct iio_app_init_param app_init_param = { 0 };
116+
117+
ret = admt4000_iio_init(&admt4000_iio_desc, &admt4000_iio_ip);
118+
if (ret)
119+
goto exit;
120+
121+
struct iio_app_device iio_devices[] = {
122+
{
123+
.name = "admt4000",
124+
.dev = admt4000_iio_desc,
125+
.dev_descriptor = admt4000_iio_desc->iio_dev,
126+
},
127+
};
128+
129+
app_init_param.devices = iio_devices;
130+
app_init_param.nb_devices = NO_OS_ARRAY_SIZE(iio_devices);
131+
app_init_param.uart_init_params = uart_ip;
132+
133+
ret = iio_app_init(&app, app_init_param);
134+
if (ret)
135+
goto iio_admt4000_remove;
136+
137+
ret = iio_app_run(app);
138+
139+
iio_app_remove(app);

projects/admt4000/README.rst

Lines changed: 147 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,147 @@
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+
make EXAMPLE=iio_example
99+
No-OS Supported Platforms
100+
-------------------------
101+
102+
MBED Platform
103+
^^^^^^^^^^^^^^
104+
105+
**Used hardware**
106+
107+
* `SDP-K1 <https://www.analog.com/en/resources/evaluation-hardware-and-software/evaluation-boards-kits/sdp-k1.html>`_
108+
109+
**Connections**:
110+
111+
P5:
112+
+----------+-----------------------+
113+
| ADMT4000 | SDP-K1 Arduino header |
114+
+----------+-----------------------+
115+
| SPI_SCK | D13 |
116+
+----------+-----------------------+
117+
| SPI_MISO | D12 |
118+
+----------+-----------------------+
119+
| SPI_MOSI | D11 |
120+
+----------+-----------------------+
121+
| SPI_CS | D10 |
122+
+----------+-----------------------+
123+
124+
P4:
125+
+----------+-----------------------+
126+
| ADMT4000 | SDP-K1 Arduino header |
127+
+----------+-----------------------+
128+
| ACALC | D6 |
129+
+----------+-----------------------+
130+
| CNV | D5 |
131+
+----------+-----------------------+
132+
| COIL_RS | D4 |
133+
+----------+-----------------------+
134+
| BUSY | D3 |
135+
+----------+-----------------------+
136+
| SHDN_N | D2 |
137+
+----------+-----------------------+
138+
139+
**Build Command**
140+
141+
.. code-block:: bash
142+
# to delete current build
143+
make reset
144+
# to build the project
145+
make PLATFORM=mbed
146+
# to flash the code
147+
make run

0 commit comments

Comments
 (0)