Go to the documentation of this file.
31 #ifndef _RA6_ETH_DRIVER_H
32 #define _RA6_ETH_DRIVER_H
38 #ifndef RA6_ETH_TX_BUFFER_COUNT
39 #define RA6_ETH_TX_BUFFER_COUNT 3
40 #elif (RA6_ETH_TX_BUFFER_COUNT < 1)
41 #error RA6_ETH_TX_BUFFER_COUNT parameter is not valid
45 #ifndef RA6_ETH_TX_BUFFER_SIZE
46 #define RA6_ETH_TX_BUFFER_SIZE 1536
47 #elif (RA6_ETH_TX_BUFFER_SIZE != 1536)
48 #error RA6_ETH_TX_BUFFER_SIZE parameter is not valid
52 #ifndef RA6_ETH_RX_BUFFER_COUNT
53 #define RA6_ETH_RX_BUFFER_COUNT 6
54 #elif (RA6_ETH_RX_BUFFER_COUNT < 1)
55 #error RA6_ETH_RX_BUFFER_COUNT parameter is not valid
59 #ifndef RA6_ETH_RX_BUFFER_SIZE
60 #define RA6_ETH_RX_BUFFER_SIZE 1536
61 #elif (RA6_ETH_RX_BUFFER_SIZE != 1536)
62 #error RA6_ETH_RX_BUFFER_SIZE parameter is not valid
66 #ifndef RA6_ETH_IRQ_PRIORITY_GROUPING
67 #define RA6_ETH_IRQ_PRIORITY_GROUPING 3
68 #elif (RA6_ETH_IRQ_PRIORITY_GROUPING < 0)
69 #error RA6_ETH_IRQ_PRIORITY_GROUPING parameter is not valid
73 #ifndef RA6_ETH_IRQ_GROUP_PRIORITY
74 #define RA6_ETH_IRQ_GROUP_PRIORITY 12
75 #elif (RA6_ETH_IRQ_GROUP_PRIORITY < 0)
76 #error RA6_ETH_IRQ_GROUP_PRIORITY parameter is not valid
80 #ifndef RA6_ETH_IRQ_SUB_PRIORITY
81 #define RA6_ETH_IRQ_SUB_PRIORITY 0
82 #elif (RA6_ETH_IRQ_SUB_PRIORITY < 0)
83 #error RA6_ETH_IRQ_SUB_PRIORITY parameter is not valid
87 #ifndef RA6_ETH_RAM_SECTION
88 #define RA6_ETH_RAM_SECTION ".ns_buffer"
92 #ifndef R_ETHERC_EDMAC
93 #define R_ETHERC_EDMAC ((R_ETHERC_EDMAC_Type *) R_ETHERC_EDMAC_BASE)
97 #ifndef R_MSTP_MSTPCRB_MSTPB15_Msk
98 #define R_MSTP_MSTPCRB_MSTPB15_Msk (R_MSTP_MSTPCRB_MSTPB_Msk << 15)
102 #define EDMAC_TD0_TACT 0x80000000
103 #define EDMAC_TD0_TDLE 0x40000000
104 #define EDMAC_TD0_TFP_SOF 0x20000000
105 #define EDMAC_TD0_TFP_EOF 0x10000000
106 #define EDMAC_TD0_TFE 0x08000000
107 #define EDMAC_TD0_TWBI 0x04000000
108 #define EDMAC_TD0_TFS_MASK 0x0000010F
109 #define EDMAC_TD0_TFS_TABT 0x00000100
110 #define EDMAC_TD0_TFS_CND 0x00000008
111 #define EDMAC_TD0_TFS_DLC 0x00000004
112 #define EDMAC_TD0_TFS_CD 0x00000002
113 #define EDMAC_TD0_TFS_TRO 0x00000001
114 #define EDMAC_TD1_TBL 0xFFFF0000
115 #define EDMAC_TD2_TBA 0xFFFFFFFF
118 #define EDMAC_RD0_RACT 0x80000000
119 #define EDMAC_RD0_RDLE 0x40000000
120 #define EDMAC_RD0_RFP_SOF 0x20000000
121 #define EDMAC_RD0_RFP_EOF 0x10000000
122 #define EDMAC_RD0_RFE 0x08000000
123 #define EDMAC_RD0_RFS_MASK 0x0000039F
124 #define EDMAC_RD0_RFS_RFOF 0x00000200
125 #define EDMAC_RD0_RFS_RABT 0x00000100
126 #define EDMAC_RD0_RFS_RMAF 0x00000080
127 #define EDMAC_RD0_RFS_RRF 0x00000010
128 #define EDMAC_RD0_RFS_RTLF 0x00000008
129 #define EDMAC_RD0_RFS_RTSF 0x00000004
130 #define EDMAC_RD0_RFS_PRE 0x00000002
131 #define EDMAC_RD0_RFS_CERF 0x00000001
132 #define EDMAC_RD1_RBL 0xFFFF0000
133 #define EDMAC_RD1_RFL 0x0000FFFF
134 #define EDMAC_RD2_RBA 0xFFFFFFFF
Structure describing a buffer that spans multiple chunks.
void ra6EthWritePhyReg(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr, uint16_t data)
Write PHY register.
void ra6EthInitDmaDesc(NetInterface *interface)
Initialize DMA descriptor lists.
error_t ra6EthInit(NetInterface *interface)
RA6 Ethernet MAC initialization.
uint16_t ra6EthReadPhyReg(uint8_t opcode, uint8_t phyAddr, uint8_t regAddr)
Read PHY register.
void ra6EthWriteSmi(uint32_t data, uint_t length)
SMI write operation.
void ra6EthDisableIrq(NetInterface *interface)
Disable interrupts.
uint32_t ra6EthReadSmi(uint_t length)
SMI read operation.
error_t ra6EthReceivePacket(NetInterface *interface)
Receive a packet.
void ra6EthEventHandler(NetInterface *interface)
RA6 Ethernet MAC event handler.
void ra6EthInitGpio(NetInterface *interface)
GPIO configuration.
error_t ra6EthUpdateMacAddrFilter(NetInterface *interface)
Configure MAC address filtering.
const NicDriver ra6EthDriver
RA6 Ethernet MAC driver.
Network interface controller abstraction layer.
error_t ra6EthUpdateMacConfig(NetInterface *interface)
Adjust MAC configuration parameters for proper operation.
error_t ra6EthSendPacket(NetInterface *interface, const NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send a packet.
void ra6EthEnableIrq(NetInterface *interface)
Enable interrupts.
void ra6EthTick(NetInterface *interface)
RA6 Ethernet MAC timer handler.