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
- Input
Pin - NuttX GPIO Input
- Interrupt
Pin - NuttX GPIO Interrupt
- Output
Pin - NuttX GPIO Output
- Spi
- NuttX SPI Bus
- Unused
Pin - 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