7 Commits

Author SHA1 Message Date
Simon Wörner
5c5e1df435 added documentation, updated realzeitnachweis 2017-07-10 16:44:39 +02:00
Simon Wörner
fe8806a4d5 added rust documentation comments 2017-07-10 15:20:14 +02:00
Simon Wörner
088867352c added rust doc output 2017-07-10 14:55:44 +02:00
8d2b664149 Abgabe 2017-06-28 20:40:01 +02:00
Simon Wörner
76dd61f48b fixed rustdoc tests 2017-05-02 22:30:24 +02:00
Simon Wörner
733068dc8d fixed rustfmt warnings 2017-05-02 22:30:24 +02:00
Simon Wörner
cef96956a4 fixed ci 2017-05-02 22:30:24 +02:00
175 changed files with 15019 additions and 1781 deletions

View File

@@ -1,4 +1,4 @@
image: scorpil/rust:stable image: scorpil/rust:nightly
stages: stages:
- test - test
@@ -10,6 +10,9 @@ cargo:test:
rustfmt: rustfmt:
stage: test stage: test
before_script:
- cargo install rustfmt
- export PATH="/root/.cargo/bin:$PATH"
script: script:
- ci/run-rustfmt.sh - ci/run-rustfmt.sh

View File

@@ -2,4 +2,6 @@ language: rust
rust: rust:
- nightly - nightly
script: script:
- true - cargo install rustfmt
- ci/run-rustfmt.sh
- ci/run-cargo-test.sh

View File

