Clean up and review of header files for conformance to standards

This commit is contained in:
Gregory Nutt 2015-06-12 18:07:47 -06:00
parent bbe54afd14
commit bf9e1943a4
33 changed files with 624 additions and 537 deletions

View file

@ -1,7 +1,7 @@
/****************************************************************************
* arch/lpc214x/irq.h
*
* Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2008, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -110,14 +110,15 @@ typedef void (*vic_vector_t)(uint32_t *regs);
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
#ifndef CONFIG_VECTORED_INTERRUPTS
EXTERN void up_attach_vector(int irq, int vector, vic_vector_t handler);
EXTERN void up_detach_vector(int vector);
void up_attach_vector(int irq, int vector, vic_vector_t handler);
void up_detach_vector(int vector);
#endif
#undef EXTERN

View file

@ -2,6 +2,7 @@
* arch/lpc2378/irq.h
*
* Copyright (C) 2010 Rommel Marcelo. All rights reserved.
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Rommel Marcelo
*
* This file is part of the NuttX RTOS and based on the lpc2148 port:
@ -103,10 +104,10 @@
*/
#define SYSTIMER_VEC 0 /* System timer */
#define CLASS_IRQ 0
#define CLASS_FIQ 1
#define PRIORITY_LOWEST 15
#define PRIORITY_HIGHEST 0 /* System timer */
#define CLASS_IRQ 0
#define CLASS_FIQ 1
#define PRIORITY_LOWEST 15
#define PRIORITY_HIGHEST 0 /* System timer */
/****************************************************************************
* Public Types
@ -131,14 +132,15 @@ typedef void (*vic_vector_t)(uint32_t *regs);
#ifndef __ASSEMBLY__
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
#ifndef CONFIG_VECTORED_INTERRUPTS
EXTERN void up_attach_vector(int irq, int priority, vic_vector_t handler);
EXTERN void up_detach_vector(int vector);
void up_attach_vector(int irq, int priority, vic_vector_t handler);
void up_detach_vector(int vector);
#endif
#undef EXTERN
@ -148,4 +150,3 @@ EXTERN void up_detach_vector(int vector);
#endif
#endif /* __ARCH_LPC2378_IRQ_H */

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/netinet/ether.h
*
* Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2009, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -58,16 +58,18 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
EXTERN FAR char *ether_ntoa(FAR const struct ether_addr *addr);
EXTERN struct ether_addr *ether_aton(const char *asc);
EXTERN int ether_ntohost(char *hostname, const struct ether_addr *addr);
EXTERN int ether_hostton(const char *hostname, struct ether_addr *addr);
EXTERN int ether_line(const char *line, struct ether_addr *addr, char *hostname);
FAR char *ether_ntoa(FAR const struct ether_addr *addr);
FAR struct ether_addr *ether_aton(FAR const char *asc);
int ether_ntohost(FAR char *hostname, FAR const struct ether_addr *addr);
int ether_hostton(FAR const char *hostname, FAR struct ether_addr *addr);
int ether_line(FAR const char *line, FAR struct ether_addr *addr,
FAR char *hostname);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/analog/pga11x.h
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
*
* References:
@ -182,7 +182,8 @@ struct pga11x_settings_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -203,7 +204,7 @@ extern "C" {
*
****************************************************************************/
EXTERN PGA11X_HANDLE pga11x_initialize(FAR struct spi_dev_s *spi);
PGA11X_HANDLE pga11x_initialize(FAR struct spi_dev_s *spi);
/****************************************************************************
* Name: pga11x_select
@ -220,12 +221,12 @@ EXTERN PGA11X_HANDLE pga11x_initialize(FAR struct spi_dev_s *spi);
* settings - New channel and gain settings
*
* Returned Value:
* Zero on sucess; a negated errno value on failure.
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
EXTERN int pga11x_select(PGA11X_HANDLE handle,
FAR const struct pga11x_settings_s *settings);
int pga11x_select(PGA11X_HANDLE handle,
FAR const struct pga11x_settings_s *settings);
/****************************************************************************
* Name: pga11x_uselect
@ -242,13 +243,13 @@ EXTERN int pga11x_select(PGA11X_HANDLE handle,
* settings - New channel and gain settings
*
* Returned Value:
* Zero on sucess; a negated errno value on failure.
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_PGA11X_DAISYCHAIN
EXTERN int pga11x_uselect(PGA11X_HANDLE handle, int pos,
FAR const struct pga11x_usettings_s *settings);
int pga11x_uselect(PGA11X_HANDLE handle, int pos,
FAR const struct pga11x_usettings_s *settings);
#endif
/****************************************************************************
@ -266,12 +267,11 @@ EXTERN int pga11x_uselect(PGA11X_HANDLE handle, int pos,
* settings - Returned channel and gain settings
*
* Returned Value:
* Zero on sucess; a negated errno value on failure.
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
EXTERN int pga11x_read(PGA11X_HANDLE handle,
FAR struct pga11x_settings_s *settings);
int pga11x_read(PGA11X_HANDLE handle, FAR struct pga11x_settings_s *settings);
/****************************************************************************
* Name: pga11x_uread
@ -288,13 +288,13 @@ EXTERN int pga11x_read(PGA11X_HANDLE handle,
* settings - Returned channel and gain settings
*
* Returned Value:
* Zero on sucess; a negated errno value on failure.
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_PGA11X_DAISYCHAIN
EXTERN int pga11x_uread(PGA11X_HANDLE handle, int pos,
FAR struct pga11x_usettings_s *settings);
int pga11x_uread(PGA11X_HANDLE handle, int pos,
FAR struct pga11x_usettings_s *settings);
#endif
/****************************************************************************
@ -311,11 +311,11 @@ EXTERN int pga11x_uread(PGA11X_HANDLE handle, int pos,
* spi - An SPI "bottom half" device driver instance
*
* Returned Value:
* Zero on sucess; a negated errno value on failure.
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
EXTERN int pga11x_shutdown(PGA11X_HANDLE handle);
int pga11x_shutdown(PGA11X_HANDLE handle);
/****************************************************************************
* Name: pga11x_ushutdown
@ -331,12 +331,12 @@ EXTERN int pga11x_shutdown(PGA11X_HANDLE handle);
* pos - Position of the chip in the daisy chain (0 or 1)
*
* Returned Value:
* Zero on sucess; a negated errno value on failure.
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_PGA11X_DAISYCHAIN
EXTERN int pga11x_ushutdown(PGA11X_HANDLE handle, int pos);
int pga11x_ushutdown(PGA11X_HANDLE handle, int pos);
#endif
/****************************************************************************
@ -353,11 +353,11 @@ EXTERN int pga11x_ushutdown(PGA11X_HANDLE handle, int pos);
* spi - An SPI "bottom half" device driver instance
*
* Returned Value:
* Zero on sucess; a negated errno value on failure.
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
EXTERN int pga11x_enable(PGA11X_HANDLE handle);
int pga11x_enable(PGA11X_HANDLE handle);
/****************************************************************************
* Name: pga11x_uenable
@ -373,12 +373,12 @@ EXTERN int pga11x_enable(PGA11X_HANDLE handle);
* pos - Position of the chip in the daisy chain (0 or 1)
*
* Returned Value:
* Zero on sucess; a negated errno value on failure.
* Zero on success; a negated errno value on failure.
*
****************************************************************************/
#ifdef CONFIG_PGA11X_DAISYCHAIN
EXTERN int pga11x_uenable(PGA11X_HANDLE handle, int pos);
int pga11x_uenable(PGA11X_HANDLE handle, int pos);
#endif
#undef EXTERN

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/fs/fat.h
*
* Copyright (C) 2007-2009, 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2007-2009, 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -71,7 +71,8 @@ typedef uint8_t fat_attrib_t;
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -84,8 +85,9 @@ extern "C" {
*
****************************************************************************/
EXTERN int fat_getattrib(const char *path, fat_attrib_t *attrib);
EXTERN int fat_setattrib(const char *path, fat_attrib_t setbits, fat_attrib_t clearbits);
int fat_getattrib(FAR const char *path, FAR fat_attrib_t *attrib);
int fat_setattrib(FAR const char *path, fat_attrib_t setbits,
fat_attrib_t clearbits);
/****************************************************************************
* Name: fat_dma_alloc and fat_dma_free
@ -110,8 +112,8 @@ EXTERN int fat_setattrib(const char *path, fat_attrib_t setbits, fat_attrib_t cl
****************************************************************************/
#ifdef CONFIG_FAT_DMAMEMORY
EXTERN FAR void *fat_dma_alloc(size_t size);
EXTERN void fat_dma_free(FAR void *memory, size_t size);
FAR void *fat_dma_alloc(size_t size);
void fat_dma_free(FAR void *memory, size_t size);
#endif
#undef EXTERN

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/fs/mkfatfs.h
*
* Copyright (C) 2008-2009, 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2009, 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -77,7 +77,7 @@
****************************************************************************/
/* These are input parameters for the format. On return, these values may be
* overwritted with actual values used in the format.
* overwritten with actual values used in the format.
*/
struct fat_format_s
@ -105,7 +105,8 @@ struct fat_format_s
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -137,7 +138,8 @@ extern "C" {
* device is indeterminate (but likely not good).
*
****************************************************************************/
EXTERN int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt);
int mkfatfs(FAR const char *pathname, FAR struct fat_format_s *fmt);
#undef EXTERN
#if defined(__cplusplus)

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/fs/mksmartfs.h
*
* Copyright (C) 2013 Ken Pettit. All rights reserved.
* Copyright (C) 2013, 2015 Ken Pettit. All rights reserved.
* Author: Ken Pettit <pettitkd@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
@ -62,7 +62,8 @@
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -96,9 +97,9 @@ extern "C" {
****************************************************************************/
#ifdef CONFIG_SMARTFS_MULTI_ROOT_DIRS
EXTERN int mksmartfs(FAR const char *pathname, uint8_t nrootdirs);
int mksmartfs(FAR const char *pathname, uint8_t nrootdirs);
#else
EXTERN int mksmartfs(FAR const char *pathname);
int mksmartfs(FAR const char *pathname);
#endif
#undef EXTERN

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/fs/nxffs.h
*
* Copyright (C) 2011-2013 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2013, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -113,7 +113,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -133,7 +134,7 @@ extern "C" {
*
****************************************************************************/
EXTERN int nxffs_initialize(FAR struct mtd_dev_s *mtd);
int nxffs_initialize(FAR struct mtd_dev_s *mtd);
/****************************************************************************
* Name: nxffs_dump
@ -153,7 +154,7 @@ EXTERN int nxffs_initialize(FAR struct mtd_dev_s *mtd);
*
****************************************************************************/
EXTERN int nxffs_dump(FAR struct mtd_dev_s *mtd, bool verbose);
int nxffs_dump(FAR struct mtd_dev_s *mtd, bool verbose);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/input/max11802.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Authors: Gregory Nutt <gnutt@nuttx.org>
* Petteri Aimonen <jpa@nx.mail.kapsi.fi>
*
@ -104,7 +104,7 @@
*
* Memory for this structure is provided by the caller. It is not copied
* by the driver and is presumed to persist while the driver is active. The
* memory must be writable because, under certain circumstances, the driver
* memory must be writeable because, under certain circumstances, the driver
* may modify frequency or X plate resistance values.
*/
@ -138,7 +138,8 @@ struct max11802_config_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -162,9 +163,8 @@ extern "C" {
*
****************************************************************************/
EXTERN int max11802_register(FAR struct spi_dev_s *spi,
FAR struct max11802_config_s *config,
int minor);
int max11802_register(FAR struct spi_dev_s *spi,
FAR struct max11802_config_s *config, int minor);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/********************************************************************************************
* include/nuttx/input/stmpe811.h
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
@ -63,7 +63,7 @@
* CONFIG_INPUT_STMPE811
* Enables support for the STMPE811 driver (Needs CONFIG_INPUT)
* CONFIG_STMPE811_SPI
* Enables support for the SPI interface (not currenly supported)
* Enables support for the SPI interface (not currently supported)
* CONFIG_STMPE811_I2C
* Enables support for the I2C interface
* CONFIG_STMPE811_MULTIPLE
@ -78,7 +78,7 @@
* CONFIG_STMPE811_GPIO_DISABLE
* Disable driver GPIO functionality.
* CONFIG_STMPE811_GPIOINT_DISABLE
* Disable driver GPIO interrupt functionlality (ignored if GPIO functionality is
* Disable driver GPIO interrupt functionality (ignored if GPIO functionality is
* disabled).
* CONFIG_STMPE811_SWAPXY
* Reverse the meaning of X and Y to handle different LCD orientations.
@ -459,11 +459,11 @@
typedef void (*stmpe811_handler_t)(int pin);
/* A reference to a structure of this type must be passed to the STMPE811 driver when the
* driver is instantiaed. This structure provides information about the configuration of the
* driver is instantiated. This structure provides information about the configuration of the
* STMPE811 and provides some board-specific hooks.
*
* Memory for this structure is provided by the caller. It is not copied by the driver
* and is presumed to persist while the driver is active. The memory must be writable
* and is presumed to persist while the driver is active. The memory must be writeable
* because, under certain circumstances, the driver may modify the frequency.
*/
@ -508,10 +508,10 @@ struct stmpe811_config_s
void (*clear)(FAR struct stmpe811_config_s *state);
};
/* Since the STMPE811 is a multi-function device, no functionality is assumed when the device
* is first created. Rather, a multi-step initialization is required. When
* stmpe811_instantiate is called, it returns a handle of the following type. That handle may
* then be used to enable a configure the STMPE811 functionality.
/* Since the STMPE811 is a multi-function device, no functionality is assumed when the
* device is first created. Rather, a multi-step initialization is required. When
* stmpe811_instantiate is called, it returns a handle of the following type. That handle
* may then be used to enable a configure the STMPE811 functionality.
*/
typedef FAR void *STMPE811_HANDLE;
@ -522,7 +522,8 @@ typedef FAR void *STMPE811_HANDLE;
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -536,7 +537,7 @@ extern "C" {
*
* Input Parameters:
* dev - An I2C or SPI driver instance
* config - Persistant board configuration data
* config - Persistent board configuration data
*
* Returned Value:
* A non-zero handle is returned on success. This handle may then be used to configure
@ -545,11 +546,11 @@ extern "C" {
********************************************************************************************/
#ifdef CONFIG_STMPE811_SPI
EXTERN STMPE811_HANDLE stmpe811_instantiate(FAR struct spi_dev_s *dev,
FAR struct stmpe811_config_s *config);
STMPE811_HANDLE stmpe811_instantiate(FAR struct spi_dev_s *dev,
FAR struct stmpe811_config_s *config);
#else
EXTERN STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev,
FAR struct stmpe811_config_s *config);
STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev,
FAR struct stmpe811_config_s *config);
#endif
/********************************************************************************************
@ -557,7 +558,7 @@ EXTERN STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev,
*
* Description:
* Enable TSC functionality. GPIO4-7 must be available. This function will register the
* touchsceen driver as /dev/inputN where N is the minor device number
* touchscreen driver as /dev/inputN where N is the minor device number
*
* Input Parameters:
* handle - The handle previously returned by stmpe811_instantiate
@ -570,7 +571,7 @@ EXTERN STMPE811_HANDLE stmpe811_instantiate(FAR struct i2c_dev_s *dev,
********************************************************************************************/
#ifndef CONFIG_STMPE811_TSC_DISABLE
EXTERN int stmpe811_register(STMPE811_HANDLE handle, int minor);
int stmpe811_register(STMPE811_HANDLE handle, int minor);
#endif
/********************************************************************************************
@ -590,7 +591,7 @@ EXTERN int stmpe811_register(STMPE811_HANDLE handle, int minor);
********************************************************************************************/
#ifndef CONFIG_STMPE811_GPIO_DISABLE
EXTERN int stmpe811_gpioconfig(STMPE811_HANDLE handle, uint8_t pinconfig);
int stmpe811_gpioconfig(STMPE811_HANDLE handle, uint8_t pinconfig);
#endif
/********************************************************************************************
@ -610,7 +611,7 @@ EXTERN int stmpe811_gpioconfig(STMPE811_HANDLE handle, uint8_t pinconfig);
********************************************************************************************/
#ifndef CONFIG_STMPE811_GPIO_DISABLE
EXTERN void stmpe811_gpiowrite(STMPE811_HANDLE handle, uint8_t pinconfig, bool value);
void stmpe811_gpiowrite(STMPE811_HANDLE handle, uint8_t pinconfig, bool value);
#endif
/********************************************************************************************
@ -631,7 +632,7 @@ EXTERN void stmpe811_gpiowrite(STMPE811_HANDLE handle, uint8_t pinconfig, bool v
********************************************************************************************/
#ifndef CONFIG_STMPE811_GPIO_DISABLE
EXTERN int stmpe811_gpioread(STMPE811_HANDLE handle, uint8_t pinconfig, bool *value);
int stmpe811_gpioread(STMPE811_HANDLE handle, uint8_t pinconfig, bool *value);
#endif
/********************************************************************************************
@ -656,8 +657,7 @@ EXTERN int stmpe811_gpioread(STMPE811_HANDLE handle, uint8_t pinconfig, bool *va
********************************************************************************************/
#if !defined(CONFIG_STMPE811_GPIO_DISABLE) && !defined(CONFIG_STMPE811_GPIOINT_DISABLE)
EXTERN int stmpe811_gpioattach(STMPE811_HANDLE handle, uint8_t pinconfig,
stmpe811_handler_t handler);
int stmpe811_gpioattach(STMPE811_HANDLE handle, uint8_t pinconfig, stmpe811_handler_t handler);
#endif
/********************************************************************************************
@ -676,7 +676,7 @@ EXTERN int stmpe811_gpioattach(STMPE811_HANDLE handle, uint8_t pinconfig,
********************************************************************************************/
#ifndef CONFIG_STMPE811_ADC_DISABLE
EXTERN int stmpe811_adcinitialize(STMPE811_HANDLE handle);
int stmpe811_adcinitialize(STMPE811_HANDLE handle);
#endif
/********************************************************************************************
@ -696,7 +696,7 @@ EXTERN int stmpe811_adcinitialize(STMPE811_HANDLE handle);
********************************************************************************************/
#ifndef CONFIG_STMPE811_ADC_DISABLE
EXTERN int stmpe811_adcconfig(STMPE811_HANDLE handle, int pin);
int stmpe811_adcconfig(STMPE811_HANDLE handle, int pin);
#endif
/********************************************************************************************
@ -715,7 +715,7 @@ EXTERN int stmpe811_adcconfig(STMPE811_HANDLE handle, int pin);
********************************************************************************************/
#ifndef CONFIG_STMPE811_ADC_DISABLE
EXTERN uint16_t stmpe811_adcread(STMPE811_HANDLE handle, int pin);
uint16_t stmpe811_adcread(STMPE811_HANDLE handle, int pin);
#endif
/********************************************************************************************
@ -733,7 +733,7 @@ EXTERN uint16_t stmpe811_adcread(STMPE811_HANDLE handle, int pin);
*
********************************************************************************************/
EXTERN int stmpe811_tempinitialize(STMPE811_HANDLE handle);
int stmpe811_tempinitialize(STMPE811_HANDLE handle);
/********************************************************************************************
* Name: stmpe811_tempread
@ -750,7 +750,7 @@ EXTERN int stmpe811_tempinitialize(STMPE811_HANDLE handle);
*
********************************************************************************************/
EXTERN uint16_t stmpe811_tempread(STMPE811_HANDLE handle);
uint16_t stmpe811_tempread(STMPE811_HANDLE handle);
/********************************************************************************************
* Name: stmpe811_tempinterrupt
@ -767,7 +767,7 @@ EXTERN uint16_t stmpe811_tempread(STMPE811_HANDLE handle);
* threshold value; False: Generate an interrupt if the
* temperature falls below the threshold value.
* callback - The client callback function that will be called when
* the termperature crosses the threshold.
* the temperature crosses the threshold.
*
* Returned Value:
* Zero is returned on success. Otherwise, a negated errno value is returned to indicate

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/input/tsc2007.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References:
@ -91,7 +91,7 @@
*
* Memory for this structure is provided by the caller. It is not copied
* by the driver and is presumed to persist while the driver is active. The
* memory must be writable because, under certain circumstances, the driver
* memory must be writeable because, under certain circumstances, the driver
* may modify frequency or X plate resistance values.
*/
@ -135,7 +135,8 @@ struct tsc2007_config_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -150,7 +151,7 @@ extern "C" {
*
* Input Parameters:
* dev - An I2C driver instance
* config - Persistant board configuration data
* config - Persistent board configuration data
* minor - The input device minor number
*
* Returned Value:
@ -159,9 +160,8 @@ extern "C" {
*
****************************************************************************/
EXTERN int tsc2007_register(FAR struct i2c_dev_s *dev,
FAR struct tsc2007_config_s *config,
int minor);
int tsc2007_register(FAR struct i2c_dev_s *dev,
FAR struct tsc2007_config_s *config, int minor);
#undef EXTERN
#ifdef __cplusplus

View file

@ -4,7 +4,7 @@
* Interface definition for the MI0283QT-2 LCD from Multi-Inno Technology Co., Ltd.
* This LCD is based on the Himax HX8347-D LCD controller.
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -106,7 +106,8 @@ struct mio283qt2_lcd_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -125,7 +126,7 @@ extern "C" {
*
**************************************************************************************/
EXTERN FAR struct lcd_dev_s *mio283qt2_lcdinitialize(FAR struct mio283qt2_lcd_s *lcd);
FAR struct lcd_dev_s *mio283qt2_lcdinitialize(FAR struct mio283qt2_lcd_s *lcd);
/**************************************************************************************
* Name: mio283qt2_clear
@ -138,7 +139,7 @@ EXTERN FAR struct lcd_dev_s *mio283qt2_lcdinitialize(FAR struct mio283qt2_lcd_s
*
**************************************************************************************/
EXTERN void mio283qt2_clear(FAR struct lcd_dev_s *dev, uint16_t color);
void mio283qt2_clear(FAR struct lcd_dev_s *dev, uint16_t color);
#undef EXTERN
#ifdef __cplusplus

View file

@ -2,7 +2,7 @@
* include/nuttx/lcd/nokia6100.h
* Application interface to the Nokia 6100 LCD display
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -86,7 +86,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -95,43 +96,45 @@ extern "C" {
* Public Function Prototypes
****************************************************************************/
/**************************************************************************************
/****************************************************************************
* Name: nokia_lcdinitialize
*
* Description:
* Initialize the NOKIA6100 video hardware. The initial state of the LCD is fully
* initialized, display memory cleared, and the LCD ready to use, but with the power
* setting at 0 (full off == sleep mode).
* Initialize the NOKIA6100 video hardware. The initial state of the LCD
* is fully initialized, display memory cleared, and the LCD ready to use,
* but with the powersetting at 0 (full off == sleep mode).
*
* Input Parameters:
*
* spi - A reference to the SPI driver instance.
* devno - A value in the range of 0 throuh CONFIG_NOKIA6100_NINTERFACES-1. This
* allows support for multiple LCD devices.
* devno - A value in the range of 0 throuh CONFIG_NOKIA6100_NINTERFACES-1.
* This allows support for multiple LCD devices.
*
* Returned Value:
*
* On success, this function returns a reference to the LCD object for the specified
* LCD. NULL is returned on any failure.
* On success, this function returns a reference to the LCD object for the
* specified LCD. NULL is returned on any failure.
*
**************************************************************************************/
****************************************************************************/
struct lcd_dev_s; /* see nuttx/lcd.h */
struct spi_dev_s; /* see nuttx/spi/spi.h */
EXTERN FAR struct lcd_dev_s *nokia_lcdinitialize(FAR struct spi_dev_s *spi, unsigned int devno);
FAR struct lcd_dev_s *nokia_lcdinitialize(FAR struct spi_dev_s *spi,
unsigned int devno);
/**************************************************************************************
/****************************************************************************
* Name: nokia_backlight
*
* Description:
* The Nokia 6100 backlight is controlled by logic outside of the LCD assembly. This
* function must be provided by board specific logic to manage the backlight. This
* function will receive a power value (0: full off - CONFIG_LCD_MAXPOWER: full on)
* and should set the backlight accordingly.
* The Nokia 6100 backlight is controlled by logic outside of the LCD
* assembly. This function must be provided by board specific logic to
* manage the backlight. This function will receive a power value (0: full
* off - CONFIG_LCD_MAXPOWER: full on) and should set the backlight
* accordingly.
*
**************************************************************************************/
****************************************************************************/
EXTERN int nokia_backlight(unsigned int power);
int nokia_backlight(unsigned int power);
#undef EXTERN
#ifdef __cplusplus

View file

@ -2,7 +2,7 @@
* include/nuttx/lcd/p14201.h
* Application interface to the RiT P14201 OLED driver
*
* Copyright (C) 2010 Gregory Nutt. All rights reserved.
* Copyright (C) 2010, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -51,12 +51,12 @@
*
* CONFIG_P14201_SPIMODE - Controls the SPI mode
* CONFIG_P14201_FREQUENCY - Define to use a different bus frequency
* CONFIG_P14201_NINTERFACES - Specifies the number of physical P14201 devices that
* will be supported.
* CONFIG_P14201_FRAMEBUFFER - If defined, accesses will be performed using an in-memory
* copy of the OLEDs GDDRAM. This cost of this buffer is 128 * 96 / 2 = 6Kb. If this
* is defined, then the driver will be fully functional. If not, then it will have the
* following limitations:
* CONFIG_P14201_NINTERFACES - Specifies the number of physical P14201 devices
* that will be supported.
* CONFIG_P14201_FRAMEBUFFER - If defined, accesses will be performed using
* an in-memory copy of the OLEDs GDDRAM. This cost of this buffer is
* 128 * 96 / 2 = 6Kb. If this is defined, then the driver will be fully
* functional. If not, then it will have the following limitations:
*
* - Reading graphics memory cannot be supported, and
* - All pixel writes must be aligned to byte boundaries.
@ -65,7 +65,8 @@
*
* Required LCD driver settings:
* CONFIG_LCD_P14201 - Enable P14201 support
* CONFIG_LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be accepted.
* CONFIG_LCD_MAXCONTRAST should be 255, but any value >0 and <=255 will be
* accepted.
* CONFIG_LCD_MAXPOWER must be 1
*
* Required SPI driver settings:
@ -87,7 +88,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -96,30 +98,31 @@ extern "C" {
* Public Function Prototypes
****************************************************************************/
/**************************************************************************************
/****************************************************************************
* Name: rit_initialize
*
* Description:
* Initialize the P14201 video hardware. The initial state of the OLED is fully
* initialized, display memory cleared, and the OLED ready to use, but with the power
* setting at 0 (full off == sleep mode).
* Initialize the P14201 video hardware. The initial state of the OLED is
* fully initialized, display memory cleared, and the OLED ready to use,
* but with the powersetting at 0 (full off == sleep mode).
*
* Input Parameters:
*
* spi - A reference to the SPI driver instance.
* devno - A value in the range of 0 throuh CONFIG_P14201_NINTERFACES-1. This allows
* support for multiple OLED devices.
* devno - A value in the range of 0 throuh CONFIG_P14201_NINTERFACES-1.
* This allows support for multiple OLED devices.
*
* Returned Value:
*
* On success, this function returns a reference to the LCD object for the specified
* OLED. NULL is returned on any failure.
* On success, this function returns a reference to the LCD object for the
* specified OLED. NULL is returned on any failure.
*
**************************************************************************************/
****************************************************************************/
struct lcd_dev_s; /* see nuttx/lcd.h */
struct spi_dev_s; /* see nuttx/spi/spi.h */
EXTERN FAR struct lcd_dev_s *rit_initialize(FAR struct spi_dev_s *spi, unsigned int devno);
FAR struct lcd_dev_s *rit_initialize(FAR struct spi_dev_s *spi,
unsigned int devno);
#undef EXTERN
#ifdef __cplusplus

View file

@ -2,7 +2,7 @@
* include/nuttx/lcd/ssd1289.h
* Definitions for the Solomon Systech SSD1289 LCD controller
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* References: SSD1289, Rev 1.3, Apr 2007, Solomon Systech Limited
@ -106,7 +106,8 @@ struct ssd1289_lcd_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -125,7 +126,7 @@ extern "C" {
*
**************************************************************************************/
EXTERN FAR struct lcd_dev_s *ssd1289_lcdinitialize(FAR struct ssd1289_lcd_s *lcd);
FAR struct lcd_dev_s *ssd1289_lcdinitialize(FAR struct ssd1289_lcd_s *lcd);
/**************************************************************************************
* Name: ssd1289_clear
@ -138,7 +139,7 @@ EXTERN FAR struct lcd_dev_s *ssd1289_lcdinitialize(FAR struct ssd1289_lcd_s *lcd
*
**************************************************************************************/
EXTERN void ssd1289_clear(FAR struct lcd_dev_s *dev, uint16_t color);
void ssd1289_clear(FAR struct lcd_dev_s *dev, uint16_t color);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/nx/nxfonts.h
*
* Copyright (C) 2008, 2009, 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2008, 2009, 2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -50,8 +50,8 @@
/****************************************************************************
* Pre-processor definitions
****************************************************************************/
/* Select the default font. If no fonts are selected, then a compilation error
* is likely down the road.
/* Select the default font. If no fonts are selected, then a compilation
* error is likely down the road.
*/
/* Sans serif fonts */
@ -450,7 +450,8 @@ struct nx_fontpackage_s
#undef EXTERN
#if defined(__cplusplus)
# define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
# define EXTERN extern
#endif
@ -471,7 +472,7 @@ extern "C" {
*
****************************************************************************/
EXTERN NXHANDLE nxf_getfonthandle(enum nx_fontid_e fontid);
NXHANDLE nxf_getfonthandle(enum nx_fontid_e fontid);
/****************************************************************************
* Name: nxf_getfontset
@ -484,7 +485,7 @@ EXTERN NXHANDLE nxf_getfonthandle(enum nx_fontid_e fontid);
*
****************************************************************************/
EXTERN FAR const struct nx_font_s *nxf_getfontset(NXHANDLE handle);
FAR const struct nx_font_s *nxf_getfontset(NXHANDLE handle);
/****************************************************************************
* Name: nxf_getbitmap
@ -501,8 +502,7 @@ EXTERN FAR const struct nx_font_s *nxf_getfontset(NXHANDLE handle);
*
****************************************************************************/
EXTERN FAR const struct nx_fontbitmap_s *
nxf_getbitmap(NXHANDLE handle, uint16_t ch);
FAR const struct nx_fontbitmap_s *nxf_getbitmap(NXHANDLE handle, uint16_t ch);
/****************************************************************************
* Name: nxf_convert_*bpp
@ -525,34 +525,34 @@ EXTERN FAR const struct nx_fontbitmap_s *
*
****************************************************************************/
EXTERN int nxf_convert_1bpp(FAR uint8_t *dest, uint16_t height,
uint16_t width, uint16_t stride,
FAR const struct nx_fontbitmap_s *bm,
nxgl_mxpixel_t color);
EXTERN 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);
EXTERN 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);
EXTERN 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);
EXTERN 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);
EXTERN 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);
EXTERN 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);
int nxf_convert_1bpp(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_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 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 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_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_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_t *dest, uint16_t height,
uint16_t width, uint16_t stride,
FAR const struct nx_fontbitmap_s *bm,
nxgl_mxpixel_t color);
#undef EXTERN
#if defined(__cplusplus)

View file

@ -104,7 +104,8 @@ typedef FAR void *NXTKWINDOW;
#undef EXTERN
#if defined(__cplusplus)
# define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
# define EXTERN extern
#endif
@ -130,9 +131,8 @@ extern "C" {
*
****************************************************************************/
EXTERN NXTKWINDOW nxtk_openwindow(NXHANDLE handle,
FAR const struct nx_callback_s *cb,
FAR void *arg);
NXTKWINDOW nxtk_openwindow(NXHANDLE handle,
FAR const struct nx_callback_s *cb, FAR void *arg);
/****************************************************************************
* Name: nxtk_closewindow
@ -148,7 +148,7 @@ EXTERN NXTKWINDOW nxtk_openwindow(NXHANDLE handle,
*
****************************************************************************/
EXTERN int nxtk_closewindow(NXTKWINDOW hfwnd);
int nxtk_closewindow(NXTKWINDOW hfwnd);
/****************************************************************************
* Name: nxtk_block
@ -158,10 +158,10 @@ EXTERN int nxtk_closewindow(NXTKWINDOW hfwnd);
* to the window and then (2) block any further window messaging.
*
* The 'blocked' callback is the response from nx_block (or nxtk_block).
* Those blocking interfaces are used to assure that no further messages are
* are directed to the window. Receipt of the blocked callback signifies
* that (1) there are no further pending callbacks and (2) that the
* window is now 'defunct' and will receive no further callbacks.
* Those blocking interfaces are used to assure that no further messages
* are are directed to the window. Receipt of the blocked callback
* signifies that (1) there are no further pending callbacks and (2) that
* the window is now 'defunct' and will receive no further callbacks.
*
* This callback supports coordinated destruction of a window in multi-
* user mode. In multi-use mode, the client window logic must stay
@ -182,7 +182,7 @@ EXTERN int nxtk_closewindow(NXTKWINDOW hfwnd);
****************************************************************************/
#ifdef CONFIG_NX_MULTIUSER
EXTERN int nxtk_block(NXTKWINDOW hfwnd, FAR void *arg);
int nxtk_block(NXTKWINDOW hfwnd, FAR void *arg);
#endif
/****************************************************************************
@ -201,7 +201,7 @@ EXTERN int nxtk_block(NXTKWINDOW hfwnd, FAR void *arg);
*
****************************************************************************/
EXTERN int nxtk_getposition(NXTKWINDOW hfwnd);
int nxtk_getposition(NXTKWINDOW hfwnd);
/****************************************************************************
* Name: nxtk_setposition
@ -220,7 +220,7 @@ EXTERN int nxtk_getposition(NXTKWINDOW hfwnd);
*
****************************************************************************/
EXTERN int nxtk_setposition(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *pos);
int nxtk_setposition(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *pos);
/****************************************************************************
* Name: nxtk_setsize
@ -239,7 +239,7 @@ EXTERN int nxtk_setposition(NXTKWINDOW hfwnd, FAR const struct nxgl_point_s *pos
*
****************************************************************************/
EXTERN int nxtk_setsize(NXTKWINDOW hfwnd, FAR const struct nxgl_size_s *size);
int nxtk_setsize(NXTKWINDOW hfwnd, FAR const struct nxgl_size_s *size);
/****************************************************************************
* Name: nxtk_raise
@ -257,7 +257,7 @@ EXTERN int nxtk_setsize(NXTKWINDOW hfwnd, FAR const struct nxgl_size_s *size);
*
****************************************************************************/
EXTERN int nxtk_raise(NXTKWINDOW hfwnd);
int nxtk_raise(NXTKWINDOW hfwnd);
/****************************************************************************
* Name: nxtk_lower
@ -275,7 +275,7 @@ EXTERN int nxtk_raise(NXTKWINDOW hfwnd);
*
****************************************************************************/
EXTERN int nxtk_lower(NXTKWINDOW hfwnd);
int nxtk_lower(NXTKWINDOW hfwnd);
/****************************************************************************
* Name: nxtk_fillwindow
@ -293,8 +293,8 @@ EXTERN int nxtk_lower(NXTKWINDOW hfwnd);
*
****************************************************************************/
EXTERN int nxtk_fillwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
int nxtk_fillwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxtk_getwindow
@ -317,9 +317,9 @@ EXTERN int nxtk_fillwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
*
****************************************************************************/
EXTERN int nxtk_getwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
unsigned int plane, FAR uint8_t *dest,
unsigned int deststride);
int nxtk_getwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
unsigned int plane, FAR uint8_t *dest,
unsigned int deststride);
/****************************************************************************
* Name: nxtk_filltrapwindow
@ -337,9 +337,9 @@ EXTERN int nxtk_getwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
*
****************************************************************************/
EXTERN int nxtk_filltrapwindow(NXTKWINDOW hfwnd,
FAR const struct nxgl_trapezoid_s *trap,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
int nxtk_filltrapwindow(NXTKWINDOW hfwnd,
FAR const struct nxgl_trapezoid_s *trap,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxtk_drawlinewindow
@ -362,11 +362,9 @@ EXTERN int nxtk_filltrapwindow(NXTKWINDOW hfwnd,
*
****************************************************************************/
EXTERN int nxtk_drawlinewindow(NXTKWINDOW hfwnd,
FAR struct nxgl_vector_s *vector,
nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES],
uint8_t caps);
int nxtk_drawlinewindow(NXTKWINDOW hfwnd, FAR struct nxgl_vector_s *vector,
nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES], uint8_t caps);
/****************************************************************************
* Name: nxtk_drawcirclewindow
@ -386,10 +384,10 @@ EXTERN int nxtk_drawlinewindow(NXTKWINDOW hfwnd,
*
****************************************************************************/
EXTERN int nxtk_drawcirclewindow(NXTKWINDOW hfwnd,
FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
int nxtk_drawcirclewindow(NXTKWINDOW hfwnd,
FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxtk_fillcirclewindow
@ -408,10 +406,10 @@ EXTERN int nxtk_drawcirclewindow(NXTKWINDOW hfwnd,
*
****************************************************************************/
EXTERN int nxtk_fillcirclewindow(NXWINDOW hfwnd,
FAR const struct nxgl_point_s *center,
nxgl_coord_t radius,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
int nxtk_fillcirclewindow(NXWINDOW hfwnd,
FAR const struct nxgl_point_s *center,
nxgl_coord_t radius,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxtk_movewindow
@ -432,8 +430,8 @@ EXTERN int nxtk_fillcirclewindow(NXWINDOW hfwnd,
*
****************************************************************************/
EXTERN int nxtk_movewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
int nxtk_movewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
/****************************************************************************
* Name: nxtk_bitmapwindow
@ -458,11 +456,10 @@ EXTERN int nxtk_movewindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
*
****************************************************************************/
EXTERN int nxtk_bitmapwindow(NXTKWINDOW hfwnd,
FAR const struct nxgl_rect_s *dest,
FAR const void **src,
FAR const struct nxgl_point_s *origin,
unsigned int stride);
int nxtk_bitmapwindow(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest,
FAR const void **src,
FAR const struct nxgl_point_s *origin,
unsigned int stride);
/****************************************************************************
* Name: nxtk_opentoolbar
@ -481,9 +478,8 @@ EXTERN int nxtk_bitmapwindow(NXTKWINDOW hfwnd,
*
****************************************************************************/
EXTERN int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height,
FAR const struct nx_callback_s *cb,
FAR void *arg);
int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height,
FAR const struct nx_callback_s *cb, FAR void *arg);
/****************************************************************************
* Name: nxtk_closetoolbar
@ -499,14 +495,14 @@ EXTERN int nxtk_opentoolbar(NXTKWINDOW hfwnd, nxgl_coord_t height,
*
****************************************************************************/
EXTERN int nxtk_closetoolbar(NXTKWINDOW hfwnd);
int nxtk_closetoolbar(NXTKWINDOW hfwnd);
/****************************************************************************
* Name: nxtk_toolbarbounds
*
* Description:
* Return a bounding box that contains the toolbar in the coordinates of
* the containing, framed window. For example, the recturned origin
* the containing, framed window. For example, the returned origin
* (rect.pt1) is the offset toolbar in the framed window.
*
* NOTE: This function is unsafe in the case of the multi-user NX server
@ -522,7 +518,7 @@ EXTERN int nxtk_closetoolbar(NXTKWINDOW hfwnd);
*
****************************************************************************/
EXTERN int nxtk_toolbarbounds(NXTKWINDOW hfwnd, FAR struct nxgl_rect_s *bounds);
int nxtk_toolbarbounds(NXTKWINDOW hfwnd, FAR struct nxgl_rect_s *bounds);
/****************************************************************************
* Name: nxtk_filltoolbar
@ -540,8 +536,8 @@ EXTERN int nxtk_toolbarbounds(NXTKWINDOW hfwnd, FAR struct nxgl_rect_s *bounds);
*
****************************************************************************/
EXTERN int nxtk_filltoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
int nxtk_filltoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxtk_gettoolbar
@ -564,9 +560,9 @@ EXTERN int nxtk_filltoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect
*
****************************************************************************/
EXTERN int nxtk_gettoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
unsigned int plane, FAR uint8_t *dest,
unsigned int deststride);
int nxtk_gettoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
unsigned int plane, FAR uint8_t *dest,
unsigned int deststride);
/****************************************************************************
* Name: nxtk_filltraptoolbar
@ -584,8 +580,9 @@ EXTERN int nxtk_gettoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
*
****************************************************************************/
EXTERN int nxtk_filltraptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoid_s *trap,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
int nxtk_filltraptoolbar(NXTKWINDOW hfwnd,
FAR const struct nxgl_trapezoid_s *trap,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxtk_drawlinetoolbar
@ -609,11 +606,9 @@ EXTERN int nxtk_filltraptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_trapezoi
*
****************************************************************************/
EXTERN int nxtk_drawlinetoolbar(NXTKWINDOW hfwnd,
FAR struct nxgl_vector_s *vector,
nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES],
uint8_t caps);
int nxtk_drawlinetoolbar(NXTKWINDOW hfwnd, FAR struct nxgl_vector_s *vector,
nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES], uint8_t caps);
/****************************************************************************
* Name: nxtk_drawcircletoolbar
@ -633,10 +628,10 @@ EXTERN int nxtk_drawlinetoolbar(NXTKWINDOW hfwnd,
*
****************************************************************************/
EXTERN int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd,
FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd,
FAR const struct nxgl_point_s *center,
nxgl_coord_t radius, nxgl_coord_t width,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxtk_fillcircletoolbar
@ -655,10 +650,10 @@ EXTERN int nxtk_drawcircletoolbar(NXTKWINDOW hfwnd,
*
****************************************************************************/
EXTERN int nxtk_fillcircletoolbar(NXWINDOW hfwnd,
FAR const struct nxgl_point_s *center,
nxgl_coord_t radius,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
int nxtk_fillcircletoolbar(NXWINDOW hfwnd,
FAR const struct nxgl_point_s *center,
nxgl_coord_t radius,
nxgl_mxpixel_t color[CONFIG_NX_NPLANES]);
/****************************************************************************
* Name: nxtk_movetoolbar
@ -680,8 +675,8 @@ EXTERN int nxtk_fillcircletoolbar(NXWINDOW hfwnd,
*
****************************************************************************/
EXTERN int nxtk_movetoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
int nxtk_movetoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect,
FAR const struct nxgl_point_s *offset);
/****************************************************************************
* Name: nxtk_bitmaptoolbar
@ -691,7 +686,7 @@ EXTERN int nxtk_movetoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect
* specified toolbar sub-window.
*
* Input Parameters:
* hfwnd - The sub-window twhose toolbar will receive the bitmap image
* hfwnd - The sub-window whose toolbar will receive the bitmap image
* dest - Describes the rectangular region on in the toolbar sub-window
* will receive the bit map.
* src - The start of the source image.
@ -705,11 +700,10 @@ EXTERN int nxtk_movetoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *rect
*
****************************************************************************/
EXTERN int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd,
FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
unsigned int stride);
int nxtk_bitmaptoolbar(NXTKWINDOW hfwnd, FAR const struct nxgl_rect_s *dest,
FAR const void *src[CONFIG_NX_NPLANES],
FAR const struct nxgl_point_s *origin,
unsigned int stride);
#undef EXTERN
#if defined(__cplusplus)

View file

@ -2,7 +2,7 @@
* include/nuttx/power/battery.h
* NuttX Battery Interfaces
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -60,7 +60,7 @@
* such as:
*
* CONFIG_I2C - I2C support *may* be needed
* CONFIG_I2C_MAX1704X - The MAX1704x driver must be explictly selected.
* CONFIG_I2C_MAX1704X - The MAX1704x driver must be explicitly selected.
*/
/* IOCTL Commands ***********************************************************/
@ -77,7 +77,7 @@
* BATIOC_ONLINE - Return 1 if the battery is online; 0 if offline.
* Input value: A pointer to type bool.
* BATIOC_VOLTAGE - Return the current battery voltage. The returned value
* is a fixed preceision number in units of volts.
* is a fixed precision number in units of volts.
* Input value: A pointer to type b16_t.
* BATIOC_CAPACITY - Return the current battery capacity or State of Charge
* (SoC). The returned value is a fixed precision percentage of the
@ -146,7 +146,8 @@ struct battery_dev_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -171,8 +172,7 @@ extern "C" {
*
****************************************************************************/
EXTERN int battery_register(FAR const char *devpath,
FAR struct battery_dev_s *dev);
int battery_register(FAR const char *devpath, FAR struct battery_dev_s *dev);
/****************************************************************************
* Name: max1704x_initialize
@ -203,8 +203,8 @@ EXTERN int battery_register(FAR const char *devpath,
#if defined(CONFIG_I2C) && defined(CONFIG_I2C_MAX1704X)
struct i2c_dev_s; /* Forward reference */
EXTERN FAR struct battery_dev_s *
max1704x_initialize(FAR struct i2c_dev_s *i2c, uint8_t addr, uint32_t frequency);
FAR struct battery_dev_s *max1704x_initialize(FAR struct i2c_dev_s *i2c
uint8_t addr, uint32_t frequency);
#endif
#undef EXTERN

View file

@ -2,7 +2,7 @@
* include/nuttx/power/pm.h
* NuttX Power Management Interfaces
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -41,8 +41,8 @@
* IDLE - This is still basically normal operational mode, the system is,
* however, IDLE and some simple simple steps to reduce power
* consumption provided that they do not interfere with normal
* Operation. Simply dimming the a backlight might be an example
* somethat that would be done when the system is idle.
* Operation. Simply dimming a backlight might be an example
* something that would be done when the system is idle.
* STANDBY - Standby is a lower power consumption mode that may involve more
* extensive power management steps such has disabling clocking or
* setting the processor into reduced power consumption modes. In
@ -272,7 +272,7 @@ struct pm_callback_s
*
* Input Parameters:
* cb - Returned to the driver. The driver version of the callback
* strucure may include additional, driver-specific state
* structure may include additional, driver-specific state
* data at the end of the structure.
* pmstate - Identifies the new PM state
*
@ -300,7 +300,7 @@ struct pm_callback_s
*
* Input Parameters:
* cb - Returned to the driver. The driver version of the callback
* strucure may include additional, driver-specific state
* structure may include additional, driver-specific state
* data at the end of the structure.
* pmstate - Identifies the new PM state
*
@ -323,7 +323,8 @@ struct pm_callback_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -336,8 +337,8 @@ extern "C" {
*
* Description:
* This function is called by MCU-specific logic at power-on reset in
* order to provide one-time initialization the power management subystem.
* This function must be called *very* early in the initializeation sequence
* order to provide one-time initialization the power management subsystem.
* This function must be called *very* early in the initialization sequence
* *before* any other device drivers are initialized (since they may
* attempt to register with the power management subsystem).
*
@ -349,7 +350,7 @@ extern "C" {
*
****************************************************************************/
EXTERN void pm_initialize(void);
void pm_initialize(void);
/****************************************************************************
* Name: pm_register
@ -367,14 +368,14 @@ EXTERN void pm_initialize(void);
*
****************************************************************************/
EXTERN int pm_register(FAR struct pm_callback_s *callbacks);
int pm_register(FAR struct pm_callback_s *callbacks);
/****************************************************************************
* Name: pm_activity
*
* Description:
* This function is called by a device driver to indicate that it is
* performing meaningful activities (non-idle). This increment an activty
* performing meaningful activities (non-idle). This increment an activity
* count and/or will restart a idle timer and prevent entering reduced
* power states.
*
@ -395,7 +396,7 @@ EXTERN int pm_register(FAR struct pm_callback_s *callbacks);
*
****************************************************************************/
EXTERN void pm_activity(int priority);
void pm_activity(int priority);
/****************************************************************************
* Name: pm_checkstate
@ -408,7 +409,7 @@ EXTERN void pm_activity(int priority);
* not automatically changed, however. The IDLE loop must call
* pm_changestate() in order to make the state change.
*
* These two steps are separated because the plaform-specific IDLE loop may
* These two steps are separated because the platform-specific IDLE loop may
* have additional situational information that is not available to the
* the PM sub-system. For example, the IDLE loop may know that the
* battery charge level is very low and may force lower power states
@ -428,13 +429,13 @@ EXTERN void pm_activity(int priority);
*
****************************************************************************/
EXTERN enum pm_state_e pm_checkstate(void);
enum pm_state_e pm_checkstate(void);
/****************************************************************************
* Name: pm_changestate
*
* Description:
* This function is used to platform-specific power managmeent logic. It
* This function is used to platform-specific power management logic. It
* will announce the power management power management state change to all
* drivers that have registered for power management event callbacks.
*
@ -457,7 +458,7 @@ EXTERN enum pm_state_e pm_checkstate(void);
*
****************************************************************************/
EXTERN int pm_changestate(enum pm_state_e newstate);
int pm_changestate(enum pm_state_e newstate);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/********************************************************************************************
* include/nuttx/input/adxl345.h
*
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2014-2015 Gregory Nutt. All rights reserved.
* Author: Alan Carvalho de Assis <acassis@gmail.com>
*
* Redistribution and use in source and binary forms, with or without
@ -62,7 +62,7 @@
* CONFIG_SENSORS_ADXL345
* Enables support for the ADXL345 driver
* CONFIG_ADXL345_SPI
* Enables support for the SPI interface (not currenly supported)
* Enables support for the SPI interface (not currently supported)
* CONFIG_ADXL345_I2C
* Enables support for the I2C interface
* CONFIG_ADXL345_ACTIVELOW
@ -136,9 +136,9 @@
#define ADXL345_DEVID 0x00 /* Device identification (8-bit) */
/* 0x01 to 0x1C Reserved*/
#define ADXL345_THRESH_TAP 0x1D /* Tap threshold */
#define ADXL345_OFSX 0x1E /* X-axis offset */
#define ADXL345_OFSY 0x1F /* Y-axis offset */
#define ADXL345_THRESH_TAP 0x1d /* Tap threshold */
#define ADXL345_OFSX 0x1e /* X-axis offset */
#define ADXL345_OFSY 0x1f /* Y-axis offset */
#define ADXL345_OFSZ 0x20 /* Z-axis offset */
#define ADXL345_DUR 0x21 /* Tap duration */
#define ADXL345_LATENT 0x22 /* Tap latency */
@ -149,12 +149,12 @@
#define ADXL345_ATC_INACT_CTL 0x27 /* Axis enable control for activity and inactivity detection */
#define ADXL345_THRESH_FF 0x28 /* Free-fall threshold */
#define ADXL345_TIME_FF 0x29 /* Free-fall fime */
#define ADXL345_TAP_AXES 0x2A /* Axis control for tap/double tap */
#define ADXL345_ACT_TAP_STATUS 0x2B /* Source of tap/double tap */
#define ADXL345_BW_RATE 0x2C /* Data rate and power mode control */
#define ADXL345_POWER_CTL 0x2D /* Power-saving features control */
#define ADXL345_INT_ENABLE 0x2E /* Interrupt enable control */
#define ADXL345_INT_MAP 0x2F /* Interrupt mapping control */
#define ADXL345_TAP_AXES 0x2a /* Axis control for tap/double tap */
#define ADXL345_ACT_TAP_STATUS 0x2b /* Source of tap/double tap */
#define ADXL345_BW_RATE 0x2c /* Data rate and power mode control */
#define ADXL345_POWER_CTL 0x2d /* Power-saving features control */
#define ADXL345_INT_ENABLE 0x2e /* Interrupt enable control */
#define ADXL345_INT_MAP 0x2f /* Interrupt mapping control */
#define ADXL345_INT_SOURCE 0x30 /* Source of interrupts */
#define ADXL345_DATA_FORMAT 0x31 /* Data format control */
#define ADXL345_DATAX0 0x32 /* X-axis Data 0 */
@ -170,119 +170,119 @@
/* Device identification (8-bit) */
#define DEVID 0xE5
#define DEVID 0xE5
/* Register 0x27 - ACT_INACT_CTL */
#define INACT_Z_ENABLE (1 << 0) /* Bit 0: Include/Exclude Z-axis in detecting inactivity */
#define INACT_Y_ENABLE (1 << 1) /* Bit 1: Include/Exclude Y-axis in detecting inactivity */
#define INACT_X_ENABLE (1 << 2) /* Bit 2: Include/Exclude X-axis in detecting inactivity */
#define INACT_AC_DC (1 << 3) /* Bit 3: 0 = DC-coupled operation / 1 = AC-coupled operation */
#define ACT_Z_ENABLE (1 << 4) /* Bit 4: Include/Exclude Z-axis in detecting activity */
#define ACT_Y_ENABLE (1 << 5) /* Bit 5: Include/Exclude Z-axis in detecting activity */
#define ACT_X_ENABLE (1 << 6) /* Bit 6: Include/Exclude Z-axis in detecting activity */
#define ACT_AC_DC (1 << 7) /* Bit 7: 0 = DC-coupled operation / 1 = AC-coupled operation */
#define INACT_Z_ENABLE (1 << 0) /* Bit 0: Include/Exclude Z-axis in detecting inactivity */
#define INACT_Y_ENABLE (1 << 1) /* Bit 1: Include/Exclude Y-axis in detecting inactivity */
#define INACT_X_ENABLE (1 << 2) /* Bit 2: Include/Exclude X-axis in detecting inactivity */
#define INACT_AC_DC (1 << 3) /* Bit 3: 0 = DC-coupled operation / 1 = AC-coupled operation */
#define ACT_Z_ENABLE (1 << 4) /* Bit 4: Include/Exclude Z-axis in detecting activity */
#define ACT_Y_ENABLE (1 << 5) /* Bit 5: Include/Exclude Z-axis in detecting activity */
#define ACT_X_ENABLE (1 << 6) /* Bit 6: Include/Exclude Z-axis in detecting activity */
#define ACT_AC_DC (1 << 7) /* Bit 7: 0 = DC-coupled operation / 1 = AC-coupled operation */
/* Register 0x2A - TAP AXES */
/* Register 0x2a - TAP AXES */
#define TAP_Z_ENABLE (1 << 0) /* Bit 0: Enable/disable Z-axis in tap detection */
#define TAP_Y_ENABLE (1 << 1) /* Bit 1: Enable/disable Y-axis in tap detection */
#define TAP_X_ENABLE (1 << 2) /* Bit 2: Enable/disable X-axis in tap detection */
#define TAP_SUPRESS (1 << 3) /* Bit 3: Supress double tap detection */
#define TAP_Z_ENABLE (1 << 0) /* Bit 0: Enable/disable Z-axis in tap detection */
#define TAP_Y_ENABLE (1 << 1) /* Bit 1: Enable/disable Y-axis in tap detection */
#define TAP_X_ENABLE (1 << 2) /* Bit 2: Enable/disable X-axis in tap detection */
#define TAP_SUPRESS (1 << 3) /* Bit 3: Supress double tap detection */
/* Register 0x2B - ACT_TAP_STATUS */
/* Register 0x2b - ACT_TAP_STATUS */
#define TAP_Z_SOURCE (1 << 0) /* Bit 0: Indicates Z-axis is involved in a tap event */
#define TAP_Y_SOURCE (1 << 1) /* Bit 1: Indicates Y-axis is involved in a tap event */
#define TAP_X_SOURCE (1 << 2) /* Bit 2: Indicates X-axis is involved in a tap event */
#define ASLEEP_STATUS (1 << 3) /* Bit 3: Indicates if device is asleep */
#define ACT_Z_SOURCE (1 << 4) /* Bit 4: Indicates Z-axis is involved in an activity event */
#define ACT_Y_SOURCE (1 << 5) /* Bit 5: Indicates Y-axis is involved in an activity event */
#define ACT_X_SOURCE (1 << 6) /* Bit 6: Indicates X-axis is involved in an activity event */
#define TAP_Z_SOURCE (1 << 0) /* Bit 0: Indicates Z-axis is involved in a tap event */
#define TAP_Y_SOURCE (1 << 1) /* Bit 1: Indicates Y-axis is involved in a tap event */
#define TAP_X_SOURCE (1 << 2) /* Bit 2: Indicates X-axis is involved in a tap event */
#define ASLEEP_STATUS (1 << 3) /* Bit 3: Indicates if device is asleep */
#define ACT_Z_SOURCE (1 << 4) /* Bit 4: Indicates Z-axis is involved in an activity event */
#define ACT_Y_SOURCE (1 << 5) /* Bit 5: Indicates Y-axis is involved in an activity event */
#define ACT_X_SOURCE (1 << 6) /* Bit 6: Indicates X-axis is involved in an activity event */
/* Register 0x2C - BW_RATE */
#define BWR_RATE_SHIFT 0 /* Bit 0-3: Rate bits: up to 3200Hz output data rate */
#define BWR_RATE_MASK (15 << RATE_SHIFT) /* Bit 0: Master interrupt enable */
#define BWR_LOW_POWER (1 << 4) /* Bit 4: Set low power operation */
#define BWR_RATE_SHIFT 0 /* Bit 0-3: Rate bits: up to 3200Hz output data rate */
#define BWR_RATE_MASK (15 << RATE_SHIFT) /* Bit 0: Master interrupt enable */
#define BWR_LOW_POWER (1 << 4) /* Bit 4: Set low power operation */
/* Register 0x2D - POWER_CTL */
/* Register 0x2d - POWER_CTL */
#define POWER_CTL_WAKEUP_SHIFT 0 /* Bit 0-1: Controls frequency of reading in sleep mode*/
#define POWER_CTL_WAKEUP_MASK (3 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_WAKEUP_8HZ (0 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_WAKEUP_4HZ (1 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_WAKEUP_2HZ (2 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_WAKEUP_1HZ (3 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_SLEEP (1 << 2) /* Bit 2: Sleep mode, only activity function can be used */
#define POWER_CTL_MEASURE (1 << 3) /* Bit 3: Writing 0 put part in standy mode, 1 measurement mode */
#define POWER_CTL_AUTO_SLEEP (1 << 4) /* Bit 4: If set and link bit is set then device sleep if no activity */
#define POWER_CTL_LINK (1 << 5) /* Bit 5: Wait an inactivity before detecting an activity */
#define POWER_CTL_WAKEUP_SHIFT 0 /* Bit 0-1: Controls frequency of reading in sleep mode*/
#define POWER_CTL_WAKEUP_MASK (3 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_WAKEUP_8HZ (0 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_WAKEUP_4HZ (1 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_WAKEUP_2HZ (2 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_WAKEUP_1HZ (3 << POWER_CTL_WAKEUP_SHIFT)
#define POWER_CTL_SLEEP (1 << 2) /* Bit 2: Sleep mode, only activity function can be used */
#define POWER_CTL_MEASURE (1 << 3) /* Bit 3: Writing 0 put part in standy mode, 1 measurement mode */
#define POWER_CTL_AUTO_SLEEP (1 << 4) /* Bit 4: If set and link bit is set then device sleep if no activity */
#define POWER_CTL_LINK (1 << 5) /* Bit 5: Wait an inactivity before detecting an activity */
/* Register 0x2E - INT_ENABLE */
/* Register 0x2e - INT_ENABLE */
#define INT_OVERRUN (1 << 0) /* Bit 0: Enable Overrun detection */
#define INT_WATERMARK (1 << 1) /* Bit 1: Enable Watermark detection */
#define INT_FREE_FALL (1 << 2) /* Bit 2: Enable Free-fall detection */
#define INT_INACTIVITY (1 << 3) /* Bit 3: Enable Inactivity detection*/
#define INT_ACTIVITY (1 << 4) /* Bit 4: Enable Activity detection */
#define INT_DOUBLE_TAP (1 << 5) /* Bit 5: Enable Double tap detection */
#define INT_SINGLE_TAP (1 << 6) /* Bit 6: Enable Single tap detection */
#define INT_DATA_READY (1 << 7) /* Bit 7: Enable Data Ready detection */
#define INT_OVERRUN (1 << 0) /* Bit 0: Enable Overrun detection */
#define INT_WATERMARK (1 << 1) /* Bit 1: Enable Watermark detection */
#define INT_FREE_FALL (1 << 2) /* Bit 2: Enable Free-fall detection */
#define INT_INACTIVITY (1 << 3) /* Bit 3: Enable Inactivity detection*/
#define INT_ACTIVITY (1 << 4) /* Bit 4: Enable Activity detection */
#define INT_DOUBLE_TAP (1 << 5) /* Bit 5: Enable Double tap detection */
#define INT_SINGLE_TAP (1 << 6) /* Bit 6: Enable Single tap detection */
#define INT_DATA_READY (1 << 7) /* Bit 7: Enable Data Ready detection */
/* Register 0x2F - INT_MAP */
/* Register 0x2f - INT_MAP */
#define INT_MAP_OVERRUN (1 << 0) /* Bit 0: Map Overrun interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_WATERMARK (1 << 1) /* Bit 1: Map Watermark interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_FREE_FALL (1 << 2) /* Bit 2: Map Free-fall interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_INACTIVITY (1 << 3) /* Bit 3: Map Inactivity interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_ACTIVITY (1 << 4) /* Bit 4: Map Activity interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_DOUBLE_TAP (1 << 5) /* Bit 5: Map Double tap interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_SINGLE_TAP (1 << 6) /* Bit 6: Map Single tap interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_DATA_READY (1 << 7) /* Bit 7: Map Data Ready interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_OVERRUN (1 << 0) /* Bit 0: Map Overrun interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_WATERMARK (1 << 1) /* Bit 1: Map Watermark interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_FREE_FALL (1 << 2) /* Bit 2: Map Free-fall interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_INACTIVITY (1 << 3) /* Bit 3: Map Inactivity interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_ACTIVITY (1 << 4) /* Bit 4: Map Activity interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_DOUBLE_TAP (1 << 5) /* Bit 5: Map Double tap interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_SINGLE_TAP (1 << 6) /* Bit 6: Map Single tap interrupt 0 = INT1 / 1 = INT2 */
#define INT_MAP_DATA_READY (1 << 7) /* Bit 7: Map Data Ready interrupt 0 = INT1 / 1 = INT2 */
/* Register 0x30 - INT_SOURCE */
#define INT_SRC_OVERRUN (1 << 0) /* Bit 0: Overrun happened, even if INT_ENABLE is disabled */
#define INT_SRC_WATERMARK (1 << 1) /* Bit 1: Watermark happened, even if INT_ENABLE is disabled*/
#define INT_SRC_FREE_FALL (1 << 2) /* Bit 2: Free-fall detected */
#define INT_SRC_INACTIVITY (1 << 3) /* Bit 3: Inactivity detected */
#define INT_SRC_ACTIVITY (1 << 4) /* Bit 4: Activity detected */
#define INT_SRC_DOUBLE_TAP (1 << 5) /* Bit 5: Double tap detected */
#define INT_SRC_SINGLE_TAP (1 << 6) /* Bit 6: Single tap detected */
#define INT_SRC_DATA_READY (1 << 7) /* Bit 7: Data Ready happened, even if INT_ENABLE is disabled */
#define INT_SRC_OVERRUN (1 << 0) /* Bit 0: Overrun happened, even if INT_ENABLE is disabled */
#define INT_SRC_WATERMARK (1 << 1) /* Bit 1: Watermark happened, even if INT_ENABLE is disabled*/
#define INT_SRC_FREE_FALL (1 << 2) /* Bit 2: Free-fall detected */
#define INT_SRC_INACTIVITY (1 << 3) /* Bit 3: Inactivity detected */
#define INT_SRC_ACTIVITY (1 << 4) /* Bit 4: Activity detected */
#define INT_SRC_DOUBLE_TAP (1 << 5) /* Bit 5: Double tap detected */
#define INT_SRC_SINGLE_TAP (1 << 6) /* Bit 6: Single tap detected */
#define INT_SRC_DATA_READY (1 << 7) /* Bit 7: Data Ready happened, even if INT_ENABLE is disabled */
/* Register 0x31 - DATA_FORMAT */
#define DATA_FMT_RANGE_SHIFT 0 /* Bits 0-1: G-force Range */
#define DATA_FMT_RANGE_MASK (3 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_RANGE_2G (0 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_RANGE_4G (1 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_RANGE_8G (2 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_RANGE_16G (3 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_JUSTIFY (1 << 2) /* Bit 2: Value 1 selects left justified mode, 0 selects right just. */
#define DATA_FMT_FULL_RES (1 << 3) /* Bit 3: Value 0 sets 10-bit mode, value 1 sets 13-bit mode */
#define DATA_FMT_INT_INVERT (1 << 5) /* Bit 5: Value 0 interrupt active high, 1 sets interrupt active low */
#define DATA_FMT_SPI (1 << 6) /* Bit 6: Value 1 set 3-Wire SPI mode, 0 set 4-wire SPI mode */
#define DATA_FMT_SELF_TEST (1 << 7) /* Bit 7: Apply a SELF_TEST force to the sensor */
#define DATA_FMT_RANGE_SHIFT 0 /* Bits 0-1: G-force Range */
#define DATA_FMT_RANGE_MASK (3 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_RANGE_2G (0 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_RANGE_4G (1 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_RANGE_8G (2 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_RANGE_16G (3 << DATA_FMT_RANGE_SHIFT)
#define DATA_FMT_JUSTIFY (1 << 2) /* Bit 2: Value 1 selects left justified mode, 0 selects right just. */
#define DATA_FMT_FULL_RES (1 << 3) /* Bit 3: Value 0 sets 10-bit mode, value 1 sets 13-bit mode */
#define DATA_FMT_INT_INVERT (1 << 5) /* Bit 5: Value 0 interrupt active high, 1 sets interrupt active low */
#define DATA_FMT_SPI (1 << 6) /* Bit 6: Value 1 set 3-Wire SPI mode, 0 set 4-wire SPI mode */
#define DATA_FMT_SELF_TEST (1 << 7) /* Bit 7: Apply a SELF_TEST force to the sensor */
/* Register 0x38 - FIFO_CTL */
#define FIFO_CTL_SAMPLES_SHIFT 0 /* Bit 0-4: Numbers of samples needed to trigger a watermask event */
#define FIFO_CTL_SAMPLES_MASK (31 << FIFO_CTL_SAMPLES_SHIFT)
#define FIFO_CTL_TRIGGER (1 << 5) /* Bit 5: Value 0 links trigger event to INT1, value 1 to INT2 */
#define FIFO_CTL_MODE_SHIFT 6 /* Bit 6-7: FIFO Mode */
#define FIFO_CTL_MODE_MASK (3 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_MODE_BYPASS (0 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_MODE_FIFO (1 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_MODE_STREAM (2 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_MODE_TRIGGER (3 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_SAMPLES_SHIFT 0 /* Bit 0-4: Numbers of samples needed to trigger a watermask event */
#define FIFO_CTL_SAMPLES_MASK (31 << FIFO_CTL_SAMPLES_SHIFT)
#define FIFO_CTL_TRIGGER (1 << 5) /* Bit 5: Value 0 links trigger event to INT1, value 1 to INT2 */
#define FIFO_CTL_MODE_SHIFT 6 /* Bit 6-7: FIFO Mode */
#define FIFO_CTL_MODE_MASK (3 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_MODE_BYPASS (0 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_MODE_FIFO (1 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_MODE_STREAM (2 << FIFO_CTL_MODE_SHIFT)
#define FIFO_CTL_MODE_TRIGGER (3 << FIFO_CTL_MODE_SHIFT)
/* Register 0x39 - FIFO_STATUS */
#define FIFO_STATUS_ENTRIES_SHIFT 0 /* Bit 0-5: Reports how many samples are stored in the FIFO */
#define FIFO_STATUS_ENTRIES_MASK (63 << FIFO_STATUS_ENTRIES_SHIFT)
#define FIFO_STATUS_TRIG (1 << 7) /* Bit 7: A 1 reports a trigger event occurred, 0 means no event */
#define FIFO_STATUS_ENTRIES_SHIFT 0 /* Bit 0-5: Reports how many samples are stored in the FIFO */
#define FIFO_STATUS_ENTRIES_MASK (63 << FIFO_STATUS_ENTRIES_SHIFT)
#define FIFO_STATUS_TRIG (1 << 7) /* Bit 7: A 1 reports a trigger event occurred, 0 means no event */
/********************************************************************************************
* Public Types
@ -299,7 +299,7 @@ typedef void (*adxl345_handler_t)(FAR struct adxl345_config_s *config, FAR void
* ADXL345 and provides some board-specific hooks.
*
* Memory for this structure is provided by the caller. It is not copied by the driver
* and is presumed to persist while the driver is active. The memory must be writable
* and is presumed to persist while the driver is active. The memory must be writeable
* because, under certain circumstances, the driver may modify the frequency.
*/
@ -335,7 +335,8 @@ typedef FAR void *ADXL345_HANDLE;
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -349,7 +350,7 @@ extern "C" {
*
* Input Parameters:
* dev - An I2C or SPI driver instance
* config - Persistant board configuration data
* config - Persistent board configuration data
*
* Returned Value:
* A non-zero handle is returned on success. This handle may then be used to configure
@ -358,11 +359,11 @@ extern "C" {
********************************************************************************************/
#ifdef CONFIG_ADXL345_SPI
EXTERN ADXL345_HANDLE adxl345_instantiate(FAR struct spi_dev_s *dev,
FAR struct adxl345_config_s *config);
ADXL345_HANDLE adxl345_instantiate(FAR struct spi_dev_s *dev,
FAR struct adxl345_config_s *config);
#else
EXTERN ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_dev_s *dev,
FAR struct adxl345_config_s *config);
ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_dev_s *dev,
FAR struct adxl345_config_s *config);
#endif
/********************************************************************************************
@ -382,7 +383,7 @@ EXTERN ADXL345_HANDLE adxl345_instantiate(FAR struct i2c_dev_s *dev,
*
********************************************************************************************/
EXTERN int adxl345_register(ADXL345_HANDLE handle, int minor);
int adxl345_register(ADXL345_HANDLE handle, int minor);
#undef EXTERN
#ifdef __cplusplus

View file

@ -2,6 +2,7 @@
* include/nuttx/sensors/lis331dl.h
*
* Copyright (C) 2011 Uros Platise. All rights reserved.
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
*
* Authors: Uros Platise <uros.platise@isotel.eu>
*
@ -34,11 +35,6 @@
*
****************************************************************************/
/** \file
* \author Uros Platise
* \brief ST LIS331DL I2C Device Driver
**/
#ifndef __INCLUDE_NUTTX_SENSORS_LIS331DL_H
#define __INCLUDE_NUTTX_SENSORS_LIS331DL_H
@ -54,84 +50,153 @@
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
/************************************************************************************
* Public Data Types
************************************************************************************/
struct lis331dl_dev_s;
struct lis331dl_vector_s {
int8_t x, y, z;
struct lis331dl_vector_s
{
int8_t x;
int8_t y;
int8_t z;
};
/************************************************************************************
* Public Function Prototypes
************************************************************************************/
/** Initialize ST LIS331DL Chip
/************************************************************************************
* Name: lis331dl_init
*
* \param i2c I2C Device Structure
* \param address I2C Address of the proposed device
* \return Pointer to newly allocated ST LIS331DL structure or NULL on error with errno set.
* Description:
* Initialize ST LIS331DL Chip
*
* Input Parameters:
* i2c - I2C Device Structure
* address - I2C Address of the proposed device
*
* Returned Value:
* Pointer to newly allocated ST LIS331DL structure or NULL on error with errno
* set.
*
* Possible errno as set by this function on error:
* - ENODEV: When device addressed on given address is not compatible or it is not a LIS331DL
* - ENODEV: When device addressed on given address is not compatible or it is not
* a LIS331DL
* - EFAULT: When there is no device at given address.
* - EBUSY: When device is already addressed by other device driver (not yet supported by low-level driver)
**/
EXTERN struct lis331dl_dev_s * lis331dl_init(struct i2c_dev_s * i2c, uint16_t address);
/** Deinitialize ST LIS331DL Chip
* - EBUSY: When device is already addressed by other device driver (not yet
* supported by low-level driver)
*
* \param dev Device to LIS331DL device structure, as returned by the lis331dl_init()
* \return OK On success
************************************************************************************/
FAR struct lis331dl_dev_s *lis331dl_init(FAR struct i2c_dev_s * i2c,
uint16_t address);
/************************************************************************************
* Name: lis331dl_deinit
*
**/
EXTERN int lis331dl_deinit(struct lis331dl_dev_s * dev);
/** Power up device, start conversion */
EXTERN int lis331dl_powerup(struct lis331dl_dev_s * dev);
/** Power down device, stop conversion */
EXTERN int lis331dl_powerdown(struct lis331dl_dev_s * dev);
/** Configure conversion
* Description:
* Uninitialize ST LIS331DL Chip
*
* \param dev Device to LIS331DL device structure
* \param full When set, range of [-9g, 9g] is selected, otherwise [-2g, +2g]
* \param fast When set, conversion operates at 400 Hz, otherwise at 100 Hz
* \return OK on success or errno is set
**/
EXTERN int lis331dl_setconversion(struct lis331dl_dev_s * dev, bool full, bool fast);
/** Get precision
* Input Parameters:
* dev - Device to LIS331DL device structure, as returned by the lis331dl_init()
*
* \return Precision of 1 LSB in terms of unit [mg]
**/
EXTERN int lis331dl_getprecision(struct lis331dl_dev_s * dev);
/** Get sample rate
* Returned Value:
* OK On success
*
* \return Sample rate in unit of [Hz]
**/
EXTERN int lis331dl_getsamplerate(struct lis331dl_dev_s * dev);
************************************************************************************/
/** Get readings, updates internal data structure
int lis331dl_deinit(FAR struct lis331dl_dev_s * dev);
/************************************************************************************
* Name: lis331dl_powerup
*
* \param dev Device to LIS331DL device structure
* \return Ptr to vector acceleration [x,y,z] on success, or NULL on error with errno set.
* If data is not yet ready to be read from the LIS331 then errno is set to EAGAIN otherwise
* errno is set by I2C_TRANSFER().
*/
EXTERN const struct lis331dl_vector_s * lis331dl_getreadings(struct lis331dl_dev_s * dev);
* Description:
* Power up device, start conversion
*
************************************************************************************/
int lis331dl_powerup(FAR struct lis331dl_dev_s * dev);
/************************************************************************************
* Name: lis331dl_powerdown
*
* Description:
* Power down device, stop conversion
*
************************************************************************************/
int lis331dl_powerdown(FAR struct lis331dl_dev_s * dev);
/************************************************************************************
* Name: lis331dl_setconversion
*
* Description:
* Configure conversion
*
* Input Parameters:
* dev - Device to LIS331DL device structure
* full - When set, range of [-9g, 9g] is selected, otherwise [-2g, +2g]
* fast - When set, conversion operates at 400 Hz, otherwise at 100 Hz
*
* Returned Value:
* OK on success or errno is set
*
************************************************************************************/
int lis331dl_setconversion(FAR struct lis331dl_dev_s * dev, bool full, bool fast);
/************************************************************************************
* Name: lis331dl_getprecision
*
* Description:
* Get precision
*
* Returned Value:
* Precision of 1 LSB in terms of unit [mg]
*
************************************************************************************/
int lis331dl_getprecision(FAR struct lis331dl_dev_s * dev);
/************************************************************************************
* Name: lis331dl_getsamplerate
*
* Description:
* Get sample rate
*
* Returned Value:
* Sample rate in units of [Hz]
*
************************************************************************************/
int lis331dl_getsamplerate(FAR struct lis331dl_dev_s * dev);
/************************************************************************************
* Name: lis331dl_getreadings
*
* Description:
* Get readings, updates internal data structure
*
* Input Parameters:
* dev - Device to LIS331DL device structure
*
* Returned Value:
* Ptr to vector acceleration [x,y,z] on success, or NULL on error with errno
* set. If data is not yet ready to be read from the LIS331 then errno is set
* to EAGAIN otherwise errno is set by I2C_TRANSFER().
*
************************************************************************************/
FAR const struct lis331dl_vector_s *
lis331dl_getreadings(FAR struct lis331dl_dev_s * dev);
#undef EXTERN
#if defined(__cplusplus)

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/sensors/lm75.h
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -99,7 +99,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -122,8 +123,8 @@ extern "C" {
*
****************************************************************************/
EXTERN int lm75_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c,
uint8_t addr);
int lm75_register(FAR const char *devpath, FAR struct i2c_dev_s *i2c,
uint8_t addr);
#undef EXTERN
#ifdef __cplusplus

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/qencoder.h
*
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -56,7 +56,7 @@
/* The Quadrature Encode module uses a standard character driver framework.
* However, since the driver is a devices control interface and not a data
* transfer interface, the majority of the functionality is implemented in
* driver ioctl calls. The PWM ioctal commands are lised below:
* driver ioctl calls. The PWM ioctl commands are listed below:
*
* QEIOC_POSITION - Get the current position from the encoder.
* Argument: int32_t pointer to the location to return the position.
@ -94,8 +94,8 @@ struct qe_ops_s
CODE int (*setup)(FAR struct qe_lowerhalf_s *lower);
/* This method is called when the driver is closed. The lower half driver
* should stop data collection, free any resources, disable timer hardware, and
* put the system into the lowest possible power usage state
* should stop data collection, free any resources, disable timer hardware,
* and put the system into the lowest possible power usage state
*/
CODE int (*shutdown)(FAR struct qe_lowerhalf_s *lower);
@ -120,9 +120,9 @@ struct qe_ops_s
* quadrature encoder driver is registered.
*
* Normally that lower half logic will have its own, custom state structure
* that is simply cast to struct qe_lowerhalf_s. In order to perform such casts,
* the initial fields of the custom state structure match the initial fields
* of the following generic lower half state structure.
* that is simply cast to struct qe_lowerhalf_s. In order to perform such
* casts, the initial fields of the custom state structure match the initial
* fields of the following generic lower half state structure.
*/
struct qe_lowerhalf_s
@ -136,7 +136,6 @@ struct qe_lowerhalf_s
/* The custom timer state structure may include additional fields after
* the pointer to the callback structure.
*/
};
/****************************************************************************
@ -145,7 +144,8 @@ struct qe_lowerhalf_s
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -169,7 +169,7 @@ extern "C" {
*
****************************************************************************/
EXTERN int qe_register(FAR const char *devpath, FAR struct qe_lowerhalf_s *lower);
int qe_register(FAR const char *devpath, FAR struct qe_lowerhalf_s *lower);
#undef EXTERN
#ifdef __cplusplus

View file

@ -2,7 +2,7 @@
* include/nuttx/syslog/ramlog.h
* The RAM logging driver
*
* Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -35,7 +35,7 @@
****************************************************************************/
/* The RAM logging driver is a driver that was intended to support debugging
* output (syslogging) when the normal serial output is not available. For
* example, if you are using a telnet or USB serial console, the debug
* example, if you are using a Telnet or USB serial console, the debug
* output will get lost.
*
* The RAM logging driver is similar to a pipe in that it saves the
@ -137,7 +137,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -162,8 +163,7 @@ extern "C" {
****************************************************************************/
#if !defined(CONFIG_RAMLOG_CONSOLE) && !defined(CONFIG_RAMLOG_SYSLOG)
EXTERN int ramlog_register(FAR const char *devpath, FAR char *buffer,
size_t buflen);
int ramlog_register(FAR const char *devpath, FAR char *buffer, size_t buflen);
#endif
/****************************************************************************
@ -179,7 +179,7 @@ EXTERN int ramlog_register(FAR const char *devpath, FAR char *buffer,
****************************************************************************/
#ifdef CONFIG_RAMLOG_CONSOLE
EXTERN int ramlog_consoleinit(void);
int ramlog_consoleinit(void);
#endif
/****************************************************************************
@ -195,7 +195,7 @@ EXTERN int ramlog_consoleinit(void);
****************************************************************************/
#ifdef CONFIG_RAMLOG_SYSLOG
EXTERN int ramlog_sysloginit(void);
int ramlog_sysloginit(void);
#endif
#undef EXTERN

View file

@ -2,7 +2,7 @@
* include/nuttx/syslog/syslog.h
* The NuttX SYSLOGing interface
*
* Copyright (C) 2012, 2014 Gregory Nutt. All rights reserved.
* Copyright (C) 2012, 2014-2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -87,7 +87,8 @@
#ifdef __cplusplus
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -108,7 +109,7 @@ extern "C" {
****************************************************************************/
#ifdef CONFIG_SYSLOG_CHAR
EXTERN int syslog_initialize(void);
int syslog_initialize(void);
#endif
/****************************************************************************
@ -124,7 +125,7 @@ EXTERN int syslog_initialize(void);
****************************************************************************/
#ifdef CONFIG_SYSLOG
EXTERN int syslog_putc(int ch);
int syslog_putc(int ch);
#endif
#undef EXTERN

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/usb/cdcacm.h
*
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -311,9 +311,9 @@ typedef FAR void (*cdcacm_callback_t)(enum cdcacm_event_e event);
*
* Description:
* If the CDC serial class driver is part of composite device, then
* board-specific logic must provide board_cdcclassobject(). In the simplest
* case, board_cdcclassobject() is simply a wrapper around cdcacm_classobject()
* that provides the correct device minor number.
* board-specific logic must provide board_cdcclassobject(). In the
* simplest case, board_cdcclassobject() is simply a wrapper around
* cdcacm_classobject() that provides the correct device minor number.
*
* Input Parameters:
* classdev - The location to return the CDC serial class' device
@ -326,7 +326,7 @@ typedef FAR void (*cdcacm_callback_t)(enum cdcacm_event_e event);
#if defined(CONFIG_USBDEV_COMPOSITE) && defined(CONFIG_CDCACM_COMPOSITE)
struct usbdevclass_driver_s;
EXTERN int board_cdcclassobject(FAR struct usbdevclass_driver_s **classdev);
int board_cdcclassobject(FAR struct usbdevclass_driver_s **classdev);
#endif
/****************************************************************************
@ -334,11 +334,11 @@ EXTERN int board_cdcclassobject(FAR struct usbdevclass_driver_s **classdev);
*
* Description:
* Un-initialize the USB serial class driver. This is just an application-
* specific wrapper aboutn cdcadm_unitialize() that is called form the composite
* device logic.
* specific wrapper around cdcadm_unitialize() that is called form the
* composite device logic.
*
* Input Parameters:
* classdev - The class driver instrance previously give to the composite
* classdev - The class driver instance previously give to the composite
* driver by board_cdcclassobject().
*
* Returned Value:
@ -348,7 +348,7 @@ EXTERN int board_cdcclassobject(FAR struct usbdevclass_driver_s **classdev);
#if defined(CONFIG_USBDEV_COMPOSITE) && defined(CONFIG_CDCACM_COMPOSITE)
struct usbdevclass_driver_s;
EXTERN void board_cdcuninitialize(FAR struct usbdevclass_driver_s *classdev);
void board_cdcuninitialize(FAR struct usbdevclass_driver_s *classdev);
#endif
/****************************************************************************
@ -392,7 +392,7 @@ int cdcacm_classobject(int minor, FAR struct usbdevclass_driver_s **classdev);
****************************************************************************/
#if !defined(CONFIG_USBDEV_COMPOSITE) || !defined(CONFIG_CDCACM_COMPOSITE)
EXTERN int cdcacm_initialize(int minor, FAR void **handle);
int cdcacm_initialize(int minor, FAR void **handle);
#endif
/****************************************************************************
@ -400,18 +400,18 @@ EXTERN int cdcacm_initialize(int minor, FAR void **handle);
*
* Description:
* Un-initialize the USB storage class driver. This function is used
* internally by the USB composite driver to unitialized the CDC/ACM
* internally by the USB composite driver to uninitialized the CDC/ACM
* driver. This same interface is available (with an untyped input
* parameter) when the CDC/ACM driver is used standalone.
*
* Input Parameters:
* There is one parameter, it differs in typing depending upon whether the
* CDC/ACM driver is an internal part of a composite device, or a standalone
* USB driver:
* CDC/ACM driver is an internal part of a composite device, or a
* standalone USB driver:
*
* classdev - The class object returned by board_cdcclassobject() or
* cdcacm_classobject()
* handle - The opaque handle represetning the class object returned by
* handle - The opaque handle representing the class object returned by
* a previous call to cdcacm_initialize().
*
* Returned Value:
@ -420,9 +420,9 @@ EXTERN int cdcacm_initialize(int minor, FAR void **handle);
****************************************************************************/
#if defined(CONFIG_USBDEV_COMPOSITE) && defined(CONFIG_CDCACM_COMPOSITE)
EXTERN void cdcacm_uninitialize(FAR struct usbdevclass_driver_s *classdev);
void cdcacm_uninitialize(FAR struct usbdevclass_driver_s *classdev);
#else
EXTERN void cdcacm_uninitialize(FAR void *handle);
void cdcacm_uninitialize(FAR void *handle);
#endif
#undef EXTERN

View file

@ -1,7 +1,7 @@
/************************************************************************************
* include/nuttx/usb/composite.h
*
* Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2008-2011, 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -81,7 +81,8 @@
#undef EXTERN
#if defined(__cplusplus)
#define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
#define EXTERN extern
#endif
@ -112,7 +113,7 @@ extern "C" {
*
****************************************************************************/
EXTERN FAR void *composite_initialize(void);
FAR void *composite_initialize(void);
/****************************************************************************
* Name: composite_uninitialize
@ -132,7 +133,7 @@ EXTERN FAR void *composite_initialize(void);
*
***************************************************************************/
EXTERN void composite_uninitialize(FAR void *handle);
void composite_uninitialize(FAR void *handle);
/****************************************************************************
* Name: composite_initialize
@ -156,7 +157,7 @@ EXTERN void composite_uninitialize(FAR void *handle);
*
****************************************************************************/
EXTERN FAR void *composite_initialize(void);
FAR void *composite_initialize(void);
/****************************************************************************
* Name: composite_ep0submit
@ -165,7 +166,7 @@ EXTERN FAR void *composite_initialize(void);
* Members of the composite cannot send on EP0 directly because EP0 is
* is "owned" by the composite device. Instead, when configured as members
* of a composite device, those classes should call this method so that
* the composite device can send on EP0 onbehalf of the class.
* the composite device can send on EP0 on behalf of the class.
*
****************************************************************************/
@ -173,9 +174,9 @@ struct usbdevclass_driver_s;
struct usbdev_s;
struct usbdev_req_s;
EXTERN int composite_ep0submit(FAR struct usbdevclass_driver_s *driver,
FAR struct usbdev_s *dev,
FAR struct usbdev_req_s *ctrlreq);
int composite_ep0submit(FAR struct usbdevclass_driver_s *driver,
FAR struct usbdev_s *dev,
FAR struct usbdev_req_s *ctrlreq);
#undef EXTERN
#if defined(__cplusplus)

View file

@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/usb/hid_parser.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
*
* Adapted from the LUFA Library:
*
@ -235,13 +235,14 @@ struct hid_rptinfo_s
typedef bool (*hid_rptfilter_t)(FAR struct hid_rptitem_s *item);
/****************************************************************************
* Public Function Protoypes
* Public Function Prototypes
****************************************************************************/
#undef EXTERN
#if defined(__cplusplus)
# define EXTERN extern "C"
extern "C" {
extern "C"
{
#else
# define EXTERN extern
#endif
@ -257,23 +258,24 @@ extern "C" {
* report Buffer containing the device's HID report table.
* rptlen Size in bytes of the HID report table.
* filter Callback function to decide if an item should be retained
* rptinfo Pointer to a struct hid_rptinfo_s instance for the parser output.
* rptinfo Pointer to a struct hid_rptinfo_s instance for the parser
* output.
*
* Returned Value:
* Zero on success, otherwise a negated errno value.
****************************************************************************/
EXTERN int hid_parsereport(FAR const uint8_t *report, int rptlen,
hid_rptfilter_t filter,
FAR struct hid_rptinfo_s *rptinfo);
int hid_parsereport(FAR const uint8_t *report, int rptlen,
hid_rptfilter_t filter,
FAR struct hid_rptinfo_s *rptinfo);
/****************************************************************************
* Name: hid_getitem
*
* Description:
* Extracts the given report item's value out of the given HID report and
* places it into the value member of the report item's struct hid_rptitem_s
* structure.
* places it into the value member of the report item's struct
* hid_rptitem_s structure.
*
* When called on a report with an item that exists in that report, this
* copies the report item's Value to it's previous element for easy
@ -282,27 +284,27 @@ EXTERN int hid_parsereport(FAR const uint8_t *report, int rptlen,
* does not modify the report item's data.
*
* Input Parameters
* report Buffer containing an IN or FEATURE report from an attached
* device.
* item Pointer to the report item of interest in a struct hid_rptinfo_s
* item array.
* report Buffer containing an IN or FEATURE report from an attached
* device.
* item Pointer to the report item of interest in a struct hid_rptinfo_s
* item array.
*
* Returned Value:
* Zero on success, otherwise a negated errno value.
*
****************************************************************************/
EXTERN int hid_getitem(FAR const uint8_t *report, FAR struct hid_rptitem_s *item);
int hid_getitem(FAR const uint8_t *report, FAR struct hid_rptitem_s *item);
/****************************************************************************
* Name: hid_putitem
*
* Desription:
* Description:
* Retrieves the given report item's value out of the value member of the
* report item's struct hid_rptitem_s structure and places it into the correct
* position in the HID report buffer. The report buffer is assumed to have
* the appropriate bits cleared before calling this function (i.e., the
* buffer should be explicitly cleared before report values are added).
* report item's struct hid_rptitem_s structure and places it into the
* correct position in the HID report buffer. The report buffer is assumed
* to have the appropriate bits cleared before calling this function (i.e.,
* the buffer should be explicitly cleared before report values are added).
*
* When called, this copies the report item's Value element to it's
* previous element for easy checking to see if an item's value has
@ -313,13 +315,13 @@ EXTERN int hid_getitem(FAR const uint8_t *report, FAR struct hid_rptitem_s *item
*
* Input Parameters:
* report Buffer holding the current OUT or FEATURE report data.
* item Pointer to the report item of interest in a struct hid_rptinfo_s
* item array.
* item Pointer to the report item of interest in a struct
* hid_rptinfo_s item array.
*
****************************************************************************/
#if 0 /* Not needed by host */
EXTERN void hid_putitem(FAR uint8_t *report, FAR struct hid_rptitem_s *item);
void hid_putitem(FAR uint8_t *report, FAR struct hid_rptitem_s *item);
#endif
/****************************************************************************
@ -329,17 +331,18 @@ EXTERN void hid_putitem(FAR uint8_t *report, FAR struct hid_rptitem_s *item);
* Retrieves the size of a given HID report in bytes from it's Report ID.
*
* InputParameters:
* rptinfo Pointer to a struct hid_rptinfo_s instance containing the parser output.
* rptinfo Pointer to a struct hid_rptinfo_s instance containing the parser
* output.
* id Report ID of the report whose size is to be retrieved.
* rpttype Type of the report whose size is to be determined, a valued from the
* HID_ReportItemTypes_t enum.
* rpttype Type of the report whose size is to be determined, a valued from
* the HID_ReportItemTypes_t enum.
*
* Size of the report in bytes, or 0 if the report does not exist.
*
****************************************************************************/
EXTERN size_t hid_reportsize(FAR struct hid_rptinfo_s *rptinfo,
uint8_t id, uint8_t rpttype);
size_t hid_reportsize(FAR struct hid_rptinfo_s *rptinfo, uint8_t id,
uint8_t rpttype);
#undef EXTERN
#if defined(__cplusplus)
@ -347,4 +350,4 @@ EXTERN size_t hid_reportsize(FAR struct hid_rptinfo_s *rptinfo,
#endif
#endif /* __INCLUDE_NUTTX_USB_HID_PARSER_H */
#endif /* __INCLUDE_NUTTX_USB_HID_PARSER_H */

View file

@ -124,8 +124,8 @@ struct timespec
* REVISIT: This structure could be packed better using uint8_t's and
* uint16_t's. The standard definition does, however, call out type int for
* all of the members. NOTE: Any changes to this structure must be also be
* reflected in struct rtc_time defined in include/nuttx/timers/rtc.h; these two
* structures must be cast compatible.
* reflected in struct rtc_time defined in include/nuttx/timers/rtc.h; these
* two structures must be cast compatible.
*/
struct tm

View file

@ -51,8 +51,9 @@
* Function: asctime
*
* Description:
* asctime and asctime_r converts the time provided in a struct tm to a
* string representation. asctime is not re-entrant.
* asctime and asctime_r convert the time provided in a struct tm to a
* string representation. asctime is not re-entrant; asctime_r is re-
* entrant
*
* Parameters:
* tp - Pointer to the time to be converted.

View file

@ -51,12 +51,12 @@
* definitions could be combined to save a little FLASH space.
*/
static const char g_wday_name[7][3] =
static const char * const g_wday_name[7] =
{
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
static const char g_mon_name[12][3] =
static const char * const g_mon_name[12] =
{
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
@ -70,11 +70,12 @@ static const char g_mon_name[12][3] =
* Function: asctime_r
*
* Description:
* asctime and asctime_r converts the time provided in a struct tm to a
* string representation. asctime_r is re-entrant.
* asctime and asctime_r convert the time provided in a struct tm to a
* string representation. asctime is not re-entrant; asctime_r is re-
* entrant.
*
* Parameters:
* tp - Pointer to the time to be converted.
* tp - Pointer to the time to be converted.
* buf - A user provided buffer to receive the 26 character time string.
*
* Return Value:

View file

@ -1,5 +1,5 @@
/****************************************************************************
* libc/time/lib_asctime.c
* libc/time/lib_ctime.c
*
* Copyright (C) 2015 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
@ -51,9 +51,9 @@
* Function: ctime
*
* Description:
* ctime and ctime_r converts the time provided in seconds since the
* epoch to a string representation. asctime is not re-entrant. ctime is
* not re-entrant.
* ctime and ctime_r convert the time provided in seconds since the
* epoch to a string representation. ctime is not re-entrant; ctime_r is
* re-entrant.
*
* Parameters:
* timep - The current time represented as seconds since the epoch.

View file

@ -55,13 +55,13 @@
* Function: ctime_r
*
* Description:
* ctime and ctime_r converts the time provided in seconds since the
* epoch to a string representation. asctime is not re-entrant. ctimer is
* ctime and ctime_r convert the time provided in seconds since the
* epoch to a string representation. ctime is not re-entrant; ctime_r is
* re-entrant.
*
* Parameters:
* timep - The current time represented as seconds since the epoch.
* buf - A user provided buffer to receive the 26 character time string.
* buf - A user provided buffer to receive the 26 character time string.
*
* Return Value:
* One success, the pointer to the 'buf' is returned; on failure, NULL is