ChibiOS/HAL 9.0.0
hal_mac.h File Reference

MAC Driver macros and structures. More...

#include "hal_mac_lld.h"

Go to the source code of this file.

Data Structures

struct  hal_mac_config
 Driver configuration structure. More...
struct  hal_mac_driver
 Structure representing a MAC driver. More...
struct  hal_mac_transmit_descriptor
 Structure representing a MAC transmit descriptor. More...
struct  hal_mac_receive_descriptor
 Structure representing a MAC receive descriptor. More...

Macros

MAC event flags
#define MAC_FLAGS_TX   (1U << 0)
#define MAC_FLAGS_RX   (1U << 1)
MAC configuration options
#define MAC_USE_ZERO_COPY   FALSE
 Enables an event sources for incoming packets.
#define MAC_USE_EVENTS   TRUE
 Enables an event sources for incoming packets.
Low level driver helper macros
#define __mac_callback(macp)
 MAC callback.
#define __mac_tx_wakeup(macp)
 MAC TX wakeup and event.
#define __mac_rx_wakeup(macp)
 MAC RX wakeup and event.
Macro Functions
#define macSetCallbackX(macp, f)
 Associates a callback to the MAC instance.
#define macGetEventSource(macp)
 Returns the driver events source.
#define macGetTransmitDescriptorX(macp, tdp)
 Returns a transmission descriptor.
#define macReleaseTransmitDescriptorX(tdp)
 Releases a transmit descriptor and starts the transmission of the enqueued data as a single frame.
#define macGetReceiveDescriptorX(macp, rdp)
 Returns a receive descriptor.
#define macReleaseReceiveDescriptorX(rdp)
 Releases a receive descriptor.
#define macWriteTransmitDescriptor(tdp, buf, size)
 Writes to a transmit descriptor's stream.
#define macReadReceiveDescriptor(rdp, buf, size)
 Reads from a receive descriptor's stream.
#define macGetNextTransmitBuffer(tdp, size, sizep)
 Returns a pointer to the next transmit buffer in the descriptor chain.
#define macGetNextReceiveBuffer(rdp, sizep)
 Returns a pointer to the next receive buffer in the descriptor chain.

Typedefs

typedef struct hal_mac_driver MACDriver
 Type of a structure representing a MAC driver.
typedef struct hal_mac_config MACConfig
 Type of structure representing a MAC configuration.
typedef struct hal_mac_transmit_descriptor MACTransmitDescriptor
 Type of structure representing a MAC transmit descriptor.
typedef struct hal_mac_receive_descriptor MACReceiveDescriptor
 Type of structure representing a MAC receive descriptor.
typedef void(* maccb_t) (MACDriver *macp)
 Generic ETH notification callback type.

Enumerations

enum  macstate_t { MAC_UNINIT = 0 , MAC_STOP = 1 , MAC_ACTIVE = 2 }
 Driver state machine possible states. More...

Functions

void macInit (void)
 MAC Driver initialization.
void macObjectInit (MACDriver *macp)
 Initialize the standard part of a MACDriver structure.
msg_t macStart (MACDriver *macp, const MACConfig *config)
 Configures and activates the MAC peripheral.
void macStop (MACDriver *macp)
 Deactivates the MAC peripheral.
eventflags_t macGetAndClearEventsI (MACDriver *macp)
 Get and clears MAC event flags.
msg_t macWaitTransmitDescriptor (MACDriver *macp, MACTransmitDescriptor *tdp, sysinterval_t timeout)
 Allocates a transmission descriptor.
void macReleaseTransmitDescriptor (MACTransmitDescriptor *tdp)
msg_t macWaitReceiveDescriptor (MACDriver *macp, MACReceiveDescriptor *rdp, sysinterval_t timeout)
 Waits for a received frame.
void macReleaseReceiveDescriptor (MACReceiveDescriptor *rdp)
bool macPollLinkStatus (MACDriver *macp)
 Updates and returns the link status.

Detailed Description

MAC Driver macros and structures.

Definition in file hal_mac.h.