no-OS
Loading...
Searching...
No Matches
admt4000.c File Reference

Implementation of ADMT4000 Driver. More...

#include <errno.h>
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include "admt4000.h"
#include "no_os_alloc.h"
#include "no_os_delay.h"
Include dependency graph for admt4000.c:

Functions

int admt4000_reinitialize (struct admt4000_dev *device)
 Reinitialize device using stored configuration.
 
int admt4000_hard_reset (struct admt4000_dev *device)
 Perform hardware reset via reset pin.
 
int admt4000_init (struct admt4000_dev **device, struct admt4000_init_param *init_param)
 Initializes the admt4000.
 
int admt4000_remove (struct admt4000_dev *device)
 Free the resources allocated by admt4000_init().
 
int admt4000_reg_read (struct admt4000_dev *device, uint8_t reg_addr, uint16_t *reg_data, uint8_t *verif)
 Reads data from a certain ADMT400x Register.
 
int admt4000_reg_write (struct admt4000_dev *device, uint8_t reg_addr, uint16_t reg_data)
 Writes data to a certain ADMT400x Register.
 
int admt4000_reg_update (struct admt4000_dev *device, uint8_t reg_addr, uint16_t update_mask, uint16_t update_val)
 Updates the contents of selected register.
 
int admt4000_toggle_cnv (struct admt4000_dev *device)
 Toggle the CNV to stop/start conversion.
 
int admt4000_raw_angle_read (struct admt4000_dev *device, uint16_t *angle_data)
 Reads ANGLE and ABSANGLE register contents in 1 CS frame.
 
int admt4000_get_raw_turns_and_angle (struct admt4000_dev *device, uint8_t *turns, uint16_t *angle)
 Get the number of turns and angle information (Raw).
 
int admt4000_quarter_turns_cnt (uint8_t raw_turns, int16_t *quarter_turns)
 Convert raw quarter turn count to equivalent signed value.
 
int admt4000_get_cos (struct admt4000_dev *device, int16_t *val, bool *is_new_data)
 Get the cosine value from the ADMT4000 device. This function reads the cosine portion of the AMR angle sensor without post- processing.
 
int admt4000_get_sin (struct admt4000_dev *device, int16_t *val, bool *is_new_data)
 Retrieve the sine value from the ADMT4000 device. This function reads the sine portion of the AMR angle sensor without post- processing.
 
int admt4000_get_gpio (struct admt4000_dev *device, uint8_t gpio, bool *logic)
 Get status of selected GPIO.
 
int admt4000_set_gpio (struct admt4000_dev *device, uint8_t gpio, bool logic)
 Configure selected GPIO.
 
int admt4000_clear_all_faults (struct admt4000_dev *device)
 Clear all faults from fault registers.
 
int admt4000_get_faults (struct admt4000_dev *device, uint16_t *faults)
 Get all fault flags from the fault register.
 
int admt4000_get_radius (struct admt4000_dev *device, uint16_t *radius, bool *is_new_data)
 Get RADIUS vector value.
 
int admt4000_radius_raw_to_scaled (uint16_t raw_radius, float *radius)
 Convert raw RADIUS value to scaled mV/V.
 
int admt4000_get_temp (struct admt4000_dev *device, uint16_t *temp)
 Get raw temperature reading.
 
int admt4000_temp_raw_to_scaled (uint16_t temp_raw, float *temp)
 Convert raw temperature value to scaled temperature (degrees Celsius).
 
int admt4000_angle_raw_to_scaled (uint16_t raw_angle, float *scaled_angle)
 Convert raw angle value to scaled degrees.
 
int admt4000_harmonic_raw_to_scaled (const struct admt4000_harmonic_coeff *raw_coeff, float *scaled_mag, float *scaled_phase)
 Convert raw harmonic coefficients to scaled format.
 
int admt4000_harmonic_scaled_to_raw (uint32_t scaled_mag, uint32_t scaled_phase, struct admt4000_harmonic_coeff *raw_coeff)
 Convert scaled harmonic values to raw coefficients.
 
int admt4000_get_storage_config (struct admt4000_dev *device, uint8_t *storage)
 Gets storage general config.
 
int admt4000_set_storage_config (struct admt4000_dev *device, uint8_t storage)
 Sets storage general config.
 
