Expand description

Rust Embedded HAL for Apache NuttX RTOS

Macros

Print a formatted message to the serial console

Structs

NuttX Delay

NuttX I2C Bus

NuttX GPIO Input

NuttX GPIO Interrupt

NuttX GPIO Output

NuttX SPI Bus

NuttX GPIO Unused

I2C Message Struct: I2C transaction segment beginning with a START. A number of these can be transferred together to form an arbitrary sequence of write/read transfer to an I2C device. TODO: Import with bindgen from https://github.com/lupyuen/incubator-nuttx/blob/rusti2c/include/nuttx/i2c/i2c_master.h#L208-L215

I2C Transfer Struct: This structure is used to communicate with the I2C character driver in order to perform IOCTL transfers. TODO: Import with bindgen from https://github.com/lupyuen/incubator-nuttx/blob/rusti2c/include/nuttx/i2c/i2c_master.h#L231-L235

Constants

Return the GPIO pin type.

Read the value of an input or output GPIO

Register to receive a signal whenever there an interrupt is received on an input gpio pin. This feature, of course, depends upon interrupt GPIO support from the platform.

Set the GPIO pin type.

Stop receiving signals for pin interrupts.

Set the value of an output GPIO

Perform an I2C bus reset in an attempt to break loose stuck I2C devices.

Perform an I2C transfer

Message should not begin with a START

Message should not end with a STOP

Read data, from slave to master

Ten bit address

Read access is permitted (non-standard)

Open for read access (only)

Open for both read & write access

Write access is permitted (non-standard)

Open for write access (only)

GPIO driver commands

I2C driver commands

Functions

Close a file descriptor

Exit the program

Execute device commands

Open a file path

Print a message to the serial console. TODO: Auto-generate this wrapper with bindgen from the C declaration

Print a formatted message to the serial console. Called by println! macro.

Read from a file descriptor

Sleep for a number of seconds

Sleep for a number of microseconds

Write to a file descriptor

Type Definitions

Limit Strings to 64 chars, similar to char[64] in C

size_t for NuttX 32-bit. TODO: Support other architectures

ssize_t for NuttX 32-bit. TODO: Support other architectures