Implementation of LTC2358 Driver.
More...
#include <stdint.h>
#include "no_os_spi.h"
#include "no_os_util.h"
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
◆ LTC2358_BYTES_PER_CH
| #define LTC2358_BYTES_PER_CH 3 |
◆ LTC2358_CHANNEL_MSK
◆ 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()
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()
Free memory allocated by ltc2358_init().
- Parameters
-
- Returns
- 0 in case of success, -1 otherwise.