int admt4000_get_angle_filt (struct admt4000_dev *device, bool *is_filtered)
 Gets current filter setting.
 
int admt4000_set_angle_filt (struct admt4000_dev *device, bool is_filtered)
 Sets the filter setting.
 
int admt4000_get_h8_ctrl (struct admt4000_dev *device, enum admt4000_harmonic_corr_src *source)
 Gets 8th harmonic correction source.
 
int admt4000_set_h8_ctrl (struct admt4000_dev *device, enum admt4000_harmonic_corr_src source)
 Sets 8th harmonic correction source.
 
int admt4000_get_conv_sync_mode (struct admt4000_dev *device, enum admt4000_conv_sync_mode *mode)
 Obtains conversion synchronization mode.
 
int admt4000_set_conv_sync_mode (struct admt4000_dev *device, enum admt4000_conv_sync_mode mode)
 Configures conversion synchronization mode.
 
int admt4000_get_conv_mode (struct admt4000_dev *device, bool *is_one_shot)
 Obtains the conversion mode.
 
int admt4000_set_conv_mode (struct admt4000_dev *device, bool is_one_shot)
 Configures the conversion mode: one shot or continuous.
 
int admt4000_gpio_config (struct admt4000_dev *device, uint8_t gpio, bool alt_mode, bool output_en, bool init_state)
 Configure GPIO mode, direction, and initial state.
 
int admt4000_get_gpio_func (struct admt4000_dev *device, uint8_t gpio, bool *alt_mode)
 Get current GPIO function configuration.
 
int admt4000_get_cnv_cnt (struct admt4000_dev *device, uint8_t *cnt)
 Get current conversion count.
 
int admt4000_get_id (struct admt4000_dev *device, uint8_t id_num, uint16_t *id)
 Read Unique ID from register/s.
 
int admt4000_get_harmonic (struct admt4000_dev *device, uint8_t harmonic, struct admt4000_harmonic_coeff *config)
 Get harmonic configuration (magnitude and phase together).
 
int admt4000_set_harmonic (struct admt4000_dev *device, uint8_t harmonic, const struct admt4000_harmonic_coeff *config)
 Set harmonic configuration (magnitude and phase together).
 
int admt4000_get_harmonics_calib (struct admt4000_dev *device, struct admt4000_harmonics_calib *calib)
 Get all harmonic configurations in a single operation.
 
int admt4000_set_harmonics_calib (struct admt4000_dev *device, const struct admt4000_harmonics_calib *calib)
 Set all harmonic configurations in a single operation.
 

Detailed Description

Implementation of ADMT4000 Driver.

This file contains the implementation of the ADMT4000 driver. It includes functions for initializing the device, reading and writing registers, computing CRC, ECC encoding, and more.

Author
Marc Sosa (marcp.nosp@m.aolo.nosp@m..sosa.nosp@m.@ana.nosp@m.log.c.nosp@m.om)
Jose Ramon San Buenaventura (jose..nosp@m.sanb.nosp@m.uenav.nosp@m.entu.nosp@m.ra@an.nosp@m.alog.nosp@m..com)
Louijie Compo (louij.nosp@m.ie.c.nosp@m.ompo@.nosp@m.anal.nosp@m.og.co.nosp@m.m)

Copyright 2026(c) Analog Devices, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ admt4000_angle_raw_to_scaled()

int admt4000_angle_raw_to_scaled ( uint16_t raw_angle,
float * scaled_angle )

Convert raw angle value to scaled degrees.

Parameters
raw_angle- Input raw angle value
scaled_angle- Output scaled angle in degrees
Returns
0 in case of success, negative error code otherwise.

Scales raw angle register value to physical units using device-specific resolution factors. Angle: raw * 360 / 4096 (for 12-bit angle resolution)

Here is the caller graph for this function:

◆ admt4000_clear_all_faults()

int admt4000_clear_all_faults ( struct admt4000_dev * device)

Clear all faults from fault registers.

Parameters
device- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_angle_filt()

int admt4000_get_angle_filt ( struct admt4000_dev * device,
bool * is_filtered )

Gets current filter setting.

Parameters
device- The device structure.
is_filtered- Stores the logic level of the filter enable bit.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_cnv_cnt()

