Crate nuttx_embedded_hal

Source
Expand description

Rust Embedded HAL for Apache NuttX RTOS

Macros§

println
Print a formatted message to the serial console

Structs§

Delay
NuttX Delay
I2c
NuttX I2C Bus
InputPin
NuttX GPIO Input
InterruptPin
NuttX GPIO Interrupt
OutputPin
NuttX GPIO Output
Spi
NuttX SPI Bus
UnusedPin
NuttX GPIO Unused
i2c_msg_s
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_s
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§

GPIOC_PINTYPE
Return the GPIO pin type.
GPIOC_READ
Read the value of an input or output GPIO
GPIOC_REGISTER
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.
GPIOC_SETPINTYPE
Set the GPIO pin type.
GPIOC_UNREGISTER
Stop receiving signals for pin interrupts.
GPIOC_WRITE
Set the value of an output GPIO
I2CIOC_RESET
Perform an I2C bus reset in an attempt to break loose stuck I2C devices.
I2CIOC_TRANSFER
Perform an I2C transfer
I2C_M_NOSTART
Message should not begin with a START
I2C_M_NOSTOP
Message should not end with a STOP
I2C_M_READ
Read data, from slave to master
I2C_M_TEN
Ten bit address
O_RDOK
Read access is permitted (non-standard)
O_RDONLY
Open for read access (only)
O_RDWR
Open for both read & write access
O_WROK
Write access is permitted (non-standard)
O_WRONLY
Open for write access (only)
_GPIOBASE
GPIO driver commands
_I2CBASE
I2C driver commands

Functions§

close
Close a file descriptor
exit
Exit the program
ioctl
Execute device commands
open
Open a file path
puts
Print a message to the serial console. TODO: Auto-generate this wrapper with bindgen from the C declaration
puts_format
Print a formatted message to the serial console. Called by println! macro.
read
Read from a file descriptor
sleep
Sleep for a number of seconds
usleep
Sleep for a number of microseconds
write
Write to a file descriptor

Type Aliases§

String
Limit Strings to 64 chars, similar to char[64] in C
size_t
size_t for NuttX 32-bit. TODO: Support other architectures
ssize_t
ssize_t for NuttX 32-bit. TODO: Support other architectures