From 10e37ac9d9b043c37f5086cfd0ebb18afc2ed1fc Mon Sep 17 00:00:00 2001
From: patacongo Last Updated: December 5, 2008 Last Updated: December 16, 2008
NX Graphics Subsystem
- nxgl_mxpixel_t
that just contains the pixel: byte
if 16, 24, and 32 resolution
- support is disabled, uint16
if 24, and 32 resolution
- support is disabled, or uint32
.
+ support is disabled, uint16_t
if 24, and 32 resolution
+ support is disabled, or uint32_t
.
@@ -433,7 +433,7 @@ to change:
-typedef sint16 nxgl_coord_t; +typedef int16_t nxgl_coord_t;
@@ -501,7 +501,7 @@ struct nxgl_trapezoid_s
Function Prototype:
#include <nuttx/nxglib.h> -void nxgl_rgb2yuv(ubyte r, ubyte g, ubyte b, ubyte *y, ubyte *u, ubyte *v); +void nxgl_rgb2yuv(uint8_t r, uint8_t g, uint8_t b, uint8_t *y, uint8_t *u, uint8_t *v);
Description: @@ -512,7 +512,7 @@ void nxgl_rgb2yuv(ubyte r, ubyte g, ubyte b, ubyte *y, ubyte *u, ubyte *v);
Function Prototype:
#include <nuttx/nxglib.h> -void nxgl_yuv2rgb(ubyte y, ubyte u, ubyte v, ubyte *r, ubyte *g, ubyte *b); +void nxgl_yuv2rgb(uint8_t y, uint8_t u, uint8_t v, uint8_t *r, uint8_t *g, uint8_t *b);
Description: @@ -617,24 +617,24 @@ nxgl_nonintersecting(FAR struct nxgl_rect_s result[4],
Function Prototype:
#include <nuttx/nxglib.h> -boolean nxgl_rectoverlap(FAR struct nxgl_rect_s *rect1, - FAR struct nxgl_rect_s *rect2); +bool nxgl_rectoverlap(FAR struct nxgl_rect_s *rect1, + FAR struct nxgl_rect_s *rect2);
Description: - Return TRUE if the two rectangles overlap. + Return true if the two rectangles overlap.
nxgl_rectinside()
Function Prototype:
#include <nuttx/nxglib.h> -boolean nxgl_rectinside(FAR const struct nxgl_rect_s *rect, - FAR const struct nxgl_point_s *pt); +bool nxgl_rectinside(FAR const struct nxgl_rect_s *rect, + FAR const struct nxgl_point_s *pt);
Description:
- Return TRUE if the point pt
lies within rect
.
+ Return true if the point pt
lies within rect
.
nxgl_rectsize()
Function Prototype:
#include <nuttx/nxglib.h> -boolean nxgl_nullrect(FAR const struct nxgl_rect_s *rect); +bool nxgl_nullrect(FAR const struct nxgl_rect_s *rect);
Description: - Return TRUE if the area of the retangle is <= 0. + Return true if the area of the retangle is <= 0.
nxgl_runoffset()
Callback Function Prototype:
void redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect, - boolean more, FAR void *arg); + bool more, FAR void *arg);
Description: @@ -812,7 +812,7 @@ void redraw(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
rect
more
- arg
nx_openwindow()
)
@@ -860,7 +860,7 @@ void position(NXWINDOW hwnd, FAR const struct nxgl_size_s *size,
#ifdef CONFIG_NX_MOUSE void mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos, - ubyte buttons, FAR void *arg); + uint8_t buttons, FAR void *arg); #endif
@@ -889,7 +889,7 @@ void mousein(NXWINDOW hwnd, FAR const struct nxgl_point_s *pos,
Callback Function Prototype:
#ifdef CONFIG_NX_KBD -void (*kbdin)(NXWINDOW hwnd, ubyte nch, FAR const ubyte *ch, FAR void *arg); +void (*kbdin)(NXWINDOW hwnd, uint8_t nch, FAR const uint8_t *ch, FAR void *arg); #endif
@@ -1677,8 +1677,8 @@ int nx_bitmap(NXWINDOW hwnd, FAR const struct nxgl_rect_s *dest, #include <nuttx/nx.h> #ifdef CONFIG_NX_KBD -int nx_kbdchin(NXHANDLE handle, ubyte ch); -int nx_kbdin(NXHANDLE handle, ubyte nch, FAR const ubyte *ch); +int nx_kbdchin(NXHANDLE handle, uint8_t ch); +int nx_kbdin(NXHANDLE handle, uint8_t nch, FAR const uint8_t *ch); #endif
@@ -1700,7 +1700,7 @@ int nx_kbdin(NXHANDLE handle, ubyte nch, FAR const ubyte *ch); #include <nuttx/nx.h> #ifdef CONFIG_NX_MOUSE -int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, ubyte buttons); +int nx_mousein(NXHANDLE handle, nxgl_coord_t x, nxgl_coord_t y, uint8_t buttons); #endif
@@ -2341,12 +2341,12 @@ int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd,
struct nx_fontmetic_s { - uint32 stride : 2; /* Width of one font row in bytes */ - uint32 width : 6; /* Width of the font in bits */ - uint32 height : 6; /* Height of the font in rows */ - uint32 xoffset : 6; /* Top, left-hand corner X-offset in pixels */ - uint32 yoffset : 6; /* Top, left-hand corner y-offset in pixels */ - uint32 unused : 6; + uint32_t stride : 2; /* Width of one font row in bytes */ + uint32_t width : 6; /* Width of the font in bits */ + uint32_t height : 6; /* Height of the font in rows */ + uint32_t xoffset : 6; /* Top, left-hand corner X-offset in pixels */ + uint32_t yoffset : 6; /* Top, left-hand corner y-offset in pixels */ + uint32_t unused : 6; };@@ -2357,7 +2357,7 @@ struct nx_fontmetic_s struct nx_fontbitmap_s { struct nx_fontmetic_s metric; /* Character metrics */ - FAR const ubyte *bitmap; /* Pointer to the character bitmap */ + FAR const uint8_t *bitmap; /* Pointer to the character bitmap */ }; @@ -2369,8 +2369,8 @@ struct nx_fontbitmap_s
struct nx_fontset_s { - ubyte first; /* First bitmap character code */ - ubyte nchars; /* Number of bitmap character codes */ + uint8_t first; /* First bitmap character code */ + uint8_t nchars; /* Number of bitmap character codes */ FAR const struct nx_fontbitmap_s *bitmap; };@@ -2381,10 +2381,10 @@ struct nx_fontset_s
struct nx_font_s { - ubyte mxheight; /* Max height of one glyph in rows */ - ubyte mxwidth; /* Max width of any glyph in pixels */ - ubyte mxbits; /* Max number of bits per character code */ - ubyte spwidth; /* The width of a space in pixels */ + uint8_t mxheight; /* Max height of one glyph in rows */ + uint8_t mxwidth; /* Max width of any glyph in pixels */ + uint8_t mxbits; /* Max number of bits per character code */ + uint8_t spwidth; /* The width of a space in pixels */ };@@ -2414,7 +2414,7 @@ FAR const struct nx_font_s *nxf_getfontset(void); #include <nuttx/nxglib.h> #include <nuttx/nxfonts.h> -FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16 ch); +FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16_t ch);
Description: @@ -2438,28 +2438,28 @@ FAR const struct nx_fontbitmap_s *nxf_getbitmap(uint16 ch); #include <nuttx/nxglib.h> #include <nuttx/nxfonts.h> -int nxf_convert_2bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_2bpp(FAR uint8_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_4bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_4bpp(FAR uint8_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_8bpp(FAR ubyte *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_8bpp(FAR uint8_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_16bpp(FAR uint16 *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_16bpp(FAR uint16_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_24bpp(FAR uint32 *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_24bpp(FAR uint32_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); -int nxf_convert_32bpp(FAR uint32 *dest, uint16 height, - uint16 width, uint16 stride, +int nxf_convert_32bpp(FAR uint32_t *dest, uint16_t height, + uint16_t width, uint16_t stride, FAR const struct nx_fontbitmap_s *bm, nxgl_mxpixel_t color); diff --git a/Documentation/NuttX.html b/Documentation/NuttX.html index 6774545144..f655d0da06 100644 --- a/Documentation/NuttX.html +++ b/Documentation/NuttX.html @@ -8,7 +8,7 @@
Last Updated: December 13, 2009
+Last Updated: December 16, 2009
Last Updated: December 12, 2009
+Last Updated: December 16, 2009
@@ -330,14 +330,22 @@ This provides architecture/toolchain-specific definitions for standard types. This file shouldtypedef
:
- sbyte, ubyte, uint8, boolean, sint16, uint16, sint32, uint32
+ _int8_t, _uint8_t, _int16_t, _uint16_t, _int32_t, _uint32_t_t
and if the architecture supports 64-bit integers
+and if the architecture supports 24- or 64-bit integers
- sint64, uint64
+ _int24_t, _uint24_t, int64_t, uint64_t
- and finally + NOTE that these type names have a leading underscore character. This + file will be included(indirectly) by include/stdint.h and typedef'ed to + the final name without the underscore character. This roundabout way of + doings things allows the stdint.h to be removed from the include/ + directory in the event that the user prefers to use the definitions + provided by their toolchain header files +
++ And finally
irqstate_t
@@ -1239,7 +1247,7 @@ The system can be re-made subsequently by just typing make
.
4.1.10 up_reprioritize_rtr()
-Prototype: void up_reprioritize_rtr(FAR _TCB *tcb, ubyte priority);
+Prototype: void up_reprioritize_rtr(FAR _TCB *tcb, uint8_t priority);
Description.
Called when the priority of a running or
@@ -1289,8 +1297,8 @@ The system can be re-made subsequently by just typing make
.
4.1.12 up_assert()
Prototype:
- void up_assert(FAR const ubyte *filename, int linenum);
- void up_assert_code(FAR const ubyte *filename, int linenum, int error_code);
+ void up_assert(FAR const uint8_t *filename, int linenum);
+ void up_assert_code(FAR const uint8_t *filename, int linenum, int error_code);
Description.
@@ -1360,11 +1368,10 @@ The system can be re-made subsequently by just typing make
.
4.1.15 up_interrupt_context()
-Prototype: boolean up_interrupt_context(void)
+Prototype: bool up_interrupt_context(void)
Description.
- Return TRUE is we are currently executing in
- the interrupt handler context.
+ Return true if we are currently executing in the interrupt handler context.
4.1.16 up_disable_irq()
@@ -1710,7 +1717,7 @@ extern void up_ledoff(int led);
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 poll(FAR struct file *filp, struct pollfd *fds, bool setup);
void lock(FAR struct spi_dev_s *dev);
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 select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected);
+ uint32_t setfrequency(FAR struct spi_dev_s *dev, uint32_t 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);
+ uint8_t status(FAR struct spi_dev_s *dev, enum spi_dev_e devid);
+ uint16_t send(FAR struct spi_dev_s *dev, uint16_t wd);
void exchange(FAR struct spi_dev_s *dev, FAR const void *txbuffer, FAR void *rxbuffer, size_t nwords);
int registercallback(FAR struct spi_dev_s *dev, mediachange_t callback, void *arg);
struct i2c_ops_s
.
That structure defines a call table with the following methods:
uint32 setfrequency(FAR struct i2c_dev_s *dev, uint32 frequency);
+
uint32_t setfrequency(FAR struct i2c_dev_s *dev, uint32_t 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);
int write(FAR struct i2c_dev_s *dev, const uint8_t *buffer, int buflen);
int read(FAR struct i2c_dev_s *dev, uint8_t *buffer, int buflen);
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 rxint(FAR struct uart_dev_s *dev, bool enable);
bool 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);
+ void txint(FAR struct uart_dev_s *dev, bool enable);
bool txready(FAR struct uart_dev_s *dev);
bool txempty(FAR struct uart_dev_s *dev);
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);
ssize_t (*bread)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR uint8_t *buffer);
+ ssize_t (*bwrite)(FAR struct mtd_dev_s *dev, off_t startblock, size_t nblocks, FAR const uint8_t *buffer);
Some devices may support byte oriented reads (optional). @@ -2001,7 +2008,7 @@ extern void up_ledoff(int led); 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);
ssize_t (*read)(FAR struct mtd_dev_s *dev, off_t offset, size_t nbytes, FAR uint8_t *buffer);
Support other, less frequently used commands: @@ -2050,8 +2057,8 @@ extern void up_ledoff(int led);
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);
+ uint8_t (*status)(FAR struct sdio_dev_s *dev);
+ void (*widebus)(FAR struct sdio_dev_s *dev, bool enable);
void (*clock)(FAR struct sdio_dev_s *dev, enum sdio_clock_e rate);
int (*attach)(FAR struct sdio_dev_s *dev);
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);
+
void (*sendcmd)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t arg);
+ int (*recvsetup)(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, size_t nbytes);
+ int (*sendsetup)(FAR struct sdio_dev_s *dev, FAR const uint8_t *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);
int (*waitresponse)(FAR struct sdio_dev_s *dev, uint32_t cmd);
int (*recvR1)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R1);
int (*recvR2)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t R2[4]);
int (*recvR3)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R3);
int (*recvR4)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R4);
int (*recvR5)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R5);
int (*recvR6)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *R6);
int (*recvR7)(FAR struct sdio_dev_s *dev, uint32_t cmd, uint32_t *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);
+ sdio_eventset_t (*eventwait)(FAR struct sdio_dev_s *dev, uint32_t 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);
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);
bool (*dmasupported)(FAR struct sdio_dev_s *dev);
+ int (*dmarecvsetup)(FAR struct sdio_dev_s *dev, FAR uint8_t *buffer, size_t buflen);
+ int (*dmasendsetup)(FAR struct sdio_dev_s *dev, FAR const uint8_t *buffer, size_t buflen);
#include <sched.h> - int task_init(_TCB *tcb, char *name, int priority, uint32 *stack, uint32 stack_size, + int task_init(_TCB *tcb, char *name, int priority, uint32_t *stack, uint32_t stack_size, maint_t entry, const char *argv[]);@@ -346,7 +346,7 @@ mechanism to initialize and start a new task. POSIX Compatibility: This is a NON-POSIX interface. VxWorks provides the following similar interface:
- STATUS taskInit(WIND_TCB *pTcb, char *name, int priority, int options, uint32 *pStackBase, int stackSize, + STATUS taskInit(WIND_TCB *pTcb, char *name, int priority, int options, uint32_t *pStackBase, int stackSize, FUNCPTR entryPt, int arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9, int arg10);@@ -1039,7 +1039,7 @@ VxWorks provides the comparable interface: Function Prototype:
#include <sched.h> - sint32 sched_lockcount( void ) + int32_t sched_lockcount( void )
@@ -2363,8 +2363,8 @@ wd_start() on a given watchdog ID has any effect.
@@ -6555,16 +6555,16 @@ int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt);
struct fat_format_s { - ubyte ff_nfats; /* Number of FATs */ - ubyte ff_fattype; /* FAT size: 0 (autoselect), 12, 16, or 32 */ - ubyte ff_clustshift; /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */ - ubyte ff_volumelabel[11]; /* Volume label */ - uint16 ff_backupboot; /* Sector number of the backup boot sector (0=use default)*/ - uint16 ff_rootdirentries; /* Number of root directory entries */ - uint16 ff_rsvdseccount; /* Reserved sectors */ - uint32 ff_hidsec; /* Count of hidden sectors preceding fat */ - uint32 ff_volumeid; /* FAT volume id */ - uint32 ff_nsectors; /* Number of sectors from device to use: 0: Use all */ + uint8_t ff_nfats; /* Number of FATs */ + uint8_t ff_fattype; /* FAT size: 0 (autoselect), 12, 16, or 32 */ + uint8_t ff_clustshift; /* Log2 of sectors per cluster: 0-5, 0xff (autoselect) */ + uint8_t ff_volumelabel[11]; /* Volume label */ + uint16_t ff_backupboot; /* Sector number of the backup boot sector (0=use default)*/ + uint16_t ff_rootdirentries; /* Number of root directory entries */ + uint16_t ff_rsvdseccount; /* Reserved sectors */ + uint32_t ff_hidsec; /* Count of hidden sectors preceding fat */ + uint32_t ff_volumeid; /* FAT volume id */ + uint32_t ff_nsectors; /* Number of sectors from device to use: 0: Use all */ };
- Where argc is the number of uint32 type arguments that follow. + Where argc is the number of uint32_t type arguments that follow.
- The arguments are passed as uint32 values. - For systems where the sizeof(pointer) < sizeof(uint32), the + The arguments are passed as uint32_t values. + For systems where the sizeof(pointer) < sizeof(uint32_t), the following union defines the alignment of the pointer within the - uint32. For example, the SDCC MCS51 general pointer is - 24-bits, but uint32 is 32-bits (of course). + uint32_t. For example, the SDCC MCS51 general pointer is + 24-bits, but uint32_t is 32-bits (of course).union wdparm_u { void *pvarg; - uint32 *dwarg; + uint32_t *dwarg; }; typedef union wdparm_u wdparm_t;
- For most 32-bit systems, pointers and uint32 are the same size - For systems where sizeof(pointer) > sizeof(uint32), we will + For most 32-bit systems, pointers and uint32_t are the same size + For systems where sizeof(pointer) > sizeof(uint32_t), we will have to do some redesign.