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

Implementation of LTC2358 Driver. More...

#include <stdlib.h>
#include "ltc2358.h"
#include "errno.h"
#include "no_os_alloc.h"
Include dependency graph for ltc2358.c:

Functions

void ltc2358_create_config_word (uint8_t channel, uint8_t config_number, uint32_t *config_word)
 Create 24-bit configuration word for the 8 channels.
 
int32_t ltc2358_channel_data (struct ltc2358_dev *dev, uint32_t config_word, uint8_t data_array[24], uint8_t channel, uint32_t *readval)
 Read single channel data.
 
int32_t ltc2358_init (struct ltc2358_dev **device, struct ltc2358_init_param *init_param)
 Initialize the device.
 
int32_t ltc2358_remove (struct ltc2358_dev *dev)
 Free memory allocated by ltc2358_init().
 

Detailed Description

Implementation of LTC2358 Driver.

Author
Kim Seer Paller (kimse.nosp@m.er.p.nosp@m.aller.nosp@m.@ana.nosp@m.log.c.nosp@m.om)

Copyright 2022(c) Analog Devices, Inc.

SPDX-License-Identifier: BSD-3-Clause

Function Documentation

◆ ltc2358_channel_data()

int32_t ltc2358_channel_data ( struct ltc2358_dev * dev,
uint32_t config_word,
uint8_t data_array[24],
uint8_t channel,
uint32_t * readval )

Read single channel data.

Parameters
dev- Device handler.
config_word- 24-bit config word created.
data_array- 24 bytes of data from 8 channels.
channel- Selected channel (0-7).
readval- 3 bytes raw data for specific channel.
Returns
0 in case of success, negative error code otherwise.

◆ ltc2358_create_config_word()

void ltc2358_create_config_word ( uint8_t channel,
uint8_t config_number,
uint32_t * config_word )

Create 24-bit configuration word for the 8 channels.

Parameters
channel- Channel number.
config_number- Configuration number for the channel.
config_word- 24-bit config word created.

◆ ltc2358_init()

int32_t ltc2358_init ( struct ltc2358_dev ** device,
struct ltc2358_init_param * init_param )

Initialize the device.

Parameters
device- The device structure.
init_param- The structure that contains the device initial parameters.
Returns
0 in case of success, -1 otherwise.

◆ ltc2358_remove()

int32_t ltc2358_remove ( struct ltc2358_dev * dev)

Free memory allocated by ltc2358_init().

Parameters
dev- Device handler.
Returns
0 in case of success, -1 otherwise.