Struct apigpio::ConnectionCore

source ·
pub struct ConnectionCore { /* private fields */ }
Expand description

Most of the Connection methods, mirroring pigpiod_if2, are actually provided here.

Where methods are named after a facility in pigpiod_if2 http://abyz.me.uk/rpi/pigpio/pdif2.html they perform the same function here. Documentation here in agpipio is present only if there is something unusual.

Implementations

Create a waveform (globally, in pigpiod)

Caller is responsible for not calling wave_* functions for multiple purposes concurrently - ie, for enforcing the concurrency control implied by pigpiod’s interface.

Getting this wrong is not a memory safety concern (hence the lack of unsafe) but would cause wrong behaviours.

Note that this applies even across multiple different pigpiod clients.

Delete a waveform (globally, in pigpiod)

Safety

This is safe if no-one in the whole system ever calls wave_send_using_mode with mode *SYNC*. See the pigpio documentation on wave_send_using_mode for full details.

It is usually easier to call the safe function wave_clear before startup, and during shutdown, than to worry about these questions.

Start sending a waveform using a specified mode value

Safety

Caller must ensure that if txmode is *SYNC* the “bad things” described in the pigpio docs do not happen.

If any calls to this facility (whether via apigpio or any other way of talking to pigpiod) use *SYNC*, then wave_delete (and the equivalent function in other pigpiod bindings) is potentially unsafe and all calls to it must be checked. Note that because everything is shared amongst all clients of pigpiod, this might involve auditing your process handling etc.

Caller must also ensure that txmode is a known valid value, which represents a safe and sane mode. Unknown values are unsound because they might invoke some hazardous new feature of pigpiod.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.