libgpiod = { path = "../libgpiod" }
[build-dependencies]
-bindgen = "0.59.1"
+bindgen = "0.63"
cc = "1.0.46"
[dependencies]
[build-dependencies]
-bindgen = "0.59.1"
+bindgen = "0.63"
cc = "1.0.46"
// SPDX-FileCopyrightText: 2022 Linaro Ltd.
// SPDX-FileCopyrightTest: 2022 Viresh Kumar <viresh.kumar@linaro.org>
-use std::os::raw::c_ulong;
use std::ptr;
use super::{
pub fn new(capacity: usize) -> Result<Self> {
// SAFETY: The `gpiod_edge_event_buffer` returned by libgpiod is guaranteed to live as long
// as the `struct Buffer`.
- let buffer = unsafe { gpiod::gpiod_edge_event_buffer_new(capacity as c_ulong) };
+ let buffer = unsafe { gpiod::gpiod_edge_event_buffer_new(capacity) };
if buffer.is_null() {
return Err(Error::OperationFailed(
OperationType::EdgeEventBufferNew,
// SPDX-FileCopyrightText: 2022 Linaro Ltd.
// SPDX-FileCopyrightTest: 2022 Viresh Kumar <viresh.kumar@linaro.org>
-use std::os::raw::c_ulong;
-
use super::{
gpiod,
line::{Offset, Settings, SettingsMap, Value},
gpiod::gpiod_line_config_add_line_settings(
self.config,
offsets.as_ptr(),
- offsets.len() as c_ulong,
+ offsets.len(),
settings.settings,
)
};
gpiod::gpiod_line_config_set_output_values(
self.config,
mapped_values.as_ptr(),
- values.len() as u64,
+ values.len(),
)
};
// SPDX-FileCopyrightText: 2022 Linaro Ltd.
// SPDX-FileCopyrightTest: 2022 Viresh Kumar <viresh.kumar@linaro.org>
-use std::os::{raw::c_ulong, unix::prelude::AsRawFd};
+use std::os::unix::prelude::AsRawFd;
use std::time::Duration;
use super::{
gpiod::gpiod_line_request_get_requested_offsets(
self.request,
offsets.as_mut_ptr(),
- self.num_lines() as u64,
+ self.num_lines(),
)
};
offsets.shrink_to(num_offsets as usize);
let ret = unsafe {
gpiod::gpiod_line_request_get_values_subset(
self.request,
- offsets.len() as c_ulong,
+ offsets.len(),
offsets.as_ptr(),
values.as_mut_ptr(),
)
let ret = unsafe {
gpiod::gpiod_line_request_set_values_subset(
self.request,
- offsets.len() as c_ulong,
+ offsets.len(),
offsets.as_ptr(),
values.as_ptr(),
)
// SPDX-FileCopyrightTest: 2022 Viresh Kumar <viresh.kumar@linaro.org>
use std::ffi::{CStr, CString};
-use std::os::raw::{c_char, c_ulong};
+use std::os::raw::c_char;
use std::str;
use super::{gpiod, Error, OperationType, Result};
/// Set the size of the kernel event buffer for the request.
pub fn set_event_buffer_size(&mut self, size: usize) -> &mut Self {
// SAFETY: `gpiod_request_config` is guaranteed to be valid here.
- unsafe { gpiod::gpiod_request_config_set_event_buffer_size(self.config, size as c_ulong) }
+ unsafe { gpiod::gpiod_request_config_set_event_buffer_size(self.config, size) }
self
}