no-OS
Functions
max31875.c File Reference

Implementation of MAX31875 Driver. More...

#include "no_os_error.h"
#include "max31875.h"
Include dependency graph for max31875.c:

Functions

int32_t max31875_reg_read (struct max31875_dev *dev, uint32_t reg, uint32_t *readval)
 Read a device register through the I2C interface. More...
 
int32_t max31875_reg_write (struct max31875_dev *dev, uint32_t reg, uint32_t writeval)
 Write a device register through the I2C interface. More...
 
int32_t max31875_reg_write_mask (struct max31875_dev *dev, uint32_t reg, uint32_t val, uint32_t mask)
 Read-modify-write operation on a field of a register. More...
 
int32_t max31875_init (struct max31875_dev **device, struct max31875_init_param *init_param)
 Initialize the device driver befre use. More...
 
int32_t max31875_remove (struct max31875_dev *dev)
 Free memory allocated by max31875_init(). More...
 

Detailed Description

Implementation of MAX31875 Driver.

Author
Andrei Drimbarean (andre.nosp@m.i.dr.nosp@m.imbar.nosp@m.ean@.nosp@m.analo.nosp@m.g.co.nosp@m.m)

Copyright 2022(c) Analog Devices, Inc.

All rights reserved.

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

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, 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

◆ max31875_init()

int32_t max31875_init ( struct max31875_dev **  device,
struct max31875_init_param init_param 
)

Initialize the device driver befre use.

Parameters
[out]device- Driver handler pointer.
[in]init_param- Pointer to the initialization structure.
Returns
0 in case of success, error code otherwise.

◆ max31875_reg_read()

int32_t max31875_reg_read ( struct max31875_dev dev,
uint32_t  reg,
uint32_t *  readval 
)

Read a device register through the I2C interface.

Parameters
[in]dev- Driver handler pointer.
[in]reg- Address of the register to be read.
[out]readval- Pointer to the register value.
Returns
0 in case of success, error code otherwise.
Here is the caller graph for this function:

◆ max31875_reg_write()

int32_t max31875_reg_write ( struct max31875_dev dev,
uint32_t  reg,
uint32_t  writeval 
)

Write a device register through the I2C interface.

Parameters
[in]dev- Driver handler pointer.
[in]reg- Address of the register to be written.
[in]writeval- New value for the register.
Returns
0 in case of success, error code otherwise.
Here is the caller graph for this function:

◆ max31875_reg_write_mask()

int32_t max31875_reg_write_mask ( struct max31875_dev dev,
uint32_t  reg,
uint32_t  val,
uint32_t  mask 
)

Read-modify-write operation on a field of a register.

Parameters
[in]dev- Driver handler pointer.
[in]reg- Address of the register.
[in]val- New value for the bit field.
[in]mask- Mask of the bit field.
Returns
0 in case of success, error code otherwise.

◆ max31875_remove()

int32_t max31875_remove ( struct max31875_dev dev)

Free memory allocated by max31875_init().

Parameters
[in]dev- Device driver handler.
Returns
0 in case of success, error code otherwise.