summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-04-22 09:01:20 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-04-22 09:01:20 -0600
commit919fd1d3f93e7292da2b2a29a200f05b46886f06 (patch)
tree9556e73396200d8503560e5024b117b91e9ecc39 /nuttx/include
parent4c0502234f156d9d21bd7c6d20d1002908ef65ed (diff)
downloadnuttx-919fd1d3f93e7292da2b2a29a200f05b46886f06.tar.gz
nuttx-919fd1d3f93e7292da2b2a29a200f05b46886f06.tar.bz2
nuttx-919fd1d3f93e7292da2b2a29a200f05b46886f06.zip
Various SAM4S related fixes, mostely related to the timer driver driver and the SAM4S timer/counter. All from Bob Doisin
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/fs/ioctl.h6
-rw-r--r--nuttx/include/nuttx/timer.h18
2 files changed, 17 insertions, 7 deletions
diff --git a/nuttx/include/nuttx/fs/ioctl.h b/nuttx/include/nuttx/fs/ioctl.h
index 7baf2fd49..25c3c6d95 100644
--- a/nuttx/include/nuttx/fs/ioctl.h
+++ b/nuttx/include/nuttx/fs/ioctl.h
@@ -70,6 +70,7 @@
#define _SLCDIOCBASE (0x1100) /* Segment LCD ioctl commands */
#define _WLIOCBASE (0x1200) /* Wireless modules ioctl commands */
#define _CFGDIOCBASE (0x1300) /* Config Data device (app config) ioctl commands */
+#define _TCIOCBASE (0x1400) /* Timer ioctl commands */
/* Macros used to manage ioctl commands */
@@ -93,6 +94,11 @@
#define _WDIOCVALID(c) (_IOC_TYPE(c)==_WDIOCBASE)
#define _WDIOC(nr) _IOC(_WDIOCBASE,nr)
+/* Timer driver ioctl commands *******************************************/
+
+#define _TCIOCVALID(c) (_IOC_TYPE(c)==_TCIOCBASE)
+#define _TCIOC(nr) _IOC(_TCIOCBASE,nr)
+
/* NuttX file system ioctl definitions **************************************/
#define _FIOCVALID(c) (_IOC_TYPE(c)==_FIOCBASE)
diff --git a/nuttx/include/nuttx/timer.h b/nuttx/include/nuttx/timer.h
index b8fba163d..82776a6a6 100644
--- a/nuttx/include/nuttx/timer.h
+++ b/nuttx/include/nuttx/timer.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/timer.h
*
- * Copyright (C) 2012 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -68,8 +68,11 @@
* Argument: A 32-bit timeout value in microseconds.
* TCIOC_CAPTURE - Do not reset. Instead, called this handler.
* Argument: A pointer to struct timer_capture_s.
+ *
+ * WARNING: May change TCIOC_SETTIMEOUT to pass pointer to 64bit nanoseconds
+ * or timespec structure.
*/
-#warning "may change TCIOC_SETTIMEOUT to pass pointer to 64bit nanoseconds or timespec structure"
+
#define TCIOC_START _TCIOC(0x001)
#define TCIOC_STOP _TCIOC(0x002)
#define TCIOC_GETSTATUS _TCIOC(0x003)
@@ -174,7 +177,8 @@ struct timer_lowerhalf_s
#ifdef __cplusplus
#define EXTERN extern "C"
-extern "C" {
+extern "C"
+{
#else
#define EXTERN extern
#endif
@@ -212,8 +216,8 @@ extern "C" {
*
****************************************************************************/
-EXTERN FAR void *timer_register(FAR const char *path,
- FAR struct timer_lowerhalf_s *lower);
+FAR void *timer_register(FAR const char *path,
+ FAR struct timer_lowerhalf_s *lower);
/****************************************************************************
* Name: timer_unregister
@@ -230,7 +234,7 @@ EXTERN FAR void *timer_register(FAR const char *path,
*
****************************************************************************/
-EXTERN void timer_unregister(FAR void *handle);
+void timer_unregister(FAR void *handle);
/****************************************************************************
* Platform-Independent "Lower-Half" Timer Driver Interfaces
@@ -259,7 +263,7 @@ EXTERN void timer_unregister(FAR void *handle);
*
****************************************************************************/
-EXTERN int up_timerinitialize(void);
+int up_timerinitialize(void);
#undef EXTERN
#ifdef __cplusplus