int admt4000_get_cnv_cnt ( struct admt4000_dev * device,
uint8_t * cnt )

Get current conversion count.

Parameters
device- The device structure.
cnt- Stores the count data.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_conv_mode()

int admt4000_get_conv_mode ( struct admt4000_dev * device,
bool * is_one_shot )

Obtains the conversion mode.

Parameters
device- The device structure.
is_one_shot- Stores the conversion mode bit value.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_conv_sync_mode()

int admt4000_get_conv_sync_mode ( struct admt4000_dev * device,
enum admt4000_conv_sync_mode * mode )

Obtains conversion synchronization mode.

Parameters
device- The device structure.
mode- The conversion synchronization mode configured.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_cos()

int admt4000_get_cos ( struct admt4000_dev * device,
int16_t * val,
bool * is_new_data )

Get the cosine value from the ADMT4000 device. This function reads the cosine portion of the AMR angle sensor without post- processing.

Parameters
device- The device structure.
val- Pointer to a variable where cosine value will be stored.
is_new_data- Optional pointer to store new data flag (can be NULL).
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_get_faults()

int admt4000_get_faults ( struct admt4000_dev * device,
uint16_t * faults )

Get all fault flags from the fault register.

Parameters
device- The device structure.
faults- Pointer to store the fault register value.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_get_gpio()

int admt4000_get_gpio ( struct admt4000_dev * device,
uint8_t gpio,
bool * logic )

Get status of selected GPIO.

Parameters
device- The device structure.
gpio- GPIO number (0 to 5).
logic- Stores the truth value of selected GPIO.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_get_gpio_func()

int admt4000_get_gpio_func ( struct admt4000_dev * device,
uint8_t gpio,
bool * alt_mode )

Get current GPIO function configuration.

Parameters
device- The device structure.
gpio- GPIO number (0-5).
alt_mode- Pointer to store result (true = alt, false = normal).
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_h8_ctrl()

int admt4000_get_h8_ctrl ( struct admt4000_dev * device,
enum admt4000_harmonic_corr_src * source )

Gets 8th harmonic correction source.

Parameters
device- The device structure.
source- The harmonic correction source.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_harmonic()

int admt4000_get_harmonic ( struct admt4000_dev * device,
uint8_t harmonic,
struct admt4000_harmonic_coeff * config )

Get harmonic configuration (magnitude and phase together).

Parameters
device- The device structure.
harmonic- Harmonic number (1, 2, 3, or 8).
config- Output structure for magnitude and phase.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_get_harmonics_calib()

int admt4000_get_harmonics_calib ( struct admt4000_dev * device,
struct admt4000_harmonics_calib * calib )

Get all harmonic configurations in a single operation.

Parameters
device- The device structure.
calib- Output structure for all 4 harmonics (1, 2, 3, 8).
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_id()

int admt4000_get_id ( struct admt4000_dev * device,
uint8_t id_num,
uint16_t * id )

Read Unique ID from register/s.

Parameters
device- The device structure.
id_num- The ID register to read from.
id- Stores the ID value read.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_radius()

int admt4000_get_radius ( struct admt4000_dev * device,
uint16_t * radius,
bool * is_new_data )

Get RADIUS vector value.

Parameters
device- The device structure.
radius- Stores the radius value read.
is_new_data- Optional pointer to store new data flag (can be NULL).
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_get_raw_turns_and_angle()

int admt4000_get_raw_turns_and_angle ( struct admt4000_dev * device,
uint8_t * turns,
uint16_t * angle )

Get the number of turns and angle information (Raw).

Parameters
device- The device structure.
turns- Stores the number of turns read (Raw).
angle- Stores the angle values read (Raw, extracted).
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_get_sin()

int admt4000_get_sin ( struct admt4000_dev * device,
int16_t * val,
bool * is_new_data )

Retrieve the sine value from the ADMT4000 device. This function reads the sine portion of the AMR angle sensor without post- processing.

Parameters
device- The device structure.
val- Pointer to a variable where sine value will be stored.
is_new_data- Optional pointer to store new data flag (can be NULL).
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_get_storage_config()

int admt4000_get_storage_config ( struct admt4000_dev * device,
uint8_t * storage )

