4 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
23 struct channel_parameters {
28 unsigned int byte_count;
29 unsigned int valid_bits;
31 unsigned long long int mask;
32 unsigned int big_endian;
33 unsigned int is_signed;
35 unsigned int buf_index;
38 void sort_channels_by_index(struct channel_parameters *channels, int count);
39 int decode_channel_data_type(const char *device_dir, const char *ch_name, struct channel_parameters *ch_info);
40 int add_channel_to_array(const char *device_dir, const char *ch_name, struct channel_parameters *channel);
41 int get_channel_array_size(struct channel_parameters *channels, int num_channels);
42 int update_sysfs_num(const char *filepath, int val, bool verify = false);
43 int update_sysfs_string(const char *filepath, char *val, bool verify = false);
44 int convert_bytes_to_int(int input, struct channel_parameters *info);
46 #endif /* IIO_COMMON_H_ */