diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 93c629fe51d..b401adcdbe1 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@
Last Updated: November 17, 2009
+Last Updated: December 12, 2009
@@ -115,7 +115,9 @@ 6.3.1 Ethernet Device Driversinclude/nuttx/fb.h.
+ All structures and APIs needed to work with serial drivers are provided in this header file.
+ struct fb_vtable_s.
+ Each frame buffer device driver must implement an instance of struct fb_vtable_s.
+ That structure defines a call table with the following methods:
+ + Get information about the video controller configuration and the configuration of each color plane. +
+int (*getvideoinfo)(FAR struct fb_vtable_s *vtable, FAR struct fb_videoinfo_s *vinfo);
+ int (*getplaneinfo)(FAR struct fb_vtable_s *vtable, int planeno, FAR struct fb_planeinfo_s *pinfo);
+ The following are provided only if the video hardware supports RGB color mapping: +
+int (*getcmap)(FAR struct fb_vtable_s *vtable, FAR struct fb_cmap_s *cmap);
+ int (*putcmap)(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s *cmap);
+ The following are provided only if the video hardware supports a hardware cursor: +
+int (*getcursor)(FAR struct fb_vtable_s *vtable, FAR struct fb_cursorattrib_s *attrib);
+ int (*setcursor)(FAR struct fb_vtable_s *vtable, FAR struct fb_setcursor_s *settings);
struct fb_vtable_s from the hardware-specific frame buffer device driver, and arch/sim/src/up_framebuffer.c.
+ See also the usage of the frame buffer driver in the graphics/ directory.
+ include/nuttx/mtd.h.
+ All structures and APIs needed to work with serial drivers are provided in this header file.
+ struct mtd_dev_s.
+ Each MTD device driver must implement an instance of struct mtd_dev_s.
+ That structure defines a call table with the following methods:
+ + Erase the specified erase blocks (units are erase blocks): +
+int (*erase)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks);
+ Read/write from the specified read/write blocks: +
+ssize_t (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR ubyte *buffer);
+ ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const ubyte *buffer);
+ Some devices may support byte oriented reads (optional). + Most MTD devices are inherently block oriented so byte-oriented writing is not supported. + It is recommended that low-level drivers not support read() if it requires buffering. +
+ssize_t (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, FAR ubyte *buffer);
+ Support other, less frequently used commands: +
+MTDIOC_GEOMETRY: Get MTD geometryMTDIOC_XIPBASE:: Convert block to physical address for eXecute-In-PlaceMTDIOC_BULKERASE: Erase the entire device
+ is provided via a sinble ioctl method (see include/nuttx/ioctl.h):
+
int (*ioctl)(FAR struct mtd_dev_s *dev, int cmd, unsigned long arg);
struct mtd_dev_s from the hardware-specific MTD device driver, and drivers/mtd/m25px.c and drivers/mtd/ftl.c
+ include/nuttx/sdio.h.
+ All structures and APIs needed to work with serial drivers are provided in this header file.
+ struct sdio_dev_s.
+ Each MTD device driver must implement an instance of struct sdio_dev_s.
+ That structure defines a call table with the following methods:
+ + Initialization/setup: +
+void (*reset)(FAR struct sdio_dev_s *dev);
+ ubyte (*status)(FAR struct sdio_dev_s *dev);
+ void (*widebus)(FAR struct sdio_dev_s *dev, boolean enable);
+ void (*clock)(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate);
+ int (*attach)(FAR struct sdio_dev_s *dev);
+ Command/Status/Data Transfer: +
+void (*sendcmd)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 arg);
+ int (*recvsetup)(FAR struct sdio_dev_s *dev, FAR ubyte *buffer, size_t nbytes);
+ int (*sendsetup)(FAR struct sdio_dev_s *dev, FAR const ubyte *buffer, size_t nbytes);
+ int (*cancel)(FAR struct sdio_dev_s *dev);
+ int (*waitresponse)(FAR struct sdio_dev_s *dev, uint32 cmd);
+ int (*recvR1)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R1);
+ int (*recvR2)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 R2[4]);
+ int (*recvR3)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R3);
+ int (*recvR4)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R4);
+ int (*recvR5)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R5);
+ int (*recvR6)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R6);
+ int (*recvR7)(FAR struct sdio_dev_s *dev, uint32 cmd, uint32 *R7);
+ Event/Callback support: +
+void (*waitenable)(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset);
+ sdio_eventset_t (*eventwait)(FAR struct sdio_dev_s *dev, uint32 timeout);
+ void (*callbackenable)(FAR struct sdio_dev_s *dev, sdio_eventset_t eventset);
+ int (*registercallback)(FAR struct sdio_dev_s *dev, worker_t callback, void *arg);
+ DMA support: +
+boolean (*dmasupported)(FAR struct sdio_dev_s *dev);
+ int (*dmarecvsetup)(FAR struct sdio_dev_s *dev, FAR ubyte *buffer, size_t buflen);
+ int (*dmasendsetup)(FAR struct sdio_dev_s *dev, FAR const ubyte *buffer, size_t buflen);
struct sdio_dev_s from the hardware-specific SDIO device driver, and arch/arm/src/stm32/stm32_sdio.c and drivers/mmcsd/mmcsd_sdio.c
+ | diff --git a/include/nuttx/fb.h b/include/nuttx/fb.h index ead9ddf9bed..abbef7ded08 100644 --- a/include/nuttx/fb.h +++ b/include/nuttx/fb.h @@ -298,13 +298,13 @@ struct fb_vtable_s int (*getvideoinfo)(FAR struct fb_vtable_s *vtable, FAR struct fb_videoinfo_s *vinfo); int (*getplaneinfo)(FAR struct fb_vtable_s *vtable, int planeno, FAR struct fb_planeinfo_s *pinfo); - /* The following is provided only if the video hardware supports RGB color mapping */ + /* The following are provided only if the video hardware supports RGB color mapping */ #ifdef CONFIG_FB_CMAP int (*getcmap)(FAR struct fb_vtable_s *vtable, FAR struct fb_cmap_s *cmap); int (*putcmap)(FAR struct fb_vtable_s *vtable, FAR const struct fb_cmap_s *cmap); #endif - /* The following is provided only if the video hardware supports a hardware cursor */ + /* The following are provided only if the video hardware supports a hardware cursor */ #ifdef CONFIG_FB_HWCURSOR int (*getcursor)(FAR struct fb_vtable_s *vtable, FAR struct fb_cursorattrib_s *attrib); diff --git a/include/nuttx/mtd.h b/include/nuttx/mtd.h index f15bfe373cf..29666ca1101 100644 --- a/include/nuttx/mtd.h +++ b/include/nuttx/mtd.h @@ -94,9 +94,9 @@ struct mtd_dev_s ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const ubyte *buffer); - /* Some devices may support byte oriented read (optional). Byte-oriented - * writing is inherently block oriented on most MTD devices and is not supported. - * It is recommended that low-level drivers not support read() if it requires + /* Some devices may support byte oriented reads (optional). Most MTD devices + * are inherently block oriented so byte-oriented writing is not supported. It + * is recommended that low-level drivers not support read() if it requires * buffering. */ |