diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 6bc942e939..f2717ad04a 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -8,7 +8,7 @@
Last Updated: May 19, 2009
+Last Updated: May 21, 2009
- The release features support for the Micromint Eagle-100 development board. + The release features support for the Micromint + Eagle-100 development board. This board is based around, the Luminary LM3S6918 MCU. This is the first ARM Cortex-M3 architecture supported by Nuttx. This initial, basic port includes timer and serial console with configurations to execute the NuttX OS test and to run the NuttShell (NSH). @@ -860,8 +861,8 @@
Luminary LM3S6918. - This port uses the Micromint Eagle-100 development board with a GNU arm-elf toolchain* - under either Linux or Cygwin. + This port uses the Micromint Eagle-100 development + board with a GNU arm-elf toolchain* under either Linux or Cygwin.
STATUS: @@ -1416,6 +1417,7 @@ nuttx-0.4.7 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> * arch/arm/src/lm2s: Added an Ethernet driver for the LM3S6918 * configs/eagle100/nettest: Added an examples/nettest configuration for the Micromint Eagle100 board. + * Documentation/NuttxPortingGuide.html: Added a section on NuttX device drivers. pascal-0.1.3 2009-xx-xx Gregory Nutt <spudmonkey@racsa.co.cr> @@ -1487,9 +1489,10 @@ buildroot-0.1.6 2009-xx-xx <spudmonkey@racsa.co.cr>
Last Updated: May 9, 2009
+Last Updated: May 21, 2009
+ 6.0 NuttX Device Drivers+ |
+
+ NuttX supports a variety of device drivers including: +
+ Character device drivers have these properties: +
+include/nuttx/fs.h
.
+ All structures and APIs needed to work with character drivers are provided in this header file.
+ struct file_operations
.
+ Each character device driver must implement an instance of struct file_operations
.
+ That structure defines a call table with the following methods:
+ int open(FAR struct file *filp);
int close(FAR struct file *filp);
ssize_t read(FAR struct file *filp, FAR char *buffer, size_t buflen);
ssize_t write(FAR struct file *filp, FAR const char *buffer, size_t buflen);
off_t seek(FAR struct file *filp, off_t offset, int whence);
int ioctl(FAR struct file *filp, int cmd, unsigned long arg);
int poll(FAR struct file *filp, struct pollfd *fds, boolean setup);
int register_driver(const char *path, const struct file_operations *fops, mode_t mode, void *priv);
.
+ Each character driver registers itself by calling register_driver()
, passing it the
+ path
where it will appear in the pseudo-file-system and it's
+ initialized instance of struct file_operations
.
+ open()
, close()
, read()
, write()
, etc.
+ drivers/dev_null.c
, drivers/fifo.c
, drivers/serial.c
, etc.
+ + Block device drivers have these properties: +
+include/nuttx/fs.h
.
+ All structures and APIs needed to work with block drivers are provided in this header file.
+ struct block_operations
.
+ Each block device driver must implement an instance of struct block_operations
.
+ That structure defines a call table with the following methods:
+ int open(FAR struct inode *inode);
int close(FAR struct inode *inode);
ssize_t read(FAR struct inode *inode, FAR unsigned char *buffer, size_t start_sector, unsigned int nsectors);
ssize_t write(FAR struct inode *inode, FAR const unsigned char *buffer, size_t start_sector, unsigned int nsectors);
int geometry(FAR struct inode *inode, FAR struct geometry *geometry);
int ioctl(FAR struct inode *inode, int cmd, unsigned long arg);
int register_blockdriver(const char *path, const struct block_operations *bops, mode_t mode, void *priv);
.
+ Each block driver registers itself by calling register_blockdriver()
, passing it the
+ path
where it will appear in the pseudo-file-system and it's
+ initialized instance of struct block_operations
.
+ mount()
API.
+ The mount()
API binds a block driver instance with a file system and with a mountpoint.
+ Then the user may use the block driver to access the file system on the underlying media.
+ Example: See the cmd_mount()
implementation in examples/nsh/nsh_fscmds.c
.
+ drivers/loop.c
.
+ Example: See the cmd_losetup()
implementation in examples/nsh/nsh_fscmds.c
.
+ drivers/bch/
.
+ Example: See the cmd_dd()
implementation in examples/nsh/nsh_ddcmd.c
.
+ drivers/loop.c
, drivers/mmcds/mmcsd_spi.c
, drivers/ramdisk.c
, etc.
+ include/net/uip/uip-arch.h
.
+ All structures and APIs needed to work with Ethernet drivers are provided in this header file.
+ The structure struct uip_driver_s
defines the interface and is passed to uIP via
+ netdev_register()
.
+ int netdev_register(FAR struct uip_driver_s *dev);
.
+ Each Eterhenet driver registers itself by calling netdev_register()
.
+ drivers/net/dm90x0.c
, arch/drivers/arm/src/c5471/c5471_ethernet.c
, arch/z80/src/ez80/ez80_emac.c
, etc.
+ include/nuttx/spi.h
.
+ All structures and APIs needed to work with SPI drivers are provided in this header file.
+ struct spi_ops_s
.
+ Each SPI device driver must implement an instance of struct spi_ops_s
.
+ That structure defines a call table with the following methods:
+ void select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, boolean selected);
uint32 setfrequency(FAR struct spi_dev_s *dev, uint32 frequency);
void setmode(FAR struct spi_dev_s *dev, enum spi_mode_e mode);
void setbits(FAR struct spi_dev_s *dev, int nbits);
ubyte status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
uint16 send(FAR struct spi_dev_s *dev, uint16 wd);
void exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, FAR void *rxbuffer, size_t nwords);
int mmcsd_spislotinitialize(int minor, int slotno, FAR struct spi_dev_s *spi)
in drivers/mmcsd/mmcsd_spi.c
.
+ drivers/loop.c
, drivers/mmcds/mmcsd_spi.c
, drivers/ramdisk.c
, etc.
+ include/nuttx/i2c.h
.
+ All structures and APIs needed to work with I2C drivers are provided in this header file.
+ struct i2c_ops_s
.
+ Each I2C device driver must implement an instance of struct i2c_ops_s
.
+ That structure defines a call table with the following methods:
+ uint32 setfrequency(FAR struct i2c_dev_s *dev, uint32 frequency);
int setaddress(FAR struct i2c_dev_s *dev, int addr, int nbits);
int write(FAR struct i2c_dev_s *dev, const ubyte *buffer, int buflen);
int read(FAR struct i2c_dev_s *dev, ubyte *buffer, int buflen);
arch/z80/src/ez80/ez80_i2c.c
, arch/z80/src/z8/z8_i2c.c
, etc.
+ include/nuttx/serial.h
.
+ All structures and APIs needed to work with serial drivers are provided in this header file.
+ struct uart_ops_s
.
+ Each serial device driver must implement an instance of struct uart_ops_s
.
+ That structure defines a call table with the following methods:
+ int setup(FAR struct uart_dev_s *dev);
void shutdown(FAR struct uart_dev_s *dev);
int attach(FAR struct uart_dev_s *dev);
void detach(FAR struct uart_dev_s *dev);
int ioctl(FAR struct file *filep, int cmd, unsigned long arg);
int receive(FAR struct uart_dev_s *dev, unsigned int *status);
void rxint(FAR struct uart_dev_s *dev, boolean enable);
boolean rxavailable(FAR struct uart_dev_s *dev);
void send(FAR struct uart_dev_s *dev, int ch);
void txint(FAR struct uart_dev_s *dev, boolean enable);
boolean txready(FAR struct uart_dev_s *dev);
boolean txempty(FAR struct uart_dev_s *dev);
int uart_register(FAR const char *path, FAR uart_dev_t *dev);
.
+ A serial driver may register itself by calling uart_register()
, passing it the
+ path
where it will appear in the pseudo-file-system and it's
+ initialized instance of struct uart_ops_s
.
+ By convention, serial device drivers are registered at pathes like /dev/ttyS0
, /dev/ttyS1
, etc.
+ See the uart_register()
implementation in drivers/serial.c
.
+ arch/arm/src/chip/lm3s_serial.c
, arch/arm/src/lpc214x/lpc214x_serial.c
, arch/z16/src/z16f/z16f_serial.c
, etc.
+ @@ -2255,9 +2504,10 @@ extern void up_ledoff(int led); |