Gets storage general config.

Parameters
device- The device structure.
storage- Stores the storage bits read.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_get_temp()

int admt4000_get_temp ( struct admt4000_dev * device,
uint16_t * temp )

Get raw temperature reading.

Parameters
device- The device structure.
temp- Raw temperature ADC value.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_gpio_config()

int admt4000_gpio_config ( struct admt4000_dev * device,
uint8_t gpio,
bool alt_mode,
bool output_en,
bool init_state )

Configure GPIO mode, direction, and initial state.

GPIO Functions

The ADMT4000 has 6 GPIO pins (GPIO0-GPIO5) that can be configured as either:

  • Normal GPIO mode: Standard digital I/O pins
  • Alternate function mode: Device-specific functions

Alternate Functions:

  • GPIO0: BUSY (output only) - Conversion busy indicator
  • GPIO1: CNV (input only) - External conversion trigger (active low)
  • GPIO3: ACALC (output only) - Auto-calibration trigger
  • GPIO5: BOOTLOAD (output only) - Bootloader mode control

When a GPIO is in alternate function mode:

  • The device hardware controls the pin behavior
  • Normal GPIO operations (set_gpio, get_gpio) may have no effect
  • Direction is determined by the alternate function
  • Application should not attempt to control the pin manually

GPIO direction defaults to input mode at init time. If direction configured at init conflicts with the selected alternate function, alternate function's required direction takes precedence.

Parameters
device- The device structure.
gpio- GPIO number (0-5).
alt_mode- Alternate function flag (true = alt, false = normal).
output_en- Direction flag (true = output, false = input). Ignored in alt mode.
init_state- Initial output state (true = high, false = low). Only applied if output_en is true and alt_mode is false.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_hard_reset()

int admt4000_hard_reset ( struct admt4000_dev * device)

Perform hardware reset via reset pin.

Parameters
device- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_harmonic_raw_to_scaled()

int admt4000_harmonic_raw_to_scaled ( const struct admt4000_harmonic_coeff * raw_coeff,
float * scaled_mag,
float * scaled_phase )

Convert raw harmonic coefficients to scaled format.

Parameters
raw_coeff- Input raw calibration coefficients
scaled_mag- Output scaled magnitude
scaled_phase- Output scaled phase
Returns
0 in case of success, negative error code otherwise.

Scales raw register values to physical units using device-specific resolution factors. Magnitude: raw * 0.005493/0.6072 Phase: raw * 0.087891

◆ admt4000_harmonic_scaled_to_raw()

int admt4000_harmonic_scaled_to_raw ( uint32_t scaled_mag,
uint32_t scaled_phase,
struct admt4000_harmonic_coeff * raw_coeff )

Convert scaled harmonic values to raw coefficients.

Parameters
scaled_mag- Input scaled magnitude
scaled_phase- Input scaled phase
raw_coeff- Output raw calibration coefficients
Returns
0 in case of success, negative error code otherwise.

Inverse conversion for writing scaled values to hardware registers. Uses CORDIC scaler (0.6072) to compensate for hardware scaling.

◆ admt4000_init()

int admt4000_init ( struct admt4000_dev ** device,
struct admt4000_init_param * init_param )

Initializes the admt4000.

Parameters
device- The device structure.
init_param- The structure for the device initial parameters.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_quarter_turns_cnt()

int admt4000_quarter_turns_cnt ( uint8_t raw_turns,
int16_t * quarter_turns )

Convert raw quarter turn count to equivalent signed value.

Parameters
raw_turns- Raw quarter turn count read from device.
quarter_turns- Pointer to store the signed quarter turn count.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_radius_raw_to_scaled()

int admt4000_radius_raw_to_scaled ( uint16_t raw_radius,
float * radius )

Convert raw RADIUS value to scaled mV/V.

Parameters
raw_radius- Raw RADIUS value.
radius- Stores Magnitude value (mV/V).
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_raw_angle_read()

int admt4000_raw_angle_read ( struct admt4000_dev * device,
uint16_t * angle_data )

Reads ANGLE and ABSANGLE register contents in 1 CS frame.

Parameters
device- The device structure.
angle_data- Stores data read from the registers.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_reg_read()