@@ -24,8 +24,8 @@ static GPIO_LED_ON: &'static str = "0";
static GPIO_LED_OFF: &'static str = "1"; static GPIO_LED_OFF: &'static str = "1";
fn write(path: &str, value: &str) { fn write(path: &str, value: &str) {
let mut file = File::create(Path::new(path)) let mut file = File::create(Path::new(path)).expect(format!("Open file '{}' failed", path)
.expect(format!("Open file '{}' failed", path).as_str()); .as_str());
file.write_all(value.as_bytes()) file.write_all(value.as_bytes())
.expect(format!("Write value '{}' to '{}' file failed", value, path).as_str()); .expect(format!("Write value '{}' to '{}' file failed", value, path).as_str());
@@ -34,8 +34,8 @@ fn write(path: &str, value: &str) {
println!("Wrote value '{}' to '{}'.", value, path); println!("Wrote value '{}' to '{}'.", value, path);
} }
fn read(path: &str) -> String { fn read(path: &str) -> String {
let mut file = File::open(Path::new(path)) let mut file = File::open(Path::new(path)).expect(format!("Open file '{}' failed", path)
.expect(format!("Open file '{}' failed", path).as_str()); .as_str());
let mut contents = String::new(); let mut contents = String::new();
file.read_to_string(&mut contents) file.read_to_string(&mut contents)
@@ -55,11 +55,13 @@ fn unexport(port: &str) {
} }
fn set_direction(port: &str, direction: &str) { fn set_direction(port: &str, direction: &str) {
write(format!("/sys/class/gpio/gpio{}/direction", port).as_str(), direction); write(format!("/sys/class/gpio/gpio{}/direction", port).as_str(),
direction);
} }
fn set_value(port: &str, value: &str) { fn set_value(port: &str, value: &str) {
write(format!("/sys/class/gpio/gpio{}/value", port).as_str(), value); write(format!("/sys/class/gpio/gpio{}/value", port).as_str(),
value);
} }
fn get_value(port: &str) -> String { fn get_value(port: &str) -> String {
String::from(read(format!("/sys/class/gpio/gpio{}/value", port).as_str()).trim()) String::from(read(format!("/sys/class/gpio/gpio{}/value", port).as_str()).trim())

View File

@@ -18,6 +18,16 @@ fn nanosleep(rqtp: *const libc::timespec, rmtp: *mut libc::timespec) -> libc::c_
/// Sleeps for the given duration. /// Sleeps for the given duration.
/// ///
/// Examples:
///
/// ```rust
/// extern crate sleep;
/// use std::time::Duration;
///
/// // sleep 10 ms
/// sleep::sleep(Duration::from_millis(10));
/// ```
///
/// Uses `clock_nanosleep` on linux and `nanosleep` on darwin. /// Uses `clock_nanosleep` on linux and `nanosleep` on darwin.
pub fn sleep(duration: Duration) -> Result<Duration, libc::c_int> { pub fn sleep(duration: Duration) -> Result<Duration, libc::c_int> {
let ts = duration_to_timespec(duration); let ts = duration_to_timespec(duration);
@@ -57,8 +67,11 @@ fn timespec_to_duration(timespec: libc::timespec) -> Duration {
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
/// extern crate libc;
/// extern crate sleep;
///
/// // set *round-robin* policy (default) and priority 99 (realtime) for own process /// // set *round-robin* policy (default) and priority 99 (realtime) for own process
/// set_scheduler(0, libc::SCHED_RR, 99); /// sleep::set_scheduler(0, libc::SCHED_RR, 99);
/// ``` /// ```
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
pub fn set_scheduler(pid: libc::pid_t, policy: libc::c_int, priority: libc::c_int) -> libc::c_int { pub fn set_scheduler(pid: libc::pid_t, policy: libc::c_int, priority: libc::c_int) -> libc::c_int {
@@ -71,8 +84,10 @@ pub fn set_scheduler(pid: libc::pid_t, policy: libc::c_int, priority: libc::c_in
/// # Examples /// # Examples
/// ///
/// ```rust /// ```rust
/// extern crate sleep;
///
/// // set *round-robin* policy (default) and priority 99 (realtime) /// // set *round-robin* policy (default) and priority 99 (realtime)
/// set_priority(99); /// sleep::set_priority(99);
/// ``` /// ```
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
pub fn set_priority(priority: i32) -> libc::c_int { pub fn set_priority(priority: i32) -> libc::c_int {

View File

@@ -98,13 +98,19 @@ fn main() {
{ {
let mut ap = ArgumentParser::new(); let mut ap = ArgumentParser::new();
ap.set_description(env!("CARGO_PKG_DESCRIPTION")); ap.set_description(env!("CARGO_PKG_DESCRIPTION"));
ap.refer(&mut min).add_option(&["--min"], Store, "Sleep period start"); ap.refer(&mut min)
ap.refer(&mut max).add_option(&["--max"], Store, "Sleep period end"); .add_option(&["--min"], Store, "Sleep period start");
ap.refer(&mut step).add_option(&["--step"], Store, "Sleep period step size"); ap.refer(&mut max)
ap.refer(&mut count).add_option(&["--loop"], Store, "Count of measurements per period"); .add_option(&["--max"], Store, "Sleep period end");
ap.refer(&mut step)
.add_option(&["--step"], Store, "Sleep period step size");
ap.refer(&mut count)
.add_option(&["--loop"], Store, "Count of measurements per period");
#[cfg(target_os = "linux")] #[cfg(target_os = "linux")]
ap.refer(&mut realtime).add_option(&["--rt"], StoreTrue, "Set realtime priority"); ap.refer(&mut realtime)
ap.refer(&mut output).add_option(&["-o", "--out"], Store, "Output file"); .add_option(&["--rt"], StoreTrue, "Set realtime priority");
ap.refer(&mut output)
.add_option(&["-o", "--out"], Store, "Output file");
ap.add_option(&["-V", "--version"], ap.add_option(&["-V", "--version"],
Print(env!("CARGO_PKG_VERSION").to_string()), Print(env!("CARGO_PKG_VERSION").to_string()),
"Show version"); "Show version");
@@ -141,9 +147,8 @@ fn main() {
match file.as_ref() { match file.as_ref() {
Some(mut f) => { Some(mut f) => {
let value = format!("{: >9} {}\n", duration, duration_to_ns(max_delay.1)); let value = format!("{: >9} {}\n", duration, duration_to_ns(max_delay.1));
f.write_all(value.as_bytes()).expect(format!("Write value '{}' to '{}' file failed", f.write_all(value.as_bytes())
value, .expect(format!("Write value '{}' to '{}' file failed", value, output)
output)
.as_str()); .as_str());
} }
None => {} None => {}

View File

@@ -4,10 +4,7 @@ ERROR=0
while IFS= read -r -d '' f; do while IFS= read -r -d '' f; do
echo "${f}" echo "${f}"
rustfmt --write-mode=diff "$f" || ERROR=1
if [ "$(rustfmt --write-mode=diff "$f")" != $'' ] ; then
ERROR=1
fi
done < <(find . -type f -name '*.rs' -print0) done < <(find . -type f -name '*.rs' -print0)
exit ${ERROR} exit ${ERROR}

36
kawaii/CMakeLists.txt Normal file
View File

@@ -0,0 +1,36 @@
cmake_minimum_required(VERSION 3.7)
project(kawaii-engine)
add_subdirectory(kawaii-rs)
set(CMAKE_CXX_STANDARD 14)
set(SOURCE_FILES gpio.cpp engine.cpp measure.cpp)
if (MEASURE)
add_definitions("-DMEASURE")
endif (MEASURE)
#add_executable(engine ${SOURCE_FILES} test.cpp ultrasound_sensor.cpp)
#add_executable(remote ${SOURCE_FILES} remote.cpp)
add_executable(kawaii ${SOURCE_FILES} main.cpp ultrasound_sensor.cpp rfid_reader.cpp MFRC522.cpp rfid_reader.cpp emergency_stop.cpp)
#add_dependencies(engine kawaii-rs)
#add_dependencies(remote kawaii-rs)
add_dependencies(kawaii kawaii-rs)
#target_link_libraries(engine
# debug "${CMAKE_SOURCE_DIR}/kawaii-rs/target/debug/libkawaii.a"
# optimized "${CMAKE_SOURCE_DIR}/kawaii-rs/target/release/libkawaii.a"
# util dl rt pthread gcc_s c m rt pthread util
# pthread)
#target_link_libraries(remote
# debug "${CMAKE_SOURCE_DIR}/kawaii-rs/target/debug/libkawaii.a"
# optimized "${CMAKE_SOURCE_DIR}/kawaii-rs/target/release/libkawaii.a"
# util dl rt pthread gcc_s c m rt pthread util
# boost_system pthread)
target_link_libraries(kawaii
debug "${CMAKE_SOURCE_DIR}/kawaii-rs/target/debug/libkawaii.a"
optimized "${CMAKE_SOURCE_DIR}/kawaii-rs/target/release/libkawaii.a"
util dl rt pthread gcc_s c m rt pthread util
pthread bcm2835)

1755
kawaii/MFRC522.cpp Normal file

File diff suppressed because it is too large Load Diff

323
kawaii/MFRC522.h Normal file
View File

@@ -0,0 +1,323 @@
/**
* MFRC522.h - Library to use ARDUINO RFID MODULE KIT 13.56 MHZ WITH TAGS SPI W AND R BY COOQROBOT.
* Based on code Dr.Leong ( WWW.B2CQSHOP.COM )
* Created by Miguel Balboa (circuitito.com), Jan, 2012.
* Rewritten by Søren Thing Andersen (access.thing.dk), fall of 2013 (Translation to English, refactored, comments, anti collision, cascade levels.)
* Extended by Tom Clement with functionality to write to sector 0 of UID changeable Mifare cards.
* Released into the public domain.
*
-- Repurposed to fit Raspberry Pi ---
*/
#ifndef MFRC522_h
#define MFRC522_h
#include <stdint.h>
#include <stdio.h>
#include <string>
using namespace std;
typedef uint8_t byte;
typedef uint16_t word;
// Firmware data for self-test
// Reference values based on firmware version; taken from 16.1.1 in spec.
// Version 1.0
const byte MFRC522_firmware_referenceV1_0[] = {
0x00, 0xC6, 0x37, 0xD5, 0x32, 0xB7, 0x57, 0x5C,
0xC2, 0xD8, 0x7C, 0x4D, 0xD9, 0x70, 0xC7, 0x73,
0x10, 0xE6, 0xD2, 0xAA, 0x5E, 0xA1, 0x3E, 0x5A,
0x14, 0xAF, 0x30, 0x61, 0xC9, 0x70, 0xDB, 0x2E,
0x64, 0x22, 0x72, 0xB5, 0xBD, 0x65, 0xF4, 0xEC,
0x22, 0xBC, 0xD3, 0x72, 0x35, 0xCD, 0xAA, 0x41,
0x1F, 0xA7, 0xF3, 0x53, 0x14, 0xDE, 0x7E, 0x02,
0xD9, 0x0F, 0xB5, 0x5E, 0x25, 0x1D, 0x29, 0x79
};
// Version 2.0
const byte MFRC522_firmware_referenceV2_0[] = {
0x00, 0xEB, 0x66, 0xBA, 0x57, 0xBF, 0x23, 0x95,
0xD0, 0xE3, 0x0D, 0x3D, 0x27, 0x89, 0x5C, 0xDE,
0x9D, 0x3B, 0xA7, 0x00, 0x21, 0x5B, 0x89, 0x82,
0x51, 0x3A, 0xEB, 0x02, 0x0C, 0xA5, 0x00, 0x49,
0x7C, 0x84, 0x4D, 0xB3, 0xCC, 0xD2, 0x1B, 0x81,
0x5D, 0x48, 0x76, 0xD5, 0x71, 0x61, 0x21, 0xA9,
0x86, 0x96, 0x83, 0x38, 0xCF, 0x9D, 0x5B, 0x6D,
0xDC, 0x15, 0xBA, 0x3E, 0x7D, 0x95, 0x3B, 0x2F
};
class MFRC522 {
public:
// MFRC522 registers. Described in chapter 9 of the datasheet.
// When using SPI all addresses are shifted one bit left in the "SPI address byte" (section 8.1.2.3)
enum PCD_Register {
// Page 0: Command and status
// 0x00 // reserved for future use
CommandReg = 0x01 << 1, // starts and stops command execution
ComIEnReg = 0x02 << 1, // enable and disable interrupt request control bits
DivIEnReg = 0x03 << 1, // enable and disable interrupt request control bits
ComIrqReg = 0x04 << 1, // interrupt request bits
DivIrqReg = 0x05 << 1, // interrupt request bits
ErrorReg = 0x06 << 1, // error bits showing the error status of the last command executed
Status1Reg = 0x07 << 1, // communication status bits
Status2Reg = 0x08 << 1, // receiver and transmitter status bits
FIFODataReg = 0x09 << 1, // input and output of 64 byte FIFO buffer
FIFOLevelReg = 0x0A << 1, // number of bytes stored in the FIFO buffer
WaterLevelReg = 0x0B << 1, // level for FIFO underflow and overflow warning
ControlReg = 0x0C << 1, // miscellaneous control registers
BitFramingReg = 0x0D << 1, // adjustments for bit-oriented frames
CollReg = 0x0E << 1, // bit position of the first bit-collision detected on the RF interface
// 0x0F // reserved for future use
// Page 1: Command
// 0x10 // reserved for future use
ModeReg = 0x11 << 1, // defines general modes for transmitting and receiving
TxModeReg = 0x12 << 1, // defines transmission data rate and framing
RxModeReg = 0x13 << 1, // defines reception data rate and framing
TxControlReg = 0x14 << 1, // controls the logical behavior of the antenna driver pins TX1 and TX2
TxASKReg = 0x15 << 1, // controls the setting of the transmission modulation
TxSelReg = 0x16 << 1, // selects the internal sources for the antenna driver
RxSelReg = 0x17 << 1, // selects internal receiver settings
RxThresholdReg = 0x18 << 1, // selects thresholds for the bit decoder
DemodReg = 0x19 << 1, // defines demodulator settings
// 0x1A // reserved for future use
// 0x1B // reserved for future use
MfTxReg = 0x1C << 1, // controls some MIFARE communication transmit parameters
MfRxReg = 0x1D << 1, // controls some MIFARE communication receive parameters
// 0x1E // reserved for future use
SerialSpeedReg = 0x1F << 1, // selects the speed of the serial UART interface
// Page 2: Configuration
// 0x20 // reserved for future use
CRCResultRegH = 0x21 << 1, // shows the MSB and LSB values of the CRC calculation
CRCResultRegL = 0x22 << 1,
// 0x23 // reserved for future use
ModWidthReg = 0x24 << 1, // controls the ModWidth setting?
// 0x25 // reserved for future use
RFCfgReg = 0x26 << 1, // configures the receiver gain
GsNReg = 0x27 << 1, // selects the conductance of the antenna driver pins TX1 and TX2 for modulation
CWGsPReg = 0x28 << 1, // defines the conductance of the p-driver output during periods of no modulation
ModGsPReg = 0x29 << 1, // defines the conductance of the p-driver output during periods of modulation
TModeReg = 0x2A << 1, // defines settings for the internal timer
TPrescalerReg = 0x2B << 1, // the lower 8 bits of the TPrescaler value. The 4 high bits are in TModeReg.
TReloadRegH = 0x2C << 1, // defines the 16-bit timer reload value
TReloadRegL = 0x2D << 1,
TCounterValueRegH = 0x2E << 1, // shows the 16-bit timer value
TCounterValueRegL = 0x2F << 1,
// Page 3: Test Registers
// 0x30 // reserved for future use
TestSel1Reg = 0x31 << 1, // general test signal configuration
TestSel2Reg = 0x32 << 1, // general test signal configuration
TestPinEnReg = 0x33 << 1, // enables pin output driver on pins D1 to D7
TestPinValueReg = 0x34 << 1, // defines the values for D1 to D7 when it is used as an I/O bus
TestBusReg = 0x35 << 1, // shows the status of the internal test bus
AutoTestReg = 0x36 << 1, // controls the digital self test
VersionReg = 0x37 << 1, // shows the software version
AnalogTestReg = 0x38 << 1, // controls the pins AUX1 and AUX2
TestDAC1Reg = 0x39 << 1, // defines the test value for TestDAC1
TestDAC2Reg = 0x3A << 1, // defines the test value for TestDAC2
TestADCReg = 0x3B << 1 // shows the value of ADC I and Q channels
// 0x3C // reserved for production tests
// 0x3D // reserved for production tests
// 0x3E // reserved for production tests
// 0x3F // reserved for production tests
};
// MFRC522 commands. Described in chapter 10 of the datasheet.
enum PCD_Command {
PCD_Idle = 0x00, // no action, cancels current command execution
PCD_Mem = 0x01, // stores 25 bytes into the internal buffer
PCD_GenerateRandomID = 0x02, // generates a 10-byte random ID number
PCD_CalcCRC = 0x03, // activates the CRC coprocessor or performs a self test
PCD_Transmit = 0x04, // transmits data from the FIFO buffer
PCD_NoCmdChange = 0x07, // no command change, can be used to modify the CommandReg register bits without affecting the command, for example, the PowerDown bit
PCD_Receive = 0x08, // activates the receiver circuits
PCD_Transceive = 0x0C, // transmits data from FIFO buffer to antenna and automatically activates the receiver after transmission
PCD_MFAuthent = 0x0E, // performs the MIFARE standard authentication as a reader
PCD_SoftReset = 0x0F // resets the MFRC522
};
// MFRC522 RxGain[2:0] masks, defines the receiver's signal voltage gain factor (on the PCD).
// Described in 9.3.3.6 / table 98 of the datasheet at http://www.nxp.com/documents/data_sheet/MFRC522.pdf
enum PCD_RxGain {
RxGain_18dB = 0x00 << 4, // 000b - 18 dB, minimum
RxGain_23dB = 0x01 << 4, // 001b - 23 dB
RxGain_18dB_2 = 0x02 << 4, // 010b - 18 dB, it seems 010b is a duplicate for 000b
RxGain_23dB_2 = 0x03 << 4, // 011b - 23 dB, it seems 011b is a duplicate for 001b
RxGain_33dB = 0x04 << 4, // 100b - 33 dB, average, and typical default
RxGain_38dB = 0x05 << 4, // 101b - 38 dB
RxGain_43dB = 0x06 << 4, // 110b - 43 dB
RxGain_48dB = 0x07 << 4, // 111b - 48 dB, maximum
RxGain_min = 0x00 << 4, // 000b - 18 dB, minimum, convenience for RxGain_18dB
RxGain_avg = 0x04 << 4, // 100b - 33 dB, average, convenience for RxGain_33dB
RxGain_max = 0x07 << 4 // 111b - 48 dB, maximum, convenience for RxGain_48dB
};
// Commands sent to the PICC.
enum PICC_Command {
// The commands used by the PCD to manage communication with several PICCs (ISO 14443-3, Type A, section 6.4)
PICC_CMD_REQA = 0x26, // REQuest command, Type A. Invites PICCs in state IDLE to go to READY and prepare for anticollision or selection. 7 bit frame.
PICC_CMD_WUPA = 0x52, // Wake-UP command, Type A. Invites PICCs in state IDLE and HALT to go to READY(*) and prepare for anticollision or selection. 7 bit frame.
PICC_CMD_CT = 0x88, // Cascade Tag. Not really a command, but used during anti collision.
PICC_CMD_SEL_CL1 = 0x93, // Anti collision/Select, Cascade Level 1
PICC_CMD_SEL_CL2 = 0x95, // Anti collision/Select, Cascade Level 2
PICC_CMD_SEL_CL3 = 0x97, // Anti collision/Select, Cascade Level 3
PICC_CMD_HLTA = 0x50, // HaLT command, Type A. Instructs an ACTIVE PICC to go to state HALT.
// The commands used for MIFARE Classic (from http://www.nxp.com/documents/data_sheet/MF1S503x.pdf, Section 9)
// Use PCD_MFAuthent to authenticate access to a sector, then use these commands to read/write/modify the blocks on the sector.
// The read/write commands can also be used for MIFARE Ultralight.
PICC_CMD_MF_AUTH_KEY_A = 0x60, // Perform authentication with Key A
PICC_CMD_MF_AUTH_KEY_B = 0x61, // Perform authentication with Key B
PICC_CMD_MF_READ = 0x30, // Reads one 16 byte block from the authenticated sector of the PICC. Also used for MIFARE Ultralight.
PICC_CMD_MF_WRITE = 0xA0, // Writes one 16 byte block to the authenticated sector of the PICC. Called "COMPATIBILITY WRITE" for MIFARE Ultralight.
PICC_CMD_MF_DECREMENT = 0xC0, // Decrements the contents of a block and stores the result in the internal data register.
PICC_CMD_MF_INCREMENT = 0xC1, // Increments the contents of a block and stores the result in the internal data register.
PICC_CMD_MF_RESTORE = 0xC2, // Reads the contents of a block into the internal data register.
PICC_CMD_MF_TRANSFER = 0xB0, // Writes the contents of the internal data register to a block.
// The commands used for MIFARE Ultralight (from http://www.nxp.com/documents/data_sheet/MF0ICU1.pdf, Section 8.6)
// The PICC_CMD_MF_READ and PICC_CMD_MF_WRITE can also be used for MIFARE Ultralight.
PICC_CMD_UL_WRITE = 0xA2 // Writes one 4 byte page to the PICC.
};
// MIFARE constants that does not fit anywhere else
enum MIFARE_Misc {
MF_ACK = 0xA, // The MIFARE Classic uses a 4 bit ACK/NAK. Any other value than 0xA is NAK.
MF_KEY_SIZE = 6 // A Mifare Crypto1 key is 6 bytes.
};
// PICC types we can detect. Remember to update PICC_GetTypeName() if you add more.
enum PICC_Type {
PICC_TYPE_UNKNOWN = 0,
PICC_TYPE_ISO_14443_4 = 1, // PICC compliant with ISO/IEC 14443-4
PICC_TYPE_ISO_18092 = 2, // PICC compliant with ISO/IEC 18092 (NFC)
PICC_TYPE_MIFARE_MINI = 3, // MIFARE Classic protocol, 320 bytes
PICC_TYPE_MIFARE_1K = 4, // MIFARE Classic protocol, 1KB
PICC_TYPE_MIFARE_4K = 5, // MIFARE Classic protocol, 4KB
PICC_TYPE_MIFARE_UL = 6, // MIFARE Ultralight or Ultralight C
PICC_TYPE_MIFARE_PLUS = 7, // MIFARE Plus
PICC_TYPE_TNP3XXX = 8, // Only mentioned in NXP AN 10833 MIFARE Type Identification Procedure
PICC_TYPE_NOT_COMPLETE = 255 // SAK indicates UID is not complete.
};
// Return codes from the functions in this class. Remember to update GetStatusCodeName() if you add more.
enum StatusCode {
STATUS_OK = 1, // Success
STATUS_ERROR = 2, // Error in communication
STATUS_COLLISION = 3, // Collission detected
STATUS_TIMEOUT = 4, // Timeout in communication.
STATUS_NO_ROOM = 5, // A buffer is not big enough.
STATUS_INTERNAL_ERROR = 6, // Internal error in the code. Should not happen ;-)
STATUS_INVALID = 7, // Invalid argument.
STATUS_CRC_WRONG = 8, // The CRC_A does not match
STATUS_MIFARE_NACK = 9 // A MIFARE PICC responded with NAK.
};
// A struct used for passing the UID of a PICC.
typedef struct {
byte size; // Number of bytes in the UID. 4, 7 or 10.
byte uidByte[10];
byte sak; // The SAK (Select acknowledge) byte returned from the PICC after successful selection.
} Uid;
// A struct used for passing a MIFARE Crypto1 key
typedef struct {
byte keyByte[MF_KEY_SIZE];
} MIFARE_Key;
// Member variables
Uid uid; // Used by PICC_ReadCardSerial().
// Size of the MFRC522 FIFO
static const byte FIFO_SIZE = 64; // The FIFO is 64 bytes.
/////////////////////////////////////////////////////////////////////////////////////
// Functions for setting up the Raspberry Pi
/////////////////////////////////////////////////////////////////////////////////////
MFRC522();
void setSPIConfig();
/////////////////////////////////////////////////////////////////////////////////////
// Basic interface functions for communicating with the MFRC522
/////////////////////////////////////////////////////////////////////////////////////
void PCD_WriteRegister(byte reg, byte value);
void PCD_WriteRegister(byte reg, byte count, byte *values);
byte PCD_ReadRegister(byte reg);
void PCD_ReadRegister(byte reg, byte count, byte *values, byte rxAlign = 0);
void setBitMask(unsigned char reg, unsigned char mask);
void PCD_SetRegisterBitMask(byte reg, byte mask);
void PCD_ClearRegisterBitMask(byte reg, byte mask);
byte PCD_CalculateCRC(byte *data, byte length, byte *result);
/////////////////////////////////////////////////////////////////////////////////////
// Functions for manipulating the MFRC522
/////////////////////////////////////////////////////////////////////////////////////
void PCD_Init();
void PCD_Reset();
void PCD_AntennaOn();
void PCD_AntennaOff();
byte PCD_GetAntennaGain();
void PCD_SetAntennaGain(byte mask);
bool PCD_PerformSelfTest();
/////////////////////////////////////////////////////////////////////////////////////
// Functions for communicating with PICCs
/////////////////////////////////////////////////////////////////////////////////////
byte PCD_TransceiveData(byte *sendData, byte sendLen, byte *backData, byte *backLen, byte *validBits = NULL, byte rxAlign = 0, bool checkCRC = false);
byte PCD_CommunicateWithPICC(byte command, byte waitIRq, byte *sendData, byte sendLen, byte *backData = NULL, byte *backLen = NULL, byte *validBits = NULL, byte rxAlign = 0, bool checkCRC = false);
byte PICC_RequestA(byte *bufferATQA, byte *bufferSize);
byte PICC_WakeupA(byte *bufferATQA, byte *bufferSize);
byte PICC_REQA_or_WUPA(byte command, byte *bufferATQA, byte *bufferSize);
byte PICC_Select(Uid *uid, byte validBits = 0);
byte PICC_HaltA();
/////////////////////////////////////////////////////////////////////////////////////
// Functions for communicating with MIFARE PICCs
/////////////////////////////////////////////////////////////////////////////////////
byte PCD_Authenticate(byte command, byte blockAddr, MIFARE_Key *key, Uid *uid);
void PCD_StopCrypto1();
byte MIFARE_Read(byte blockAddr, byte *buffer, byte *bufferSize);
byte MIFARE_Write(byte blockAddr, byte *buffer, byte bufferSize);
byte MIFARE_Decrement(byte blockAddr, long delta);
byte MIFARE_Increment(byte blockAddr, long delta);
byte MIFARE_Restore(byte blockAddr);
byte MIFARE_Transfer(byte blockAddr);
byte MIFARE_Ultralight_Write(byte page, byte *buffer, byte bufferSize);
byte MIFARE_GetValue(byte blockAddr, long *value);
byte MIFARE_SetValue(byte blockAddr, long value);
/////////////////////////////////////////////////////////////////////////////////////
// Support functions
/////////////////////////////////////////////////////////////////////////////////////
byte PCD_MIFARE_Transceive(byte *sendData, byte sendLen, bool acceptTimeout = false);
// old function used too much memory, now name moved to flash; if you need char, copy from flash to memory
//const char *GetStatusCodeName(byte code);
const string GetStatusCodeName(byte code);
byte PICC_GetType(byte sak);
// old function used too much memory, now name moved to flash; if you need char, copy from flash to memory
//const char *PICC_GetTypeName(byte type);
const string PICC_GetTypeName(byte type);
void PICC_DumpToSerial(Uid *uid);
void PICC_DumpMifareClassicToSerial(Uid *uid, byte piccType, MIFARE_Key *key);
void PICC_DumpMifareClassicSectorToSerial(Uid *uid, MIFARE_Key *key, byte sector);
void PICC_DumpMifareUltralightToSerial();
void MIFARE_SetAccessBits(byte *accessBitBuffer, byte g0, byte g1, byte g2, byte g3);
bool MIFARE_OpenUidBackdoor(bool logErrors);
bool MIFARE_SetUid(byte *newUid, byte uidSize, bool logErrors);
bool MIFARE_UnbrickUidSector(bool logErrors);
/////////////////////////////////////////////////////////////////////////////////////
// Convenience functions - does not add extra functionality
/////////////////////////////////////////////////////////////////////////////////////
bool PICC_IsNewCardPresent();
bool PICC_ReadCardSerial();
private:
byte MIFARE_TwoStepHelper(byte command, byte blockAddr, long data);
};
#endif

1129
kawaii/bcm2835.h Normal file

File diff suppressed because it is too large Load Diff

29
kawaii/emergency_stop.cpp Normal file
View File

@@ -0,0 +1,29 @@
//
// Created by Simon Wörner on 16.06.17.
//
#include "emergency_stop.h"
#include <cstddef>
extern "C" {
void *emergency_stop_init(uint8_t port);
void emergency_stop_clean(void *emergency_stop);
bool emergency_stop_get_state(void *emergency_stop);
}
emergency_stop::emergency_stop(uint8_t port)
{
rust_emergency_stop = emergency_stop_init(port);
}
emergency_stop::~emergency_stop()
{
emergency_stop_clean(rust_emergency_stop);
rust_emergency_stop = NULL;
}
bool emergency_stop::get_state() const
{
return emergency_stop_get_state(rust_emergency_stop);
}

24
kawaii/emergency_stop.h Normal file
View File

@@ -0,0 +1,24 @@
//
// Created by Simon Wörner on 16.06.17.
//
#ifndef KAWAII_ENGINE_EMERGENCY_STOP_H
#define KAWAII_ENGINE_EMERGENCY_STOP_H
#include <cstdint>
class emergency_stop
{
private:
void *rust_emergency_stop;
public:
emergency_stop(uint8_t port);
emergency_stop(const emergency_stop &) = delete;
emergency_stop(const emergency_stop &&) = delete;
bool get_state() const;
~emergency_stop();
};
#endif //KAWAII_ENGINE_EMERGENCY_STOP_H

79
kawaii/engine.cpp Normal file
View File

@@ -0,0 +1,79 @@
#include "engine.hpp"
#include <chrono>
#include <utility>
using namespace std;
using namespace std::chrono;
engine::engine(gpio&& pin_forward, gpio&& pin_reverse)
: speed(0),
pin_forward(move(pin_forward)),
pin_reverse(move(pin_reverse)),
stop_thread(false),
measurement(string("engine") + to_string(this->pin_forward.get_pin()))
{
this->pin_forward.set_value(false);
this->pin_reverse.set_value(false);
pwm_thread = thread(&engine::pwm_loop, this);
}
engine::~engine()
{
stop_thread = true;
pwm_thread.join();
}
void engine::set_speed(int speed)
{
this->speed.store(speed, memory_order_relaxed);
}
void engine::pwm_loop()
{
this_thread::sleep_for(milliseconds(100));
const int sleep_msec = 1;
int counter = 0;
high_resolution_clock::time_point next_sleep_target = high_resolution_clock::now();
while (!stop_thread)
{
measurement.start();
direction target_direction;
int speed_val = speed.load(memory_order_relaxed);
if (speed_val < 0)
{
target_direction = direction::REVERSE;
speed_val *= -1;
}
else
{
target_direction = direction::FORWARD;
}
counter += sleep_msec;
if (counter >= 100)
counter = 0;
if (counter < speed_val)
{
if (target_direction == direction::FORWARD)
{
pin_reverse.set_value(false);
pin_forward.set_value(true);
}
else
{
pin_forward.set_value(false);
pin_reverse.set_value(true);
}
}
else
{
pin_forward.set_value(false);
pin_reverse.set_value(false);
}
measurement.stop();
next_sleep_target += 500us;
this_thread::sleep_until(next_sleep_target);
}
pin_forward.set_value(false);
pin_reverse.set_value(false);
}

31
kawaii/engine.hpp Normal file
View File

@@ -0,0 +1,31 @@
#ifndef ENGINE_HPP_
#define ENGINE_HPP_
#include <atomic>
#include <thread>
#include "gpio.hpp"
#include "measure.hpp"
class engine
{
public:
enum class direction
{
FORWARD,
REVERSE
};
private:
std::atomic<int> speed;
gpio pin_forward;
gpio pin_reverse;
std::atomic<bool> stop_thread;
std::thread pwm_thread;
measure measurement;
void pwm_loop();
public:
engine(gpio&& pin_forward, gpio&& pin_reverse);
~engine();
void set_speed(int speed);
};
#endif

109
kawaii/gpio.cpp Normal file
View File

@@ -0,0 +1,109 @@
#include "gpio.hpp"
#include <fstream>
#include <sstream>
#include <stdexcept>
#include <string>
using namespace std;
static string construct_filename(const string &prefix, int pin, const string &suffix)
{
stringstream filename;
filename << prefix << pin << suffix;
return filename.str();
}
gpio::gpio(int pin, pin_direction direction, pin_type type, bool default_state)
: pin(pin),
direction(direction),
type(type),
current_state(false)
{
ofstream export_file("/sys/class/gpio/export");
export_file << pin;
export_file.close();
ofstream direction_file(construct_filename("/sys/class/gpio/gpio", pin, "/direction").c_str());
if (direction == pin_direction::INPUT)
{
direction_file << "in";
}
else
{
direction_file << "out";
}
direction_file.close();
if (direction == pin_direction::OUTPUT)
{
set_value(default_state, false);
}
}
gpio::gpio(gpio&& old)
: pin(old.pin),
direction(old.direction),
type(old.type),
current_state(old.current_state)
{
old.pin = -1;
}
gpio::~gpio()
{
if (pin != -1)
{
ofstream unexport_file("/sys/class/gpio/unexport");
unexport_file << pin;
}
}
void gpio::set_value(bool on, bool use_cache)
{
if (pin == -1)
throw logic_error("Usage of moved gpio");
if (direction == pin_direction::INPUT)
{
stringstream errormsg;
errormsg << "Cannot write to input pin " << pin;
throw logic_error(errormsg.str());
}
if (!use_cache || current_state != on)
{
bool value;
if (type == pin_type::HIGH_ON)
value = on;
else
value = !on;
ofstream value_file(construct_filename("/sys/class/gpio/gpio", pin, "/value"));
value_file << value;
}
current_state = on;
}
void gpio::set_value(bool on)
{
set_value(on, true);
}
bool gpio::get_value()
{
if (pin == -1)
throw logic_error("Usage of moved gpio");
if (direction == pin_direction::OUTPUT)
return current_state;
ifstream value_file(construct_filename("/sys/class/gpio/gpio", pin, "/value"));
bool value;
value_file >> value;
bool on;
if (type == pin_type::HIGH_ON)
on = value;
else
on = !value;
return on;
}
int gpio::get_pin() const
{
return pin;
}

34
kawaii/gpio.hpp Normal file
View File

@@ -0,0 +1,34 @@
#ifndef GPIO_HPP_
#define GPIO_HPP_
class gpio
{
public:
enum class pin_direction
{
INPUT,
OUTPUT
};
enum class pin_type
{
HIGH_ON,
LOW_ON
};
private:
int pin;
pin_direction direction;
pin_type type;
bool current_state;
void set_value(bool on, bool use_cache);
public:
gpio(int pin, pin_direction, pin_type=pin_type::HIGH_ON, bool default_state=false);
gpio(const gpio&) = delete;
gpio(gpio&&);
~gpio();
void set_value(bool on);
bool get_value();
int get_pin() const;
};
#endif

4
kawaii/kawaii-rs/.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
Cargo.lock
target/
**/*.rs.bk
*.iml

View File

@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.0)
project(kawaii-rs)
include(ExternalProject)
if (MEASURE)
set(CARGO_FEATURES "${CARGO_FEATURES} measure")
endif (MEASURE)
if (CARGO_FEATURES)
set(CARGO_ARGUMENTS --features "${CARGO_FEATURES}")
endif(CARGO_FEATURES)
file(GLOB RUST_SOURCE_FILES "${PROJECT_SOURCE_DIR}/src" *.rs)
add_custom_target(${PROJECT_NAME}
COMMAND cargo build --color=never ${CARGO_ARGUMENTS}
COMMAND cargo build --color=never ${CARGO_ARGUMENTS} --release
DEPENDS ${RUST_SOURCE_FILES}
BYPRODUCTS target/debug/libkawaii.a target/release/libkawaii.a
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
SOURCES ${RUST_SOURCE_FILES})

View File

@@ -0,0 +1,19 @@
[package]
name = "kawaii-rs-api"
version = "0.1.0"
authors = ["Simon Wörner <git@simon-woerner.de>"]
[lib]
name = "kawaii_api"
crate-type = ["staticlib"]
[features]
measure = [
"kawaii/measure",
"emergency_stop/measure",
"ultrasonic_irq/measure" ]
[dependencies]
emergency_stop = { git = "https://git.brn.li/kawaii-robotto/emergency-stop.git" }
kawaii = { git = "https://git.brn.li/kawaii-robotto/kawaii-rs.git" }
ultrasonic_irq = { git = "https://git.brn.li/kawaii-robotto/ultrasonic-irq.git" }

View File

@@ -0,0 +1,8 @@
CMakeFiles/
Makefile
cmake_install.cmake
emergency-stop-prefix/
emergency-stop.cbp
target/
**/*.rs.bk
*.iml

View File

@@ -0,0 +1,14 @@
[package]
name = "emergency_stop"
version = "0.1.0"
authors = ["Simon Wörner <git@simon-woerner.de>"]
[[bin]]
name = "emergency_stop-test"
doc = false
[features]
measure = ["kawaii/measure"]
[dependencies]
kawaii = { git = "https://git.brn.li/kawaii-robotto/kawaii-rs.git" }

View File

@@ -0,0 +1,102 @@
extern crate kawaii;
use std::time::Duration;
use std::thread;
use std::thread::JoinHandle;
use std::sync::Arc;
use std::sync::atomic::{AtomicBool, Ordering};
use self::kawaii::gpio::{AsyncPort, Edge, Value};
#[cfg(feature = "measure")]
use self::kawaii::Measure;
#[derive(Debug)]
pub struct EmergencyStop {
thread: Option<JoinHandle<()>>,
pub state: Arc<AtomicBool>,
}
impl EmergencyStop {
/// Constructs a new `EmergencyStop` and starts poll thread.
///
/// # Parameter
/// - `stop_port` GPIO Port number of emergency stop pin.
pub fn new(stop_port: u8) -> std::io::Result<Self> {
let name = format!("EmergencyStop(port = {})", stop_port);
let state = Arc::new(AtomicBool::new(false));
let mut port = AsyncPort::new(stop_port, Edge::Both)?;
let state_clone = state.clone();
let thread = thread::Builder::new()
.name(name)
.spawn(move || EmergencyStop::thread(&mut port, state_clone))?;
Ok(EmergencyStop {
thread: Some(thread),
state: state,
})
}
/// Emergency stop poll thread
fn thread(port: &mut AsyncPort, state: Arc<AtomicBool>) {
#[cfg(feature = "measure")]
let mut measure = Measure::new(format!("EmergencyStop(port = {})", port.port.number));
// clear first value
port.poll(Some(Duration::new(0, 0))).is_ok();
while !state.load(Ordering::Relaxed) {
#[cfg(feature = "measure")]
measure.start();
let timeout = Some(Duration::new(1, 0));
#[cfg(not(feature = "measure"))]
let value = port.poll(timeout);
#[cfg(feature = "measure")]
let value = port.poll_measure(timeout, &mut measure);
// continue on timeout
match value {
Ok(value) => {
if let Some(value) = value {
match value {
Value::High => {
#[cfg(debug_assertions)]
println!("EmergencyStop! ({:?})", value);
state.store(true, Ordering::Relaxed);
}
_ => {
#[cfg(debug_assertions)]
println!("EmergencyStop ignored: ({:?})", value);
}
}
}
}
Err(e) => {
#[cfg(debug_assertions)]
println!("EmergencyStop! ({:?})", e);
state.store(true, Ordering::Relaxed);
}
}
#[cfg(feature = "measure")]
measure.stop();
}
}
}
impl Drop for EmergencyStop {
/// Set emergency stop and join poll thread.
fn drop(&mut self) {
self.state.store(true, Ordering::Relaxed);
if let Some(thread) = self.thread.take() {
thread.join().is_ok();
}
}
}

View File

@@ -0,0 +1,21 @@
extern crate emergency_stop;
use emergency_stop::EmergencyStop;
use std::time::Duration;
use std::thread::sleep;
use std::sync::atomic::Ordering;
static GPIO_PORT_STOP: u8 = 25;
fn main() {
let emergency_stop = EmergencyStop::new(GPIO_PORT_STOP).expect("Create Emergency Stop failed");
println!("{:?}", emergency_stop);
while !emergency_stop.state.load(Ordering::Relaxed) {
sleep(Duration::new(1, 0));
}
println!("Stopped.");
}

View File

@@ -0,0 +1,4 @@
Cargo.lock
target/
**/*.rs.bk
*.iml

View File

@@ -0,0 +1,17 @@
[package]
name = "kawaii"
version = "0.1.0"
authors = ["Simon Wörner <git@simon-woerner.de>"]
[[bin]]
name = "kawaii-test"
doc = false
[features]
measure = []
[dependencies]
nix = "0.8.1"
regex = "^0.2"
separator = "^0.3.1"
time = "^0.1.36"

View File

@@ -0,0 +1,320 @@
extern crate std;
extern crate nix;
use std::fmt;
use std::time::Duration;
use std::io::prelude::*;
use std::io::{Error, ErrorKind, SeekFrom};
use std::fs::File;
use std::path::Path;
use std::os::unix::io::RawFd;
#[cfg(feature = "measure")]
use measure::Measure;
fn duration_to_ms(duration: Duration) -> u64 {
duration.as_secs() * 1_000u64 + duration.subsec_nanos() as u64 / 1_000_000u64
}
#[derive(Clone, Copy, Debug)]
pub enum Direction {
Out,
In,
}
impl Direction {
pub fn from_str(s: &str) -> Option<Direction> {
match s {
"out" => Some(Direction::Out),
"in" => Some(Direction::In),
_ => None,
}
}
pub fn as_str(&self) -> &'static str {
match *self {
Direction::Out => "out",
Direction::In => "in",
}
}
}
#[derive(Clone, Copy, Debug)]
pub enum Edge {
None,
Rising,
Falling,
Both,
}
impl Edge {
pub fn from_str(s: &str) -> Option<Edge> {
match s {
"none" => Some(Edge::None),
"rising" => Some(Edge::Rising),
"falling" => Some(Edge::Falling),
"both" => Some(Edge::Both),
_ => None,
}
}
pub fn as_str(&self) -> &'static str {
match *self {
Edge::None => "none",
Edge::Rising => "rising",
Edge::Falling => "falling",
Edge::Both => "both",
}
}
}
#[derive(Clone, Copy, Debug)]
pub enum Value {
High,
Low,
}
impl Value {
pub fn from_str(s: &str) -> Option<Value> {
match s {
"1" => Some(Value::High),
"0" => Some(Value::Low),
_ => None,
}
}
pub fn from_buffer(b: &[u8; 1]) -> Option<Self> {
Value::from_char(b[0])
}
pub fn from_char(c: u8) -> Option<Self> {
match c {
48 => Some(Value::Low), // '0'
49 => Some(Value::High), // '1'
_ => None,
}
}
pub fn as_str(&self) -> &'static str {
match *self {
Value::High => "1",
Value::Low => "0",
}
}
}
#[derive(Debug)]
pub struct Port {
pub number: u8,
pub direction: Direction,
}
#[derive(Debug)]
pub struct SyncPort {
pub port: Port,
file: File,
buffer: [u8; 1],
}
pub struct AsyncPort {
pub port: Port,
pub edge: Edge,
file: RawFd,
fds: [nix::poll::PollFd; 1],
buffer: [u8; 1],
}
impl fmt::Debug for AsyncPort {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f,
"AsyncPort {{ port: {:?}, edge: {:?}, file: {:?}, fds: [?], buffer: {:?} }}",
self.port,
self.edge,
self.file,
self.buffer)
}
}
impl Port {
/// Constructs a new GPIO `Port`.
///
/// # Parameter
/// - `number` GPIO Port number of pin.
/// - `direction` GPIO Port direction.
pub fn new(number: u8, direction: Direction) -> std::io::Result<Port> {
let port = Port {
number: number,
direction: direction,
};
port.init()?;
Ok(port)
}
/// Init GPIO `Port`: export port and set direction
fn init(&self) -> std::io::Result<()> {
self.export().ok();
self.set_direction()?;
Ok(())
}
/// Drop GPIO `Port`: unexport
pub fn drop(&mut self) {
self.unexport().ok();
}
fn write_path(path: &str, value: &str) -> std::io::Result<()> {
File::create(Path::new(path))?
.write_all(value.as_bytes())
}
/// Export GPIO `Port`
fn export(&self) -> std::io::Result<()> {
Port::write_path("/sys/class/gpio/export", self.number.to_string().as_str())
}
/// Unexport GPIO `Port`
fn unexport(&self) -> std::io::Result<()> {
Port::write_path("/sys/class/gpio/unexport", self.number.to_string().as_str())
}
/// Set GPIO `Port` direction
fn set_direction(&self) -> std::io::Result<()> {
Port::write_path(format!("/sys/class/gpio/gpio{}/direction", self.number).as_str(),
self.direction.as_str())
}
}
impl SyncPort {
/// Constructs a new synchronised GPIO `Port`.
///
/// # Parameter
/// - `number` GPIO Port number of pin.
/// - `direction` GPIO Port direction.
pub fn new(number: u8, direction: Direction) -> std::io::Result<SyncPort> {
Ok(SyncPort {
port: Port::new(number, direction)?,
file: SyncPort::open(number, direction)?,
buffer: [0; 1],
})
}
/// Open GPIO `SyncPort` sysfs file
fn open(number: u8, direction: Direction) -> std::io::Result<File> {
let path = format!("/sys/class/gpio/gpio{}/value", number);
let path = Path::new(path.as_str());
Ok(match direction {
Direction::Out => File::create(path)?,
Direction::In => File::open(path)?,
})
}
/// Read from GPIO `SyncPort` sysfs file
pub fn read(&mut self) -> std::io::Result<Value> {
self.file.seek(SeekFrom::Start(0))?;
self.file.read_exact(&mut self.buffer)?;
Value::from_buffer(&self.buffer).ok_or(Error::new(ErrorKind::InvalidData,
"Unrecognized GPIO Value"))
}
/// Write to GPIO `SyncPort` sysfs file
pub fn write(&mut self, value: Value) -> std::io::Result<()> {
self.file.write_all(value.as_str().as_bytes())
}
}
impl AsyncPort {
/// Constructs a new asynchronous GPIO `Port`.
///
/// # Parameter
/// - `number` GPIO Port number of pin.
/// - `edge` GPIO Port edge detection setting.
pub fn new(number: u8, edge: Edge) -> std::io::Result<AsyncPort> {
let port = Port::new(number, Direction::In)?;
let file = AsyncPort::open(number)?;
let port = AsyncPort {
port: port,
edge: edge,
file: file,
fds: [nix::poll::PollFd::new(file, nix::poll::POLLPRI, nix::poll::EventFlags::empty())],
buffer: [0; 1],
};
port.init()?;
Ok(port)
}
/// Init GPIO `Port`: set edge detection
fn init(&self) -> std::io::Result<()> {
self.set_edge()?;
Ok(())
}
/// Open GPIO `AsyncPort` sysfs file with posix API
fn open(number: u8) -> std::io::Result<RawFd> {
nix::fcntl::open(format!("/sys/class/gpio/gpio{}/value", number).as_str(),
nix::fcntl::O_RDONLY,
nix::sys::stat::Mode::empty())
.or(Err(Error::new(ErrorKind::Other, "open failed")))
}
fn get_timeout(timeout: Option<Duration>) -> i32 {
match timeout {
None => -1,
Some(t) => duration_to_ms(t) as i32,
}
}
/// Posix poll on sysfs file
fn nix_poll(&mut self, timeout: i32) -> nix::Result<i32> {
nix::poll::poll(&mut self.fds, timeout)
}
/// Read from GPIO `AsyncPort` sysfs file with posix poll
fn poll_read(&mut self, poll: nix::Result<i32>) -> std::io::Result<Option<Value>> {
let poll = poll.or(Err(Error::new(ErrorKind::Other, "poll failed")))?;
if poll == 0 {
return Ok(None);
}
nix::unistd::lseek(self.file, 0, nix::unistd::Whence::SeekSet)
.or(Err(Error::new(ErrorKind::Other, "lseek failed")))?;
nix::unistd::read(self.file, &mut self.buffer)
.or(Err(Error::new(ErrorKind::Other, "read failed")))?;
Value::from_buffer(&self.buffer).map_or(Err(Error::new(ErrorKind::InvalidData,
"Unrecognized GPIO Value")),
|v| Ok(Some(v)))
}
/// Read asynchronous from GPIO `AsyncPort` sysfs file
pub fn poll(&mut self, timeout: Option<Duration>) -> std::io::Result<Option<Value>> {
let poll = self.nix_poll(Self::get_timeout(timeout));
self.poll_read(poll)
}
/// Read asynchronous from GPIO `AsyncPort` sysfs file with measure support (ignore poll time)
#[cfg(feature = "measure")]
pub fn poll_measure(&mut self,
timeout: Option<Duration>,
measure: &mut Measure)
-> std::io::Result<Option<Value>> {
let timeout = Self::get_timeout(timeout);
measure.pause();
let poll = self.nix_poll(timeout);
measure.start();
self.poll_read(poll)
}
/// Set GPIO `Port` edge detection
fn set_edge(&self) -> std::io::Result<()> {
Port::write_path(format!("/sys/class/gpio/gpio{}/edge", self.port.number).as_str(),
self.edge.as_str())
}
}

View File

@@ -0,0 +1,7 @@
pub mod gpio;
#[cfg(feature = "measure")]
mod measure;
#[cfg(feature = "measure")]
pub use measure::Measure;

View File

@@ -0,0 +1,35 @@
extern crate kawaii;
use std::time::Duration;
use kawaii::gpio::{SyncPort, AsyncPort, Direction, Edge, Value};
#[cfg(feature = "measure")]
use kawaii::measure::Measure;
fn main() {
println!("Hello, world!");
#[cfg(feature = "measure")]
{
let mut measure = Measure::new(String::from("main({test: 1})"));
for _ in 0..5 {
measure.start();
std::thread::sleep(Duration::new(0, 1_000_000));
measure.stop();
}
println!("{:?}", measure);
}
let mut trigger = SyncPort::new(27, Direction::Out).expect("Create Trigger GPIO failed");
let mut echo = AsyncPort::new(28, Edge::Both).expect("Create Echo GPIO failed");
println!("trigger = {:?}", trigger.read());
trigger.write(Value::High).expect("write failed");
println!("trigger = {:?}", trigger.read());
trigger.write(Value::Low).expect("write failed");
println!("trigger = {:?}", trigger.read());
println!("echo = {:?}", echo.poll(Some(Duration::new(1, 0))));
}

View File

@@ -0,0 +1,119 @@
extern crate regex;
extern crate separator;
extern crate time;
use std;
use std::fs::File;
use std::io::prelude::*;
use std::io::{Error, ErrorKind};
use self::regex::Regex;
use self::separator::Separatable;
use self::time::precise_time_ns;
#[derive(Debug)]
pub struct Measure {
pub min: u64,
pub max: u64,
time: u64,
last: u64,
data: Vec<u64>,
pub name: String,
}
impl Measure {
/// Constructs a new `Measure`.
///
/// # Parameter
/// - `name` Name of measured component.
pub fn new(name: String) -> Self {
Measure {
min: u64::max_value(),
max: 0u64,
time: 0u64,
last: 0u64,
data: Vec::with_capacity(1_000_000),
name: name,
}
}
/// Start measurement
pub fn start(&mut self) {
self.last = precise_time_ns();
}
/// Pause measurement
pub fn pause(&mut self) {
if self.last == 0 {
#[cfg(debug_assertions)]
println!("WARNING: {:?} pause called without start!", self);
return;
}
self.time += self.time_diff();
}
/// Stop measurement and calculate time difference
pub fn stop(&mut self) {
if self.last == 0 {
#[cfg(debug_assertions)]
println!("WARNING: {:?} stop called without start!", self);
return;
}
self.time += self.time_diff();
self.data.push(self.time);
if self.time < self.min {
self.min = self.time;
}
if self.time > self.max {
self.max = self.time;
}
self.time = 0u64;
self.last = 0u64;
}
fn time_diff(&mut self) -> u64 {
let current_time = precise_time_ns();
let time_diff = current_time - self.last;
self.last = current_time;
time_diff
}
fn write_data(&self) -> std::io::Result<()> {
let re = Regex::new(r"[^\w\-.]")
.or(Err(Error::new(ErrorKind::Other, "Create filename regex failed.")))?;
let file_name = format!("measure_{}.txt", self.name);
let file_name = re.replace_all(file_name.as_str(), "_").to_string();
println!("{}: Write data to {}", self.name, file_name);
let mut file = File::create(file_name)?;
for value in &self.data {
file.write_fmt(format_args!("{}\n", value))?;
}
Ok(())
}
}
impl Drop for Measure {
/// Print measure results and write times to file
fn drop(&mut self) {
println!("{}:\n\tmin: {} ns\n\tmax: {} ns",
self.name,
self.min.separated_string(),
self.max.separated_string());
if let Err(e) = self.write_data() {
println!("{}: Write measure data failed: {}", self.name, e);
}
}
}

View File

@@ -0,0 +1,7 @@
CMakeFiles/
Makefile
cmake_install.cmake
ultrasonic-irq-prefix/
ultrasonic-irq.cbp
target/
**/*.rs.bk

View File

@@ -0,0 +1,16 @@
[package]
name = "ultrasonic_irq"
version = "0.1.0"
authors = ["kawaii <root@kawaii.home.lost-in-space.net>"]
[[bin]]
name = 'ultrasonic_irq-test'
doc = false
[features]
measure = ["kawaii/measure"]
[dependencies]
time = "^0.1.36"
shuteye = "^0.3.2"
kawaii = { git = "https://git.brn.li/kawaii-robotto/kawaii-rs.git" }

View File

@@ -0,0 +1,215 @@
#![feature(integer_atomics)]
extern crate time;
extern crate shuteye;
extern crate kawaii;
use std::time::Duration;
use std::thread;
use std::thread::JoinHandle;
use std::sync::mpsc::{Sender, Receiver};
use std::sync::mpsc;
use std::sync::Arc;
use std::sync::atomic::{AtomicU32, Ordering};
use self::kawaii::gpio::{SyncPort, AsyncPort, Direction, Edge, Value};
#[cfg(feature = "measure")]
use self::kawaii::Measure;
use self::time::precise_time_ns;
use self::shuteye::sleep;
#[derive(Debug)]
struct ThreadData<T> {
thread: JoinHandle<T>,
tx: Sender<()>,
}
#[derive(Debug)]
pub struct UltrasonicEcho {
echo: AsyncPort,
temperature: u8,
timestamp: u64,
distance: Arc<AtomicU32>,
}
#[derive(Debug)]
pub struct UltrasonicTrigger {
trigger: SyncPort,
}
#[derive(Debug)]
pub struct Ultrasonic {
trigger: Option<ThreadData<()>>,
echo: Option<ThreadData<()>>,
pub distance: Arc<AtomicU32>,
}
impl Ultrasonic {
/// Constructs a new `Ultrasonic` and start threads.
///
/// # Threads
/// - `UltrasonicTrigger`
/// - `UltrasonicEcho`
///
/// # Parameter
/// - `trigger_port` GPIO Port number of trigger pin.
/// - `echo_port` GPIO Port number of echo pin.
/// - `temperature` Room temperature in °C.
pub fn new(trigger_port: u8, echo_port: u8, temperature: u8) -> std::io::Result<Ultrasonic> {
let distance = Arc::new(AtomicU32::new(u32::max_value()));
/// Create `UltrasonicEcho` thread with sync channel.
let echo = UltrasonicEcho {
echo: AsyncPort::new(echo_port, Edge::Both)?,
temperature: temperature,
timestamp: 0,
distance: distance.clone(),
};
let (tx, rx): (Sender<()>, Receiver<()>) = mpsc::channel();
let name = format!("Ultrasonic::echo(port = {})", echo_port);
let echo = ThreadData::<()> {
thread: thread::Builder::new()
.name(name)
.spawn(move || echo.thread(rx))?,
tx: tx,
};
/// Create `UltrasonicTrigger` thread with sync channel.
let trigger = UltrasonicTrigger { trigger: SyncPort::new(trigger_port, Direction::Out)? };
let (tx, rx): (Sender<()>, Receiver<()>) = mpsc::channel();
let name = format!("Ultrasonic::trigger(port = {})", trigger_port);
let trigger = ThreadData::<()> {
thread: thread::Builder::new()
.name(name)
.spawn(move || trigger.thread(rx))?,
tx: tx,
};
Ok(Ultrasonic {
trigger: Some(trigger),
echo: Some(echo),
distance: distance,
})
}
}
impl Drop for Ultrasonic {
/// Drop sync channels and join threads.
fn drop(&mut self) {
if let Some(echo) = self.echo.take() {
echo.tx.send(()).is_ok();
echo.thread.join().is_ok();
}
if let Some(trigger) = self.trigger.take() {
trigger.tx.send(()).is_ok();
trigger.thread.join().is_ok();
}
}
}
impl UltrasonicTrigger {
/// `UltrasonicTrigger` thread function.
fn thread(mut self, stop_rx: Receiver<()>) {
#[cfg(feature = "measure")]
let mut measure = Measure::new(format!("Ultrasonic::trigger(port = {})",
self.trigger.port.number));
while stop_rx.try_recv().is_err() {
#[cfg(feature = "measure")]
measure.start();
self.trigger.write(Value::Low).is_ok();
#[cfg(feature = "measure")]
measure.pause();
// sleep 10us (min length to trigger)
sleep(Duration::new(0, 10_000));
#[cfg(feature = "measure")]
measure.start();
self.trigger.write(Value::High).is_ok();
#[cfg(feature = "measure")]
measure.stop();
// sleep 20ms (max trigger frequency)
sleep(Duration::new(0, 20_000_000));
}
}
}
impl UltrasonicEcho {
/// `UltrasonicEcho` thread function.
fn thread(mut self, stop_rx: Receiver<()>) {
#[cfg(feature = "measure")]
let mut measure = Measure::new(format!("Ultrasonic::echo(port = {})",
self.echo.port.number));
while stop_rx.try_recv().is_err() {
#[cfg(feature = "measure")]
measure.start();
#[cfg(not(feature = "measure"))]
let value = self.echo.poll(Some(Duration::new(1, 0)));
#[cfg(feature = "measure")]
let value = self.echo
.poll_measure(Some(Duration::new(1, 0)), &mut measure);
match value {
Ok(value) => {
if let Some(value) = value {
self.on_value_changed(value);
}
}
Err(_e) => {
#[cfg(debug_assertions)]
println!("POLL failed: e = {:?}", _e);
}
}
#[cfg(feature = "measure")]
measure.stop();
}
}
/// Start time measure or calculates distance based on port value
fn on_value_changed(&mut self, value: Value) {
match value {
Value::High => {
// Switched from Value::High to Value::High
// possibly because of trigger after timeout and slow reading
if self.timestamp > 0 {
#[cfg(debug_assertions)]
println!("{:?}", self);
self.calc_distance();
}
self.timestamp = precise_time_ns();
}
Value::Low => {
// Switched from Value::Low to Value::Low
if self.timestamp == 0 {
#[cfg(debug_assertions)]
println!("{:?}", self);
}
self.calc_distance();
}
}
}
/// Calculates distance based on time measurement and `temperature` and stores it in `distance`
fn calc_distance(&mut self) {
let time_diff = precise_time_ns() - self.timestamp;
let distance = (3315 + self.temperature as u64 * 6) * time_diff / 20_000_000;
self.distance.store(distance as u32, Ordering::Relaxed);
#[cfg(debug_assertions)]
println!("time diff: {}\tdistance: {}mm", time_diff, distance);
self.timestamp = 0u64;
}
}

View File

@@ -0,0 +1,21 @@
extern crate shuteye;
extern crate ultrasonic_irq;
use std::time::Duration;
use std::thread::sleep;
use ultrasonic_irq::Ultrasonic;
static GPIO_PORT_TRIG: u8 = 23;
static GPIO_PORT_ECHO: u8 = 24;
static TEMPERATURE: u8 = 20;
fn main() {
let ultrasonic = Ultrasonic::new(GPIO_PORT_TRIG, GPIO_PORT_ECHO, TEMPERATURE)
.expect("Create Ultrasonic failed");
println!("{:?}", ultrasonic);
sleep(Duration::new(10, 0));
}

0
kawaii/kawaii-rs/doc/.lock Executable file
View File

View File

@@ -0,0 +1,59 @@
These documentation pages include resources by third parties. This copyright
file applies only to those resources. The following third party resources are
included, and carry their own copyright notices and license terms:
* Fira Sans (FiraSans-Regular.woff, FiraSans-Medium.woff):
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
with Reserved Font Name Fira Sans.
Copyright (c) 2014, Telefonica S.A.
Licensed under the SIL Open Font License, Version 1.1.
See FiraSans-LICENSE.txt.
* Heuristica (Heuristica-Italic.woff):
Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved.
Utopia is either a registered trademark or trademark of Adobe Systems
Incorporated in the United States and/or other countries. Used under
license.
Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net
Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
with Reserved Font Name Heuristica.
Licensed under the SIL Open Font License, Version 1.1.
See Heuristica-LICENSE.txt.
* rustdoc.css, main.js, and playpen.js:
Copyright 2015 The Rust Developers.
Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or
the MIT license (LICENSE-MIT.txt) at your option.
* normalize.css:
Copyright (c) Nicolas Gallagher and Jonathan Neal.
Licensed under the MIT license (see LICENSE-MIT.txt).
* Source Code Pro (SourceCodePro-Regular.woff, SourceCodePro-Semibold.woff):
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/),
with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark
of Adobe Systems Incorporated in the United States and/or other countries.
Licensed under the SIL Open Font License, Version 1.1.
See SourceCodePro-LICENSE.txt.
* Source Serif Pro (SourceSerifPro-Regular.woff, SourceSerifPro-Bold.woff):
Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with
Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of
Adobe Systems Incorporated in the United States and/or other countries.
Licensed under the SIL Open Font License, Version 1.1.
See SourceSerifPro-LICENSE.txt.
This copyright file is intended to be distributed with rustdoc output.

View File

@@ -0,0 +1,99 @@
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
with Reserved Font Name Fira Sans.
Copyright (c) 2014, Mozilla Foundation https://mozilla.org/
with Reserved Font Name Fira Mono.
Copyright (c) 2014, Telefonica S.A.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,101 @@
Copyright 1989, 1991 Adobe Systems Incorporated. All rights reserved.
Utopia is either a registered trademark or trademark of Adobe Systems
Incorporated in the United States and/or other countries. Used under
license.
Copyright 2006 Han The Thanh, Vntopia font family, http://vntex.sf.net
Copyright (c) 2008-2012, Andrey V. Panov (panov@canopus.iacp.dvo.ru),
with Reserved Font Name Heuristica.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@@ -0,0 +1,201 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -0,0 +1,23 @@
Permission is hereby granted, free of charge, to any
person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the
Software without restriction, including without
limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software
is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice
shall be included in all copies or substantial portions
of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.

View File

@@ -0,0 +1,93 @@
Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,93 @@
Copyright 2014 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

Binary file not shown.

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=struct.EmergencyStop.html">
</head>
<body>
<p>Redirecting to <a href="struct.EmergencyStop.html">struct.EmergencyStop.html</a>...</p>
<script>location.replace("struct.EmergencyStop.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,120 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `emergency_stop` crate.">
<meta name="keywords" content="rust, rustlang, rust-lang, emergency_stop">
<title>emergency_stop - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc mod">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Crate emergency_stop</p><div class="block items"><ul><li><a href="#structs">Structs</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'emergency_stop', ty: 'mod', relpath: '../'};</script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Crate <a class="mod" href=''>emergency_stop</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/emergency_stop/lib.rs.html#1-102' title='goto source code'>[src]</a></span></h1>
<h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class="struct" href="struct.EmergencyStop.html"
title='struct emergency_stop::EmergencyStop'>EmergencyStop</a></td>
<td class='docblock-short'>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "emergency_stop";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1 @@
initSidebarItems({"struct":[["EmergencyStop",""]]});

View File

@@ -0,0 +1,132 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `EmergencyStop` struct in crate `emergency_stop`.">
<meta name="keywords" content="rust, rustlang, rust-lang, EmergencyStop">
<title>emergency_stop::EmergencyStop - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc struct">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Struct EmergencyStop</p><div class="block items"><ul><li><a href="#fields">Fields</a></li><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='index.html'>emergency_stop</a></p><script>window.sidebarCurrent = {name: 'EmergencyStop', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>emergency_stop</a>::<wbr><a class="struct" href=''>EmergencyStop</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/emergency_stop/lib.rs.html#15-18' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct EmergencyStop {
pub state: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html" title="struct alloc::arc::Arc">Arc</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicBool.html" title="struct core::sync::atomic::AtomicBool">AtomicBool</a>&gt;,
// some fields omitted
}</pre><h2 id='fields' class='fields'>Fields</h2><span id='structfield.state' class="structfield">
<span id='state.v' class='invisible'>
<code>state: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/arc/struct.Arc.html" title="struct alloc::arc::Arc">Arc</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/core/sync/atomic/struct.AtomicBool.html" title="struct core::sync::atomic::AtomicBool">AtomicBool</a>&gt;</code>
</span></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="struct" href="../emergency_stop/struct.EmergencyStop.html" title="struct emergency_stop::EmergencyStop">EmergencyStop</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/emergency_stop/lib.rs.html#20-91' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>fn <a href='#method.new' class='fnname'>new</a>(stop_port: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;Self&gt;</code></span></h4>
<div class='docblock'><p>Constructs a new <code>EmergencyStop</code> and starts poll thread.</p>
<h1 id='parameter' class='section-header'><a href='#parameter'>Parameter</a></h1>
<ul>
<li><code>stop_port</code> GPIO Port number of emergency stop pin.</li>
</ul>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../emergency_stop/struct.EmergencyStop.html" title="struct emergency_stop::EmergencyStop">EmergencyStop</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/emergency_stop/lib.rs.html#14' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../emergency_stop/struct.EmergencyStop.html" title="struct emergency_stop::EmergencyStop">EmergencyStop</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/emergency_stop/lib.rs.html#93-102' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code></span></h4>
<div class='docblock'><p>Set emergency stop and join poll thread.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "emergency_stop";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
(function() {var implementors = {};
implementors["kawaii"] = ["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Direction.html\" title=\"enum kawaii::gpio::Direction\">Direction</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Edge.html\" title=\"enum kawaii::gpio::Edge\">Edge</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html\" title=\"trait core::clone::Clone\">Clone</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Value.html\" title=\"enum kawaii::gpio::Value\">Value</a>",];
if (window.register_implementors) {
window.register_implementors(implementors);
} else {
window.pending_implementors = implementors;
}
})()

View File

@@ -0,0 +1,12 @@
(function() {var implementors = {};
implementors["emergency_stop"] = ["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"emergency_stop/struct.EmergencyStop.html\" title=\"struct emergency_stop::EmergencyStop\">EmergencyStop</a>",];
implementors["kawaii"] = ["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Direction.html\" title=\"enum kawaii::gpio::Direction\">Direction</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Edge.html\" title=\"enum kawaii::gpio::Edge\">Edge</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Value.html\" title=\"enum kawaii::gpio::Value\">Value</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"kawaii/gpio/struct.Port.html\" title=\"struct kawaii::gpio::Port\">Port</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"kawaii/gpio/struct.SyncPort.html\" title=\"struct kawaii::gpio::SyncPort\">SyncPort</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"kawaii/gpio/struct.AsyncPort.html\" title=\"struct kawaii::gpio::AsyncPort\">AsyncPort</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"kawaii/struct.Measure.html\" title=\"struct kawaii::Measure\">Measure</a>",];
implementors["ultrasonic_irq"] = ["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"ultrasonic_irq/struct.UltrasonicEcho.html\" title=\"struct ultrasonic_irq::UltrasonicEcho\">UltrasonicEcho</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"ultrasonic_irq/struct.UltrasonicTrigger.html\" title=\"struct ultrasonic_irq::UltrasonicTrigger\">UltrasonicTrigger</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html\" title=\"trait core::fmt::Debug\">Debug</a> for <a class=\"struct\" href=\"ultrasonic_irq/struct.Ultrasonic.html\" title=\"struct ultrasonic_irq::Ultrasonic\">Ultrasonic</a>",];
if (window.register_implementors) {
window.register_implementors(implementors);
} else {
window.pending_implementors = implementors;
}
})()

View File

@@ -0,0 +1,10 @@
(function() {var implementors = {};
implementors["kawaii"] = ["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Direction.html\" title=\"enum kawaii::gpio::Direction\">Direction</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Edge.html\" title=\"enum kawaii::gpio::Edge\">Edge</a>","impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html\" title=\"trait core::marker::Copy\">Copy</a> for <a class=\"enum\" href=\"kawaii/gpio/enum.Value.html\" title=\"enum kawaii::gpio::Value\">Value</a>",];
if (window.register_implementors) {
window.register_implementors(implementors);
} else {
window.pending_implementors = implementors;
}
})()

View File

@@ -0,0 +1,12 @@
(function() {var implementors = {};
implementors["emergency_stop"] = ["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"emergency_stop/struct.EmergencyStop.html\" title=\"struct emergency_stop::EmergencyStop\">EmergencyStop</a>",];
implementors["kawaii"] = ["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"kawaii/struct.Measure.html\" title=\"struct kawaii::Measure\">Measure</a>",];
implementors["ultrasonic_irq"] = ["impl <a class=\"trait\" href=\"https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html\" title=\"trait core::ops::drop::Drop\">Drop</a> for <a class=\"struct\" href=\"ultrasonic_irq/struct.Ultrasonic.html\" title=\"struct ultrasonic_irq::Ultrasonic\">Ultrasonic</a>",];
if (window.register_implementors) {
window.register_implementors(implementors);
} else {
window.pending_implementors = implementors;
}
})()

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=struct.Measure.html">
</head>
<body>
<p>Redirecting to <a href="struct.Measure.html">struct.Measure.html</a>...</p>
<script>location.replace("struct.Measure.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=struct.AsyncPort.html">
</head>
<body>
<p>Redirecting to <a href="struct.AsyncPort.html">struct.AsyncPort.html</a>...</p>
<script>location.replace("struct.AsyncPort.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=enum.Direction.html">
</head>
<body>
<p>Redirecting to <a href="enum.Direction.html">enum.Direction.html</a>...</p>
<script>location.replace("enum.Direction.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=enum.Edge.html">
</head>
<body>
<p>Redirecting to <a href="enum.Edge.html">enum.Edge.html</a>...</p>
<script>location.replace("enum.Edge.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=struct.Port.html">
</head>
<body>
<p>Redirecting to <a href="struct.Port.html">struct.Port.html</a>...</p>
<script>location.replace("struct.Port.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=struct.SyncPort.html">
</head>
<body>
<p>Redirecting to <a href="struct.SyncPort.html">struct.SyncPort.html</a>...</p>
<script>location.replace("struct.SyncPort.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=enum.Value.html">
</head>
<body>
<p>Redirecting to <a href="enum.Value.html">enum.Value.html</a>...</p>
<script>location.replace("enum.Value.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,128 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `Direction` enum in crate `kawaii`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Direction">
<title>kawaii::gpio::Direction - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc enum">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Enum Direction</p><div class="block items"><ul><li><a href="#variants">Variants</a></li><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a></p><script>window.sidebarCurrent = {name: 'Direction', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a>::<wbr><a class="enum" href=''>Direction</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/kawaii/gpio.rs.html#21-24' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum Direction {
Out,
In,
}</pre><h2 id='variants' class='variants'>Variants</h2>
<span id='variant.Out' class='variant'><span id='Out.v' class='invisible'><code>Out</code></span></span><span id='variant.In' class='variant'><span id='In.v' class='invisible'><code>In</code></span></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#25-40' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.from_str' class="method"><span id='from_str.v' class='invisible'><code>fn <a href='#method.from_str' class='fnname'>from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a>&gt;</code></span></h4>
<h4 id='method.as_str' class="method"><span id='as_str.v' class='invisible'><code>fn <a href='#method.as_str' class='fnname'>as_str</a>(&amp;self) -&gt; &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code></span></h4>
</div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#20' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a></code></span></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></span></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#20' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#20' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "kawaii";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,130 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `Edge` enum in crate `kawaii`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Edge">
<title>kawaii::gpio::Edge - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc enum">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Enum Edge</p><div class="block items"><ul><li><a href="#variants">Variants</a></li><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a></p><script>window.sidebarCurrent = {name: 'Edge', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a>::<wbr><a class="enum" href=''>Edge</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/kawaii/gpio.rs.html#43-48' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum Edge {
None,
Rising,
Falling,
Both,
}</pre><h2 id='variants' class='variants'>Variants</h2>
<span id='variant.None' class='variant'><span id='None.v' class='invisible'><code>None</code></span></span><span id='variant.Rising' class='variant'><span id='Rising.v' class='invisible'><code>Rising</code></span></span><span id='variant.Falling' class='variant'><span id='Falling.v' class='invisible'><code>Falling</code></span></span><span id='variant.Both' class='variant'><span id='Both.v' class='invisible'><code>Both</code></span></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#49-68' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.from_str' class="method"><span id='from_str.v' class='invisible'><code>fn <a href='#method.from_str' class='fnname'>from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a>&gt;</code></span></h4>
<h4 id='method.as_str' class="method"><span id='as_str.v' class='invisible'><code>fn <a href='#method.as_str' class='fnname'>as_str</a>(&amp;self) -&gt; &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code></span></h4>
</div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#42' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a></code></span></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></span></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#42' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#42' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "kawaii";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,130 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `Value` enum in crate `kawaii`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Value">
<title>kawaii::gpio::Value - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc enum">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Enum Value</p><div class="block items"><ul><li><a href="#variants">Variants</a></li><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a></p><script>window.sidebarCurrent = {name: 'Value', ty: 'enum', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Enum <a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a>::<wbr><a class="enum" href=''>Value</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/kawaii/gpio.rs.html#71-74' title='goto source code'>[src]</a></span></h1>
<pre class='rust enum'>pub enum Value {
High,
Low,
}</pre><h2 id='variants' class='variants'>Variants</h2>
<span id='variant.High' class='variant'><span id='High.v' class='invisible'><code>High</code></span></span><span id='variant.Low' class='variant'><span id='Low.v' class='invisible'><code>Low</code></span></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#75-102' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.from_str' class="method"><span id='from_str.v' class='invisible'><code>fn <a href='#method.from_str' class='fnname'>from_str</a>(s: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a>&gt;</code></span></h4>
<h4 id='method.from_buffer' class="method"><span id='from_buffer.v' class='invisible'><code>fn <a href='#method.from_buffer' class='fnname'>from_buffer</a>(b: &amp;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">[</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.array.html">; 1]</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code></span></h4>
<h4 id='method.from_char' class="method"><span id='from_char.v' class='invisible'><code>fn <a href='#method.from_char' class='fnname'>from_char</a>(c: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</code></span></h4>
<h4 id='method.as_str' class="method"><span id='as_str.v' class='invisible'><code>fn <a href='#method.as_str' class='fnname'>as_str</a>(&amp;self) -&gt; &amp;'static <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.str.html">str</a></code></span></h4>
</div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html" title="trait core::clone::Clone">Clone</a> for <a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#70' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.clone' class="method"><span id='clone.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone' class='fnname'>clone</a>(&amp;self) -&gt; <a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a></code></span></h4>
<div class='docblock'><p>Returns a copy of the value. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#tymethod.clone">Read more</a></p>
</div><h4 id='method.clone_from' class="method"><span id='clone_from.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from' class='fnname'>clone_from</a>(&amp;mut self, source: &amp;Self)</code><div class='since' title='Stable since Rust version 1.0.0'>1.0.0</div></span></h4>
<div class='docblock'><p>Performs copy-assignment from <code>source</code>. <a href="https://doc.rust-lang.org/nightly/core/clone/trait.Clone.html#method.clone_from">Read more</a></p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/marker/trait.Copy.html" title="trait core::marker::Copy">Copy</a> for <a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#70' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#70' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "kawaii";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,156 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `gpio` mod in crate `kawaii`.">
<meta name="keywords" content="rust, rustlang, rust-lang, gpio">
<title>kawaii::gpio - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc mod">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Module gpio</p><div class="block items"><ul><li><a href="#structs">Structs</a></li><li><a href="#enums">Enums</a></li></ul></div><p class='location'><a href='../index.html'>kawaii</a></p><script>window.sidebarCurrent = {name: 'gpio', ty: 'mod', relpath: '../'};</script><script defer src="../sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Module <a href='../index.html'>kawaii</a>::<wbr><a class="mod" href=''>gpio</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/kawaii/gpio.rs.html#1-320' title='goto source code'>[src]</a></span></h1>
<h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class="struct" href="struct.AsyncPort.html"
title='struct kawaii::gpio::AsyncPort'>AsyncPort</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.Port.html"
title='struct kawaii::gpio::Port'>Port</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="struct" href="struct.SyncPort.html"
title='struct kawaii::gpio::SyncPort'>SyncPort</a></td>
<td class='docblock-short'>
</td>
</tr></table><h2 id='enums' class='section-header'><a href="#enums">Enums</a></h2>
<table>
<tr class=' module-item'>
<td><a class="enum" href="enum.Direction.html"
title='enum kawaii::gpio::Direction'>Direction</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="enum" href="enum.Edge.html"
title='enum kawaii::gpio::Edge'>Edge</a></td>
<td class='docblock-short'>
</td>
</tr>
<tr class=' module-item'>
<td><a class="enum" href="enum.Value.html"
title='enum kawaii::gpio::Value'>Value</a></td>
<td class='docblock-short'>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "kawaii";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1 @@
initSidebarItems({"enum":[["Direction",""],["Edge",""],["Value",""]],"struct":[["AsyncPort",""],["Port",""],["SyncPort",""]]});

View File

@@ -0,0 +1,138 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `AsyncPort` struct in crate `kawaii`.">
<meta name="keywords" content="rust, rustlang, rust-lang, AsyncPort">
<title>kawaii::gpio::AsyncPort - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc struct">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Struct AsyncPort</p><div class="block items"><ul><li><a href="#fields">Fields</a></li><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a></p><script>window.sidebarCurrent = {name: 'AsyncPort', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a>::<wbr><a class="struct" href=''>AsyncPort</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/kawaii/gpio.rs.html#116-122' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct AsyncPort {
pub port: <a class="struct" href="../../kawaii/gpio/struct.Port.html" title="struct kawaii::gpio::Port">Port</a>,
pub edge: <a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a>,
// some fields omitted
}</pre><h2 id='fields' class='fields'>Fields</h2><span id='structfield.port' class="structfield">
<span id='port.v' class='invisible'>
<code>port: <a class="struct" href="../../kawaii/gpio/struct.Port.html" title="struct kawaii::gpio::Port">Port</a></code>
</span></span><span id='structfield.edge' class="structfield">
<span id='edge.v' class='invisible'>
<code>edge: <a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a></code>
</span></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="struct" href="../../kawaii/gpio/struct.AsyncPort.html" title="struct kawaii::gpio::AsyncPort">AsyncPort</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#226-320' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>fn <a href='#method.new' class='fnname'>new</a>(number: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, edge: <a class="enum" href="../../kawaii/gpio/enum.Edge.html" title="enum kawaii::gpio::Edge">Edge</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="../../kawaii/gpio/struct.AsyncPort.html" title="struct kawaii::gpio::AsyncPort">AsyncPort</a>&gt;</code></span></h4>
<div class='docblock'><p>Constructs a new asynchronous GPIO <code>Port</code>.</p>
<h1 id='parameter' class='section-header'><a href='#parameter'>Parameter</a></h1>
<ul>
<li><code>number</code> GPIO Port number of pin.</li>
<li><code>edge</code> GPIO Port edge detection setting.</li>
</ul>
</div><h4 id='method.poll' class="method"><span id='poll.v' class='invisible'><code>fn <a href='#method.poll' class='fnname'>poll</a>(&amp;mut self, timeout: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/duration/struct.Duration.html" title="struct std::time::duration::Duration">Duration</a>&gt;) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a>&gt;&gt;</code></span></h4>
<div class='docblock'><p>Read asynchronous from GPIO <code>AsyncPort</code> sysfs file</p>
</div><h4 id='method.poll_measure' class="method"><span id='poll_measure.v' class='invisible'><code>fn <a href='#method.poll_measure' class='fnname'>poll_measure</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;mut self, <br>&nbsp;&nbsp;&nbsp;&nbsp;timeout: <a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="struct" href="https://doc.rust-lang.org/nightly/std/time/duration/struct.Duration.html" title="struct std::time::duration::Duration">Duration</a>&gt;, <br>&nbsp;&nbsp;&nbsp;&nbsp;measure: &amp;mut <a class="struct" href="../../kawaii/struct.Measure.html" title="struct kawaii::Measure">Measure</a><br>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="https://doc.rust-lang.org/nightly/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;<a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a>&gt;&gt;</code></span></h4>
<div class='docblock'><p>Read asynchronous from GPIO <code>AsyncPort</code> sysfs file with measure support (ignore poll time)</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../kawaii/gpio/struct.AsyncPort.html" title="struct kawaii::gpio::AsyncPort">AsyncPort</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#124-133' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, f: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "kawaii";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,135 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `Port` struct in crate `kawaii`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Port">
<title>kawaii::gpio::Port - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc struct">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Struct Port</p><div class="block items"><ul><li><a href="#fields">Fields</a></li><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a></p><script>window.sidebarCurrent = {name: 'Port', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a>::<wbr><a class="struct" href=''>Port</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/kawaii/gpio.rs.html#105-108' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Port {
pub number: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>,
pub direction: <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a>,
}</pre><h2 id='fields' class='fields'>Fields</h2><span id='structfield.number' class="structfield">
<span id='number.v' class='invisible'>
<code>number: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a></code>
</span></span><span id='structfield.direction' class="structfield">
<span id='direction.v' class='invisible'>
<code>direction: <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a></code>
</span></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="struct" href="../../kawaii/gpio/struct.Port.html" title="struct kawaii::gpio::Port">Port</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#135-184' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>fn <a href='#method.new' class='fnname'>new</a>(number: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, direction: <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="../../kawaii/gpio/struct.Port.html" title="struct kawaii::gpio::Port">Port</a>&gt;</code></span></h4>
<div class='docblock'><p>Constructs a new GPIO <code>Port</code>.</p>
<h1 id='parameter' class='section-header'><a href='#parameter'>Parameter</a></h1>
<ul>
<li><code>number</code> GPIO Port number of pin.</li>
<li><code>direction</code> GPIO Port direction.</li>
</ul>
</div><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><code>fn <a href='#method.drop' class='fnname'>drop</a>(&amp;mut self)</code></span></h4>
<div class='docblock'><p>Drop GPIO <code>Port</code>: unexport</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../kawaii/gpio/struct.Port.html" title="struct kawaii::gpio::Port">Port</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#104' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "kawaii";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,134 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `SyncPort` struct in crate `kawaii`.">
<meta name="keywords" content="rust, rustlang, rust-lang, SyncPort">
<title>kawaii::gpio::SyncPort - Rust</title>
<link rel="stylesheet" type="text/css" href="../../normalize.css">
<link rel="stylesheet" type="text/css" href="../../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../../main.css">
</head>
<body class="rustdoc struct">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Struct SyncPort</p><div class="block items"><ul><li><a href="#fields">Fields</a></li><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a></p><script>window.sidebarCurrent = {name: 'SyncPort', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Struct <a href='../index.html'>kawaii</a>::<wbr><a href='index.html'>gpio</a>::<wbr><a class="struct" href=''>SyncPort</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../../src/kawaii/gpio.rs.html#111-115' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct SyncPort {
pub port: <a class="struct" href="../../kawaii/gpio/struct.Port.html" title="struct kawaii::gpio::Port">Port</a>,
// some fields omitted
}</pre><h2 id='fields' class='fields'>Fields</h2><span id='structfield.port' class="structfield">
<span id='port.v' class='invisible'>
<code>port: <a class="struct" href="../../kawaii/gpio/struct.Port.html" title="struct kawaii::gpio::Port">Port</a></code>
</span></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="struct" href="../../kawaii/gpio/struct.SyncPort.html" title="struct kawaii::gpio::SyncPort">SyncPort</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#186-224' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>fn <a href='#method.new' class='fnname'>new</a>(number: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, direction: <a class="enum" href="../../kawaii/gpio/enum.Direction.html" title="enum kawaii::gpio::Direction">Direction</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="struct" href="../../kawaii/gpio/struct.SyncPort.html" title="struct kawaii::gpio::SyncPort">SyncPort</a>&gt;</code></span></h4>
<div class='docblock'><p>Constructs a new synchronised GPIO <code>Port</code>.</p>
<h1 id='parameter' class='section-header'><a href='#parameter'>Parameter</a></h1>
<ul>
<li><code>number</code> GPIO Port number of pin.</li>
<li><code>direction</code> GPIO Port direction.</li>
</ul>
</div><h4 id='method.read' class="method"><span id='read.v' class='invisible'><code>fn <a href='#method.read' class='fnname'>read</a>(&amp;mut self) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a>&gt;</code></span></h4>
<div class='docblock'><p>Read from GPIO <code>SyncPort</code> sysfs file</p>
</div><h4 id='method.write' class="method"><span id='write.v' class='invisible'><code>fn <a href='#method.write' class='fnname'>write</a>(&amp;mut self, value: <a class="enum" href="../../kawaii/gpio/enum.Value.html" title="enum kawaii::gpio::Value">Value</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/std/io/error/type.Result.html" title="type std::io::error::Result">Result</a>&lt;<a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.tuple.html">()</a>&gt;</code></span></h4>
<div class='docblock'><p>Write to GPIO <code>SyncPort</code> sysfs file</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../../kawaii/gpio/struct.SyncPort.html" title="struct kawaii::gpio::SyncPort">SyncPort</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../../src/kawaii/gpio.rs.html#110' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../../";
window.currentCrate = "kawaii";
</script>
<script src="../../main.js"></script>
<script defer src="../../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,128 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `kawaii` crate.">
<meta name="keywords" content="rust, rustlang, rust-lang, kawaii">
<title>kawaii - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc mod">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Crate kawaii</p><div class="block items"><ul><li><a href="#modules">Modules</a></li><li><a href="#structs">Structs</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'kawaii', ty: 'mod', relpath: '../'};</script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Crate <a class="mod" href=''>kawaii</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii/lib.rs.html#1-7' title='goto source code'>[src]</a></span></h1>
<h2 id='modules' class='section-header'><a href="#modules">Modules</a></h2>
<table>
<tr class=' module-item'>
<td><a class="mod" href="gpio/index.html"
title='mod kawaii::gpio'>gpio</a></td>
<td class='docblock-short'>
</td>
</tr></table><h2 id='structs' class='section-header'><a href="#structs">Structs</a></h2>
<table>
<tr class=' module-item'>
<td><a class="struct" href="struct.Measure.html"
title='struct kawaii::Measure'>Measure</a></td>
<td class='docblock-short'>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=struct.Measure.html">
</head>
<body>
<p>Redirecting to <a href="struct.Measure.html">struct.Measure.html</a>...</p>
<script>location.replace("struct.Measure.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../kawaii/struct.Measure.html">
</head>
<body>
<p>Redirecting to <a href="../../kawaii/struct.Measure.html">../../kawaii/struct.Measure.html</a>...</p>
<script>location.replace("../../kawaii/struct.Measure.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1 @@
initSidebarItems({"mod":[["gpio",""]],"struct":[["Measure",""]]});

View File

@@ -0,0 +1,146 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `Measure` struct in crate `kawaii`.">
<meta name="keywords" content="rust, rustlang, rust-lang, Measure">
<title>kawaii::Measure - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc struct">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Struct Measure</p><div class="block items"><ul><li><a href="#fields">Fields</a></li><li><a href="#methods">Methods</a></li><li><a href="#implementations">Trait Implementations</a></li></ul></div><p class='location'><a href='index.html'>kawaii</a></p><script>window.sidebarCurrent = {name: 'Measure', ty: 'struct', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Struct <a href='index.html'>kawaii</a>::<wbr><a class="struct" href=''>Measure</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii/measure.rs.html#15-22' title='goto source code'>[src]</a></span></h1>
<pre class='rust struct'>pub struct Measure {
pub min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
pub max: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a>,
pub name: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>,
// some fields omitted
}</pre><h2 id='fields' class='fields'>Fields</h2><span id='structfield.min' class="structfield">
<span id='min.v' class='invisible'>
<code>min: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code>
</span></span><span id='structfield.max' class="structfield">
<span id='max.v' class='invisible'>
<code>max: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u64.html">u64</a></code>
</span></span><span id='structfield.name' class="structfield">
<span id='name.v' class='invisible'>
<code>name: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a></code>
</span></span><h2 id='methods'>Methods</h2><h3 class='impl'><span class='in-band'><code>impl <a class="struct" href="../kawaii/struct.Measure.html" title="struct kawaii::Measure">Measure</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/kawaii/measure.rs.html#24-105' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.new' class="method"><span id='new.v' class='invisible'><code>fn <a href='#method.new' class='fnname'>new</a>(name: <a class="struct" href="https://doc.rust-lang.org/nightly/alloc/string/struct.String.html" title="struct alloc::string::String">String</a>) -&gt; Self</code></span></h4>
<div class='docblock'><p>Constructs a new <code>Measure</code>.</p>
<h1 id='parameter' class='section-header'><a href='#parameter'>Parameter</a></h1>
<ul>
<li><code>name</code> Name of measured component.</li>
</ul>
</div><h4 id='method.start' class="method"><span id='start.v' class='invisible'><code>fn <a href='#method.start' class='fnname'>start</a>(&amp;mut self)</code></span></h4>
<div class='docblock'><p>Start measurement</p>
</div><h4 id='method.pause' class="method"><span id='pause.v' class='invisible'><code>fn <a href='#method.pause' class='fnname'>pause</a>(&amp;mut self)</code></span></h4>
<div class='docblock'><p>Pause measurement</p>
</div><h4 id='method.stop' class="method"><span id='stop.v' class='invisible'><code>fn <a href='#method.stop' class='fnname'>stop</a>(&amp;mut self)</code></span></h4>
<div class='docblock'><p>Stop measurement and calculate time difference</p>
</div></div><h2 id='implementations'>Trait Implementations</h2><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html" title="trait core::fmt::Debug">Debug</a> for <a class="struct" href="../kawaii/struct.Measure.html" title="struct kawaii::Measure">Measure</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/kawaii/measure.rs.html#14' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.fmt' class="method"><span id='fmt.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/fmt/trait.Debug.html#tymethod.fmt' class='fnname'>fmt</a>(&amp;self, __arg_0: &amp;mut <a class="struct" href="https://doc.rust-lang.org/nightly/core/fmt/struct.Formatter.html" title="struct core::fmt::Formatter">Formatter</a>) -&gt; <a class="type" href="https://doc.rust-lang.org/nightly/core/fmt/type.Result.html" title="type core::fmt::Result">Result</a></code></span></h4>
<div class='docblock'><p>Formats the value using the given formatter.</p>
</div></div><h3 class='impl'><span class='in-band'><code>impl <a class="trait" href="https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html" title="trait core::ops::drop::Drop">Drop</a> for <a class="struct" href="../kawaii/struct.Measure.html" title="struct kawaii::Measure">Measure</a></code></span><span class='out-of-band'><div class='ghost'></div><a class='srclink' href='../src/kawaii/measure.rs.html#107-119' title='goto source code'>[src]</a></span></h3>
<div class='impl-items'><h4 id='method.drop' class="method"><span id='drop.v' class='invisible'><code>fn <a href='https://doc.rust-lang.org/nightly/core/ops/drop/trait.Drop.html#tymethod.drop' class='fnname'>drop</a>(&amp;mut self)</code></span></h4>
<div class='docblock'><p>Print measure results and write times to file</p>
</div></div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=fn.emergency_stop_clean.html">
</head>
<body>
<p>Redirecting to <a href="fn.emergency_stop_clean.html">fn.emergency_stop_clean.html</a>...</p>
<script>location.replace("fn.emergency_stop_clean.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=fn.emergency_stop_get_state.html">
</head>
<body>
<p>Redirecting to <a href="fn.emergency_stop_get_state.html">fn.emergency_stop_get_state.html</a>...</p>
<script>location.replace("fn.emergency_stop_get_state.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=fn.emergency_stop_init.html">
</head>
<body>
<p>Redirecting to <a href="fn.emergency_stop_init.html">fn.emergency_stop_init.html</a>...</p>
<script>location.replace("fn.emergency_stop_init.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../kawaii_api/fn.emergency_stop_clean.html">
</head>
<body>
<p>Redirecting to <a href="../../kawaii_api/fn.emergency_stop_clean.html">../../kawaii_api/fn.emergency_stop_clean.html</a>...</p>
<script>location.replace("../../kawaii_api/fn.emergency_stop_clean.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../kawaii_api/fn.emergency_stop_get_state.html">
</head>
<body>
<p>Redirecting to <a href="../../kawaii_api/fn.emergency_stop_get_state.html">../../kawaii_api/fn.emergency_stop_get_state.html</a>...</p>
<script>location.replace("../../kawaii_api/fn.emergency_stop_get_state.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../kawaii_api/fn.emergency_stop_init.html">
</head>
<body>
<p>Redirecting to <a href="../../kawaii_api/fn.emergency_stop_init.html">../../kawaii_api/fn.emergency_stop_init.html</a>...</p>
<script>location.replace("../../kawaii_api/fn.emergency_stop_init.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=fn.emergency_stop_clean.html">
</head>
<body>
<p>Redirecting to <a href="fn.emergency_stop_clean.html">fn.emergency_stop_clean.html</a>...</p>
<script>location.replace("fn.emergency_stop_clean.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=fn.emergency_stop_get_state.html">
</head>
<body>
<p>Redirecting to <a href="fn.emergency_stop_get_state.html">fn.emergency_stop_get_state.html</a>...</p>
<script>location.replace("fn.emergency_stop_get_state.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=fn.emergency_stop_init.html">
</head>
<body>
<p>Redirecting to <a href="fn.emergency_stop_init.html">fn.emergency_stop_init.html</a>...</p>
<script>location.replace("fn.emergency_stop_init.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `emergency_stop_clean` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, emergency_stop_clean">
<title>kawaii_api::emergency_stop_clean - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'emergency_stop_clean', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>emergency_stop_clean</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/emergency_stop.rs.html#20-22' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn emergency_stop_clean(emergency_stop: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>EmergencyStop)</pre><div class='docblock'><p>Drops a <code>EmergencyStop</code> pointer on heap.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `emergency_stop_get_state` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, emergency_stop_get_state">
<title>kawaii_api::emergency_stop_get_state - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'emergency_stop_get_state', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>emergency_stop_get_state</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/emergency_stop.rs.html#26-30' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn emergency_stop_get_state(<br>&nbsp;&nbsp;&nbsp;&nbsp;emergency_stop: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>EmergencyStop<br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.bool.html">bool</a></pre><div class='docblock'><p>Returns <code>EmergencyStop</code> pointer state.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `emergency_stop_init` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, emergency_stop_init">
<title>kawaii_api::emergency_stop_init - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'emergency_stop_init', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>emergency_stop_init</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/emergency_stop.rs.html#11-16' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn emergency_stop_init(stop: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>EmergencyStop</pre><div class='docblock'><p>Constructs a new <code>EmergencyStop</code> on heap and returns pointer.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `measure_clean` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, measure_clean">
<title>kawaii_api::measure_clean - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'measure_clean', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>measure_clean</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/measure.rs.html#27-29' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn measure_clean(measure: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>Measure)</pre><div class='docblock'><p>Drops a <code>Measure</code> pointer on heap.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `measure_init` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, measure_init">
<title>kawaii_api::measure_init - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'measure_init', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>measure_init</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/measure.rs.html#12-23' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn measure_init(name: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*const </a><a class="type" href="https://doc.rust-lang.org/nightly/std/os/raw/type.c_char.html" title="type std::os::raw::c_char">c_char</a>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>Measure</pre><div class='docblock'><p>Constructs a new <code>Measure</code> on heap and returns pointer.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `measure_pause` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, measure_pause">
<title>kawaii_api::measure_pause - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'measure_pause', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>measure_pause</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/measure.rs.html#41-45' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn measure_pause(measure: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>Measure)</pre><div class='docblock'><p>Pause measure on <code>Measure</code> pointer.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `measure_start` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, measure_start">
<title>kawaii_api::measure_start - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'measure_start', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>measure_start</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/measure.rs.html#33-37' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn measure_start(measure: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>Measure)</pre><div class='docblock'><p>Starts measure on <code>Measure</code> pointer.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `measure_stop` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, measure_stop">
<title>kawaii_api::measure_stop - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'measure_stop', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>measure_stop</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/measure.rs.html#49-53' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn measure_stop(measure: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>Measure)</pre><div class='docblock'><p>Stop measure on <code>Measure</code> pointer.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `ultrasonic_clean` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, ultrasonic_clean">
<title>kawaii_api::ultrasonic_clean - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'ultrasonic_clean', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>ultrasonic_clean</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/ultrasonic_irq.rs.html#20-22' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn ultrasonic_clean(ultrasonic: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>Ultrasonic)</pre><div class='docblock'><p>Drops a <code>Ultrasonic</code> pointer on heap.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `ultrasonic_get_distance` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, ultrasonic_get_distance">
<title>kawaii_api::ultrasonic_get_distance - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'ultrasonic_get_distance', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>ultrasonic_get_distance</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/ultrasonic_irq.rs.html#26-30' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn ultrasonic_get_distance(ultrasonic: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>Ultrasonic) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u32.html">u32</a></pre><div class='docblock'><p>Returns <code>Ultrasonic</code> pointer distance.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `ultrasonic_init` fn in crate `kawaii_api`.">
<meta name="keywords" content="rust, rustlang, rust-lang, ultrasonic_init">
<title>kawaii_api::ultrasonic_init - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc fn">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'><a href='index.html'>kawaii_api</a></p><script>window.sidebarCurrent = {name: 'ultrasonic_init', ty: 'fn', relpath: ''};</script><script defer src="sidebar-items.js"></script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Function <a href='index.html'>kawaii_api</a>::<wbr><a class="fn" href=''>ultrasonic_init</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/ultrasonic_irq.rs.html#11-16' title='goto source code'>[src]</a></span></h1>
<pre class='rust fn'><div class="docblock attributes">#[no_mangle]
</div>pub extern &quot;C&quot; fn ultrasonic_init(<br>&nbsp;&nbsp;&nbsp;&nbsp;trigger: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;echo: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a>, <br>&nbsp;&nbsp;&nbsp;&nbsp;temperature: <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.u8.html">u8</a><br>) -&gt; <a class="primitive" href="https://doc.rust-lang.org/nightly/std/primitive.pointer.html">*mut </a>Ultrasonic</pre><div class='docblock'><p>Constructs a new <code>Ultrasonic</code> on heap and returns pointer.</p>
</div></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,190 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="rustdoc">
<meta name="description" content="API documentation for the Rust `kawaii_api` crate.">
<meta name="keywords" content="rust, rustlang, rust-lang, kawaii_api">
<title>kawaii_api - Rust</title>
<link rel="stylesheet" type="text/css" href="../normalize.css">
<link rel="stylesheet" type="text/css" href="../rustdoc.css">
<link rel="stylesheet" type="text/css" href="../main.css">
</head>
<body class="rustdoc mod">
<!--[if lte IE 8]>
<div class="warning">
This old browser is unsupported and will most likely display funky
things.
</div>
<![endif]-->
<nav class="sidebar">
<p class='location'>Crate kawaii_api</p><div class="block items"><ul><li><a href="#functions">Functions</a></li></ul></div><p class='location'></p><script>window.sidebarCurrent = {name: 'kawaii_api', ty: 'mod', relpath: '../'};</script>
</nav>
<nav class="sub">
<form class="search-form js-only">
<div class="search-container">
<input class="search-input" name="search"
autocomplete="off"
placeholder="Click or press S to search, ? for more options…"
type="search">
</div>
</form>
</nav>
<section id='main' class="content">
<h1 class='fqn'><span class='in-band'>Crate <a class="mod" href=''>kawaii_api</a></span><span class='out-of-band'><span id='render-detail'>
<a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">
[<span class='inner'>&#x2212;</span>]
</a>
</span><a class='srclink' href='../src/kawaii_api/lib.rs.html#1-13' title='goto source code'>[src]</a></span></h1>
<h2 id='functions' class='section-header'><a href="#functions">Functions</a></h2>
<table>
<tr class=' module-item'>
<td><a class="fn" href="fn.emergency_stop_clean.html"
title='fn kawaii_api::emergency_stop_clean'>emergency_stop_clean</a></td>
<td class='docblock-short'>
<p>Drops a <code>EmergencyStop</code> pointer on heap.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.emergency_stop_get_state.html"
title='fn kawaii_api::emergency_stop_get_state'>emergency_stop_get_state</a></td>
<td class='docblock-short'>
<p>Returns <code>EmergencyStop</code> pointer state.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.emergency_stop_init.html"
title='fn kawaii_api::emergency_stop_init'>emergency_stop_init</a></td>
<td class='docblock-short'>
<p>Constructs a new <code>EmergencyStop</code> on heap and returns pointer.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.measure_clean.html"
title='fn kawaii_api::measure_clean'>measure_clean</a></td>
<td class='docblock-short'>
<p>Drops a <code>Measure</code> pointer on heap.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.measure_init.html"
title='fn kawaii_api::measure_init'>measure_init</a></td>
<td class='docblock-short'>
<p>Constructs a new <code>Measure</code> on heap and returns pointer.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.measure_pause.html"
title='fn kawaii_api::measure_pause'>measure_pause</a></td>
<td class='docblock-short'>
<p>Pause measure on <code>Measure</code> pointer.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.measure_start.html"
title='fn kawaii_api::measure_start'>measure_start</a></td>
<td class='docblock-short'>
<p>Starts measure on <code>Measure</code> pointer.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.measure_stop.html"
title='fn kawaii_api::measure_stop'>measure_stop</a></td>
<td class='docblock-short'>
<p>Stop measure on <code>Measure</code> pointer.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.ultrasonic_clean.html"
title='fn kawaii_api::ultrasonic_clean'>ultrasonic_clean</a></td>
<td class='docblock-short'>
<p>Drops a <code>Ultrasonic</code> pointer on heap.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.ultrasonic_get_distance.html"
title='fn kawaii_api::ultrasonic_get_distance'>ultrasonic_get_distance</a></td>
<td class='docblock-short'>
<p>Returns <code>Ultrasonic</code> pointer distance.</p>
</td>
</tr>
<tr class=' module-item'>
<td><a class="fn" href="fn.ultrasonic_init.html"
title='fn kawaii_api::ultrasonic_init'>ultrasonic_init</a></td>
<td class='docblock-short'>
<p>Constructs a new <code>Ultrasonic</code> on heap and returns pointer.</p>
</td>
</tr></table></section>
<section id='search' class="content hidden"></section>
<section class="footer"></section>
<aside id="help" class="hidden">
<div>
<h1 class="hidden">Help</h1>
<div class="shortcuts">
<h2>Keyboard Shortcuts</h2>
<dl>
<dt>?</dt>
<dd>Show this help dialog</dd>
<dt>S</dt>
<dd>Focus the search field</dd>
<dt>&larrb;</dt>
<dd>Move up in search results</dd>
<dt>&rarrb;</dt>
<dd>Move down in search results</dd>
<dt>&#9166;</dt>
<dd>Go to active search result</dd>
<dt>+</dt>
<dd>Collapse/expand all sections</dd>
</dl>
</div>
<div class="infos">
<h2>Search Tricks</h2>
<p>
Prefix searches with a type followed by a colon (e.g.
<code>fn:</code>) to restrict the search to a given type.
</p>
<p>
Accepted types are: <code>fn</code>, <code>mod</code>,
<code>struct</code>, <code>enum</code>,
<code>trait</code>, <code>type</code>, <code>macro</code>,
and <code>const</code>.
</p>
<p>
Search functions by type signature (e.g.
<code>vec -> usize</code> or <code>* -> vec</code>)
</p>
</div>
</div>
</aside>
<script>
window.rootPath = "../";
window.currentCrate = "kawaii_api";
</script>
<script src="../main.js"></script>
<script defer src="../search-index.js"></script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../kawaii_api/fn.measure_clean.html">
</head>
<body>
<p>Redirecting to <a href="../../kawaii_api/fn.measure_clean.html">../../kawaii_api/fn.measure_clean.html</a>...</p>
<script>location.replace("../../kawaii_api/fn.measure_clean.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../kawaii_api/fn.measure_init.html">
</head>
<body>
<p>Redirecting to <a href="../../kawaii_api/fn.measure_init.html">../../kawaii_api/fn.measure_init.html</a>...</p>
<script>location.replace("../../kawaii_api/fn.measure_init.html" + location.search + location.hash);</script>
</body>
</html>

View File

@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="refresh" content="0;URL=../../kawaii_api/fn.measure_pause.html">
</head>
<body>
<p>Redirecting to <a href="../../kawaii_api/fn.measure_pause.html">../../kawaii_api/fn.measure_pause.html</a>...</p>
<script>location.replace("../../kawaii_api/fn.measure_pause.html" + location.search + location.hash);</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More