diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-03 12:35:41 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2011-09-03 12:35:41 +0000 |
commit | 792d85bcb5774e63100abef0125d5325312f916a (patch) | |
tree | 4f874b2123dcbaf591ccea388de3c3e09a0ddf51 /os/hal/include | |
parent | 08dad7b1f54ff8eb6266e811533eecf53051249c (diff) | |
download | ChibiOS-792d85bcb5774e63100abef0125d5325312f916a.tar.gz ChibiOS-792d85bcb5774e63100abef0125d5325312f916a.tar.bz2 ChibiOS-792d85bcb5774e63100abef0125d5325312f916a.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3287 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/include')
-rw-r--r-- | os/hal/include/mac.h | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/os/hal/include/mac.h b/os/hal/include/mac.h index 37d6bbe9b..c716796f8 100644 --- a/os/hal/include/mac.h +++ b/os/hal/include/mac.h @@ -38,18 +38,48 @@ /* Driver pre-compile time settings. */
/*===========================================================================*/
+/**
+ * @name MAC configuration options
+ * @{
+ */
+/**
+ * @brief Enables an event sources for incoming packets.
+ */
+#if !defined(MAC_USE_EVENTS) || defined(__DOXYGEN__)
+#define MAC_USE_EVENTS TRUE
+#endif
+/** @} */
+
/*===========================================================================*/
/* Derived constants and error checks. */
/*===========================================================================*/
#if !CH_USE_SEMAPHORES || !CH_USE_EVENTS
-#error "the MAC driver requires CH_USE_SEMAPHORES and CH_USE_EVENTS"
+#error "the MAC driver requires CH_USE_SEMAPHORES"
+#endif
+
+#if MAC_USE_EVENTS && !CH_USE_EVENTS
+#error "the MAC driver requires CH_USE_EVENTS"
#endif
/*===========================================================================*/
/* Driver data structures and types. */
/*===========================================================================*/
+/**
+ * @brief Driver state machine possible states.
+ */
+typedef enum {
+ MAC_UNINIT = 0, /**< Not initialized. */
+ MAC_STOP = 1, /**< Stopped. */
+ MAC_ACTIVE = 2, /**< Active. */
+} macstate_t;
+
+/**
+ * @brief Type of a structure representing a MAC driver.
+ */
+typedef struct MACDriver MACDriver;
+
#include "mac_lld.h"
/*===========================================================================*/
@@ -68,7 +98,7 @@ *
* @api
*/
-#if CH_USE_EVENTS || defined(__DOXYGEN__)
+#if MAC_USE_EVENTS || defined(__DOXYGEN__)
#define macGetReceiveEventSource(macp) (&(macp)->rdevent)
#endif
@@ -113,6 +143,8 @@ extern "C" { #endif
void macInit(void);
void macObjectInit(MACDriver *macp);
+ void macStart(MACDriver *macp, const MACConfig *config);
+ void macStop(MACDriver *macp);
void macSetAddress(MACDriver *macp, const uint8_t *p);
msg_t macWaitTransmitDescriptor(MACDriver *macp,
MACTransmitDescriptor *tdp,
|