int admt4000_reg_read ( struct admt4000_dev * device,
uint8_t reg_addr,
uint16_t * reg_data,
uint8_t * verif )

Reads data from a certain ADMT400x Register.

Parameters
device- The device structure.
reg_addr- Address of the register.
reg_data- Stores data read from the register.
verif- Stores the Fault, and CRC bits returned.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_reg_update()

int admt4000_reg_update ( struct admt4000_dev * device,
uint8_t reg_addr,
uint16_t update_mask,
uint16_t update_val )

Updates the contents of selected register.

Parameters
device- The device structure.
reg_addr- Address of the register.
update_mask- Mask to update to selected register bit/s.
update_val- Value used to update on selected register.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_reg_write()

int admt4000_reg_write ( struct admt4000_dev * device,
uint8_t reg_addr,
uint16_t reg_data )

Writes data to a certain ADMT400x Register.

Parameters
device- The device structure.
reg_addr- Address of the register.
reg_data- Data to write to the chosen register (16 bit wide).
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_reinitialize()

int admt4000_reinitialize ( struct admt4000_dev * device)

Reinitialize device using stored configuration.

Convenience function to restore device configuration after magnetic reset or power cycle events using the parameters from initial initialization.

Parameters
device- The device structure.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_remove()

int admt4000_remove ( struct admt4000_dev * device)

Free the resources allocated by admt4000_init().

Parameters
device- The device structure.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_set_angle_filt()

int admt4000_set_angle_filt ( struct admt4000_dev * device,
bool is_filtered )

Sets the filter setting.

Parameters
device- The device structure.
is_filtered- Set true to enable filter, false otherwise.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_set_conv_mode()

int admt4000_set_conv_mode ( struct admt4000_dev * device,
bool is_one_shot )

Configures the conversion mode: one shot or continuous.

Parameters
device- The device structure.
is_one_shot- Set to true for one shot setting, false otherwise.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_set_conv_sync_mode()

int admt4000_set_conv_sync_mode ( struct admt4000_dev * device,
enum admt4000_conv_sync_mode mode )

Configures conversion synchronization mode.

Parameters
device- The device structure.
mode- The conversion synchronization mode to configure.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_set_gpio()

int admt4000_set_gpio ( struct admt4000_dev * device,
uint8_t gpio,
bool logic )

Configure selected GPIO.

Parameters
device- The device structure.
gpio- GPIO number (0 to 5).
logic- Logic level to set for GPIO.
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_set_h8_ctrl()

int admt4000_set_h8_ctrl ( struct admt4000_dev * device,
enum admt4000_harmonic_corr_src source )

Sets 8th harmonic correction source.

Parameters
device- The device structure.
source- The harmonic correction source.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_set_harmonic()

int admt4000_set_harmonic ( struct admt4000_dev * device,
uint8_t harmonic,
const struct admt4000_harmonic_coeff * config )

Set harmonic configuration (magnitude and phase together).

Parameters
device- The device structure.
harmonic- Harmonic number (1, 2, 3, or 8).
config- Input structure for magnitude and phase.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_set_harmonics_calib()

int admt4000_set_harmonics_calib ( struct admt4000_dev * device,
const struct admt4000_harmonics_calib * calib )

Set all harmonic configurations in a single operation.

Parameters
device- The device structure.
calib- Input structure for all 4 harmonics (1, 2, 3, 8).
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_set_storage_config()

int admt4000_set_storage_config ( struct admt4000_dev * device,
uint8_t storage )

Sets storage general config.

Parameters
device- The device structure.
storage- Data to write on storage bits.
Returns
0 in case of success, negative error code otherwise.

◆ admt4000_temp_raw_to_scaled()

int admt4000_temp_raw_to_scaled ( uint16_t temp_raw,
float * temp )

Convert raw temperature value to scaled temperature (degrees Celsius).

Parameters
temp_raw- Raw temperature ADC value.
temp- Temperature data (degrees Celsius).
Returns
0 in case of success, negative error code otherwise.
Here is the caller graph for this function:

◆ admt4000_toggle_cnv()

int admt4000_toggle_cnv ( struct admt4000_dev * device)

Toggle the CNV to stop/start conversion.

Parameters
device- The device structure.
Returns
0 in case of success, negative error code otherwise.