aboutsummaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-09-10 16:48:45 +0000
committerpatacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679>2012-09-10 16:48:45 +0000
commit2d556705e5acab152b5028a35558a9aaa1de9e13 (patch)
tree4568b0eeb29017386bbf5be7f4416f3178c858dc /nuttx/include
parent2b424e0424b403fa82f07cc372267645d7701edf (diff)
downloadpx4-firmware-2d556705e5acab152b5028a35558a9aaa1de9e13.tar.gz
px4-firmware-2d556705e5acab152b5028a35558a9aaa1de9e13.tar.bz2
px4-firmware-2d556705e5acab152b5028a35558a9aaa1de9e13.zip
More logic for the MX3 Wildfire board
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@5123 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/net/enc28j60.h25
1 files changed, 20 insertions, 5 deletions
diff --git a/nuttx/include/nuttx/net/enc28j60.h b/nuttx/include/nuttx/net/enc28j60.h
index 2507b1cf6..9a3be10c1 100644
--- a/nuttx/include/nuttx/net/enc28j60.h
+++ b/nuttx/include/nuttx/net/enc28j60.h
@@ -1,7 +1,7 @@
/****************************************************************************
* include/nuttx/net/enc28j60.h
*
- * Copyright (C) 2010 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2010, 2012 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@@ -43,6 +43,8 @@
#include <stdint.h>
#include <stdbool.h>
+#include <nuttx/irq.h>
+
/****************************************************************************
* Pre-processor Definitions
****************************************************************************/
@@ -80,6 +82,18 @@ struct enc_stats_s
};
#endif
+/* The ENC28J60 normal provides interrupts to the MCU via a GPIO pin. The
+ * following structure provides an MCU-independent mechanixm for controlling
+ * the ENC28J60 GPIO interrupt.
+ */
+
+struct enc_lower_s
+{
+ int (*attach)(FAR struct enc_lower_s *lower, xcpt_t handler);
+ void (*enable)(FAR struct enc_lower_s *lower);
+ void (*disable)(FAR struct enc_lower_s *lower);
+};
+
/****************************************************************************
* Public Data
****************************************************************************/
@@ -104,10 +118,10 @@ extern "C" {
*
* Parameters:
* spi - A reference to the platform's SPI driver for the ENC28J60
+ * lower - The MCU-specific interrupt used to control low-level MCU
+ * functions (i.e., ENC28J60 GPIO interrupts).
* devno - If more than one ENC28J60 is supported, then this is the
* zero based number that identifies the ENC28J60;
- * irq - The fully configured GPIO IRQ that ENC28J60 interrupts will be
- * asserted on. This driver will attach and entable this IRQ.
*
* Returned Value:
* OK on success; Negated errno on failure.
@@ -117,8 +131,9 @@ extern "C" {
****************************************************************************/
struct spi_dev_s; /* see nuttx/spi.h */
-EXTERN int enc_initialize(FAR struct spi_dev_s *spi, unsigned int devno,
- unsigned int irq);
+EXTERN int enc_initialize(FAR struct spi_dev_s *spi,
+ FAR const struct enc_lower_s *lower,
+ unsigned int devno);
/****************************************************************************
* Function: enc_stats