56 lines
1.7 KiB
C
56 lines
1.7 KiB
C
|
|
/********************************** (C) COPYRIGHT ************* ******************
|
||
|
|
* File Name : eth_driver.h
|
||
|
|
* Author : WCH
|
||
|
|
* Version : V1.3.0
|
||
|
|
* Date : 2024/05/05
|
||
|
|
* Description : This file contains the headers of the ETH Driver.
|
||
|
|
*********************************************************************************
|
||
|
|
* Copyright (c) 2021 Nanjing Qinheng Microelectronics Co., Ltd.
|
||
|
|
* Attention: This software (modified or not) and binary are used for
|
||
|
|
* microcontroller manufactured by Nanjing Qinheng Microelectronics.
|
||
|
|
*******************************************************************************/
|
||
|
|
#ifndef __ETH_DRIVER__
|
||
|
|
#define __ETH_DRIVER__
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
extern "C" {
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#include "debug.h"
|
||
|
|
#include "wchnet.h"
|
||
|
|
|
||
|
|
#define PHY_ADDRESS 1
|
||
|
|
|
||
|
|
#define ROM_CFG_USERADR_ID 0X30CC
|
||
|
|
|
||
|
|
#define PHY_ANLPAR_SELECTOR_FIELD 0x1F
|
||
|
|
#define PHY_ANLPAR_SELECTOR_VALUE 0x01 /* 5B'00001 */
|
||
|
|
|
||
|
|
#ifndef WCHNETTIMERPERIOD
|
||
|
|
#define WCHNETTIMERPERIOD 10 /* Timer period, in Ms. */
|
||
|
|
#endif
|
||
|
|
|
||
|
|
extern ETH_DMADESCTypeDef *DMATxDescToSet;
|
||
|
|
extern ETH_DMADESCTypeDef *DMARxDescToGet;
|
||
|
|
extern SOCK_INF SocketInf[ ];
|
||
|
|
extern uint8_t RemoteIp[4];
|
||
|
|
|
||
|
|
#define ETH_LED_CTRL (*((volatile uint32_t *)0x40400158))
|
||
|
|
|
||
|
|
void ETH_PHYLink( void );
|
||
|
|
void WCHNET_ETHIsr( void );
|
||
|
|
void WCHNET_MainTask( void );
|
||
|
|
void ETH_LedConfiguration(void);
|
||
|
|
void ETH_Init( uint8_t *macAddr );
|
||
|
|
void ETH_LedLinkSet( uint8_t mode );
|
||
|
|
void ETH_LedDataSet( uint8_t mode );
|
||
|
|
void WCHNET_TimeIsr( uint16_t timperiod );
|
||
|
|
void ETH_Configuration( uint8_t *macAddr );
|
||
|
|
uint8_t ETH_LibInit( uint8_t *ip, uint8_t *gwip, uint8_t *mask, uint8_t *macaddr);
|
||
|
|
|
||
|
|
#ifdef __cplusplus
|
||
|
|
}
|
||
|
|
#endif
|
||
|
|
|
||
|
|
#endif
|