diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index eea76434f1..d78be1b141 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@
Last Updated: May 21, 2009
+Last Updated: May 22, 2009
@@ -1017,7 +1017,7 @@ The system can be re-made subsequently by just typingmake
.
initialized. The architecture specific details of
initializing the OS will be handled here. Such things as
setting up interrupt service routines, starting the
- clock, and registering device drivers are some of the
+ clock, and registering device drivers are some of the
things that are different for each processor and hardware
platform.
@@ -1606,7 +1606,7 @@ extern void up_ledoff(int led);
Any user supplied data or logic can be accessed via the psuedo-file system.
- Built in support is provided for character and block drivers in the
+ Built in support is provided for character and block drivers in the
/dev
psuedo file system directory.
mount()
command that allows
a block driver to be bound to a mountpoint within the psuedo file system
- and to a a file system.
+ and to a file system.
At present, NuttX supports only the VFAT file system.
@@ -1648,7 +1648,10 @@ extern void up_ledoff(int led);
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 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);
open()
, close()
, read()
, write()
, etc.
+ After it has been registered, the character driver can be accessed by user code using the standard
+ driver operations including
+ open()
, close()
, read()
, write()
, etc.
drivers/dev_null.c
, drivers/fifo.c
, drivers/serial.c
, etc.
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 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);
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
.
+ 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
.
+ 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
.
+ Example: See the cmd_dd()
implementation in examples/nsh/nsh_ddcmd.c
.
netdev_register()
.
drivers/net/dm90x0.c
, arch/drivers/arm/src/c5471/c5471_ethernet.c
, arch/z80/src/ez80/ez80_emac.c
, etc.
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);
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.
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);
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.
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 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);
arch/arm/src/chip/lm3s_serial.c
, arch/arm/src/lpc214x/lpc214x_serial.c
, arch/z16/src/z16f/z16f_serial.c
, etc.
User's Manual
by
Gregory Nutt
-
Last Updated: May 9, 2009
+Last Updated: May 22, 2009
@@ -6037,8 +6037,11 @@ interface of the same name.
Any user supplied data or logic can be accessed via the pseudo-file system.
- Built in support is provided for character and block drivers in the
- /dev
pseudo file system directory.
+ Built in support is provided for character and block
+ driver nodes in the any
+ pseudo file system directory.
+ (By convention, however, all driver nodes should be in the /dev
+ pseudo file system directory).
Mounted File Systems