Change folder name
This commit is contained in:
664
project/Drivers/BSP/Components/lan8742/lan8742.c
Normal file
664
project/Drivers/BSP/Components/lan8742/lan8742.c
Normal file
@@ -0,0 +1,664 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lan8742.c
|
||||
* @author MCD Application Team
|
||||
* @brief This file provides a set of functions needed to manage the LAN742
|
||||
* PHY devices.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include "lan8742.h"
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742 LAN8742
|
||||
* @{
|
||||
*/
|
||||
|
||||
/* Private typedef -----------------------------------------------------------*/
|
||||
/* Private define ------------------------------------------------------------*/
|
||||
/** @defgroup LAN8742_Private_Defines LAN8742 Private Defines
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_SW_RESET_TO ((uint32_t)500U)
|
||||
#define LAN8742_INIT_TO ((uint32_t)2000U)
|
||||
#define LAN8742_MAX_DEV_ADDR ((uint32_t)31U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Private macro -------------------------------------------------------------*/
|
||||
/* Private variables ---------------------------------------------------------*/
|
||||
/* Private function prototypes -----------------------------------------------*/
|
||||
/* Private functions ---------------------------------------------------------*/
|
||||
/** @defgroup LAN8742_Private_Functions LAN8742 Private Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief Register IO functions to component object
|
||||
* @param pObj: device object of LAN8742_Object_t.
|
||||
* @param ioctx: holds device IO functions.
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_ERROR if missing mandatory function
|
||||
*/
|
||||
int32_t LAN8742_RegisterBusIO(lan8742_Object_t *pObj, lan8742_IOCtx_t *ioctx)
|
||||
{
|
||||
if(!pObj || !ioctx->ReadReg || !ioctx->WriteReg || !ioctx->GetTick)
|
||||
{
|
||||
return LAN8742_STATUS_ERROR;
|
||||
}
|
||||
|
||||
pObj->IO.Init = ioctx->Init;
|
||||
pObj->IO.DeInit = ioctx->DeInit;
|
||||
pObj->IO.ReadReg = ioctx->ReadReg;
|
||||
pObj->IO.WriteReg = ioctx->WriteReg;
|
||||
pObj->IO.GetTick = ioctx->GetTick;
|
||||
|
||||
return LAN8742_STATUS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Initialize the lan8742 and configure the needed hardware resources
|
||||
* @param pObj: device object LAN8742_Object_t.
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_ADDRESS_ERROR if cannot find device address
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
* LAN8742_STATUS_RESET_TIMEOUT if cannot perform a software reset
|
||||
*/
|
||||
int32_t LAN8742_Init(lan8742_Object_t *pObj)
|
||||
{
|
||||
uint32_t tickstart = 0, regvalue = 0, addr = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->Is_Initialized == 0)
|
||||
{
|
||||
if(pObj->IO.Init != 0)
|
||||
{
|
||||
/* GPIO and Clocks initialization */
|
||||
pObj->IO.Init();
|
||||
}
|
||||
|
||||
/* for later check */
|
||||
pObj->DevAddr = LAN8742_MAX_DEV_ADDR + 1;
|
||||
|
||||
/* Get the device address from special mode register */
|
||||
for(addr = 0; addr <= LAN8742_MAX_DEV_ADDR; addr ++)
|
||||
{
|
||||
if(pObj->IO.ReadReg(addr, LAN8742_SMR, ®value) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
/* Can't read from this device address
|
||||
continue with next address */
|
||||
continue;
|
||||
}
|
||||
|
||||
if((regvalue & LAN8742_SMR_PHY_ADDR) == addr)
|
||||
{
|
||||
pObj->DevAddr = addr;
|
||||
status = LAN8742_STATUS_OK;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(pObj->DevAddr > LAN8742_MAX_DEV_ADDR)
|
||||
{
|
||||
status = LAN8742_STATUS_ADDRESS_ERROR;
|
||||
}
|
||||
|
||||
/* if device address is matched */
|
||||
if(status == LAN8742_STATUS_OK)
|
||||
{
|
||||
/* set a software reset */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_BCR, LAN8742_BCR_SOFT_RESET) >= 0)
|
||||
{
|
||||
/* get software reset status */
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, ®value) >= 0)
|
||||
{
|
||||
tickstart = pObj->IO.GetTick();
|
||||
|
||||
/* wait until software reset is done or timeout occured */
|
||||
while(regvalue & LAN8742_BCR_SOFT_RESET)
|
||||
{
|
||||
if((pObj->IO.GetTick() - tickstart) <= LAN8742_SW_RESET_TO)
|
||||
{
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, ®value) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_RESET_TIMEOUT;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(status == LAN8742_STATUS_OK)
|
||||
{
|
||||
tickstart = pObj->IO.GetTick();
|
||||
|
||||
/* Wait for 2s to perform initialization */
|
||||
while((pObj->IO.GetTick() - tickstart) <= LAN8742_INIT_TO)
|
||||
{
|
||||
}
|
||||
pObj->Is_Initialized = 1;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief De-Initialize the lan8742 and it's hardware resources
|
||||
* @param pObj: device object LAN8742_Object_t.
|
||||
* @retval None
|
||||
*/
|
||||
int32_t LAN8742_DeInit(lan8742_Object_t *pObj)
|
||||
{
|
||||
if(pObj->Is_Initialized)
|
||||
{
|
||||
if(pObj->IO.DeInit != 0)
|
||||
{
|
||||
if(pObj->IO.DeInit() < 0)
|
||||
{
|
||||
return LAN8742_STATUS_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
pObj->Is_Initialized = 0;
|
||||
}
|
||||
|
||||
return LAN8742_STATUS_OK;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable the LAN8742 power down mode.
|
||||
* @param pObj: device object LAN8742_Object_t.
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_DisablePowerDownMode(lan8742_Object_t *pObj)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, &readval) >= 0)
|
||||
{
|
||||
readval &= ~LAN8742_BCR_POWER_DOWN;
|
||||
|
||||
/* Apply configuration */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_BCR, readval) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable the LAN8742 power down mode.
|
||||
* @param pObj: device object LAN8742_Object_t.
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_EnablePowerDownMode(lan8742_Object_t *pObj)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, &readval) >= 0)
|
||||
{
|
||||
readval |= LAN8742_BCR_POWER_DOWN;
|
||||
|
||||
/* Apply configuration */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_BCR, readval) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Start the auto negotiation process.
|
||||
* @param pObj: device object LAN8742_Object_t.
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_StartAutoNego(lan8742_Object_t *pObj)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, &readval) >= 0)
|
||||
{
|
||||
readval |= LAN8742_BCR_AUTONEGO_EN;
|
||||
|
||||
/* Apply configuration */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_BCR, readval) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get the link state of LAN8742 device.
|
||||
* @param pObj: Pointer to device object.
|
||||
* @param pLinkState: Pointer to link state
|
||||
* @retval LAN8742_STATUS_LINK_DOWN if link is down
|
||||
* LAN8742_STATUS_AUTONEGO_NOTDONE if Auto nego not completed
|
||||
* LAN8742_STATUS_100MBITS_FULLDUPLEX if 100Mb/s FD
|
||||
* LAN8742_STATUS_100MBITS_HALFDUPLEX if 100Mb/s HD
|
||||
* LAN8742_STATUS_10MBITS_FULLDUPLEX if 10Mb/s FD
|
||||
* LAN8742_STATUS_10MBITS_HALFDUPLEX if 10Mb/s HD
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_GetLinkState(lan8742_Object_t *pObj)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
|
||||
/* Read Status register */
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BSR, &readval) < 0)
|
||||
{
|
||||
return LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
/* Read Status register again */
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BSR, &readval) < 0)
|
||||
{
|
||||
return LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
if((readval & LAN8742_BSR_LINK_STATUS) == 0)
|
||||
{
|
||||
/* Return Link Down status */
|
||||
return LAN8742_STATUS_LINK_DOWN;
|
||||
}
|
||||
|
||||
/* Check Auto negotiaition */
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, &readval) < 0)
|
||||
{
|
||||
return LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
if((readval & LAN8742_BCR_AUTONEGO_EN) != LAN8742_BCR_AUTONEGO_EN)
|
||||
{
|
||||
if(((readval & LAN8742_BCR_SPEED_SELECT) == LAN8742_BCR_SPEED_SELECT) && ((readval & LAN8742_BCR_DUPLEX_MODE) == LAN8742_BCR_DUPLEX_MODE))
|
||||
{
|
||||
return LAN8742_STATUS_100MBITS_FULLDUPLEX;
|
||||
}
|
||||
else if ((readval & LAN8742_BCR_SPEED_SELECT) == LAN8742_BCR_SPEED_SELECT)
|
||||
{
|
||||
return LAN8742_STATUS_100MBITS_HALFDUPLEX;
|
||||
}
|
||||
else if ((readval & LAN8742_BCR_DUPLEX_MODE) == LAN8742_BCR_DUPLEX_MODE)
|
||||
{
|
||||
return LAN8742_STATUS_10MBITS_FULLDUPLEX;
|
||||
}
|
||||
else
|
||||
{
|
||||
return LAN8742_STATUS_10MBITS_HALFDUPLEX;
|
||||
}
|
||||
}
|
||||
else /* Auto Nego enabled */
|
||||
{
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_PHYSCSR, &readval) < 0)
|
||||
{
|
||||
return LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
/* Check if auto nego not done */
|
||||
if((readval & LAN8742_PHYSCSR_AUTONEGO_DONE) == 0)
|
||||
{
|
||||
return LAN8742_STATUS_AUTONEGO_NOTDONE;
|
||||
}
|
||||
|
||||
if((readval & LAN8742_PHYSCSR_HCDSPEEDMASK) == LAN8742_PHYSCSR_100BTX_FD)
|
||||
{
|
||||
return LAN8742_STATUS_100MBITS_FULLDUPLEX;
|
||||
}
|
||||
else if ((readval & LAN8742_PHYSCSR_HCDSPEEDMASK) == LAN8742_PHYSCSR_100BTX_HD)
|
||||
{
|
||||
return LAN8742_STATUS_100MBITS_HALFDUPLEX;
|
||||
}
|
||||
else if ((readval & LAN8742_PHYSCSR_HCDSPEEDMASK) == LAN8742_PHYSCSR_10BT_FD)
|
||||
{
|
||||
return LAN8742_STATUS_10MBITS_FULLDUPLEX;
|
||||
}
|
||||
else
|
||||
{
|
||||
return LAN8742_STATUS_10MBITS_HALFDUPLEX;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set the link state of LAN8742 device.
|
||||
* @param pObj: Pointer to device object.
|
||||
* @param pLinkState: link state can be one of the following
|
||||
* LAN8742_STATUS_100MBITS_FULLDUPLEX if 100Mb/s FD
|
||||
* LAN8742_STATUS_100MBITS_HALFDUPLEX if 100Mb/s HD
|
||||
* LAN8742_STATUS_10MBITS_FULLDUPLEX if 10Mb/s FD
|
||||
* LAN8742_STATUS_10MBITS_HALFDUPLEX if 10Mb/s HD
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_ERROR if parameter error
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_SetLinkState(lan8742_Object_t *pObj, uint32_t LinkState)
|
||||
{
|
||||
uint32_t bcrvalue = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, &bcrvalue) >= 0)
|
||||
{
|
||||
/* Disable link config (Auto nego, speed and duplex) */
|
||||
bcrvalue &= ~(LAN8742_BCR_AUTONEGO_EN | LAN8742_BCR_SPEED_SELECT | LAN8742_BCR_DUPLEX_MODE);
|
||||
|
||||
if(LinkState == LAN8742_STATUS_100MBITS_FULLDUPLEX)
|
||||
{
|
||||
bcrvalue |= (LAN8742_BCR_SPEED_SELECT | LAN8742_BCR_DUPLEX_MODE);
|
||||
}
|
||||
else if (LinkState == LAN8742_STATUS_100MBITS_HALFDUPLEX)
|
||||
{
|
||||
bcrvalue |= LAN8742_BCR_SPEED_SELECT;
|
||||
}
|
||||
else if (LinkState == LAN8742_STATUS_10MBITS_FULLDUPLEX)
|
||||
{
|
||||
bcrvalue |= LAN8742_BCR_DUPLEX_MODE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Wrong link status parameter */
|
||||
status = LAN8742_STATUS_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
if(status == LAN8742_STATUS_OK)
|
||||
{
|
||||
/* Apply configuration */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_BCR, bcrvalue) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable loopback mode.
|
||||
* @param pObj: Pointer to device object.
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_EnableLoopbackMode(lan8742_Object_t *pObj)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, &readval) >= 0)
|
||||
{
|
||||
readval |= LAN8742_BCR_LOOPBACK;
|
||||
|
||||
/* Apply configuration */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_BCR, readval) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable loopback mode.
|
||||
* @param pObj: Pointer to device object.
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_DisableLoopbackMode(lan8742_Object_t *pObj)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_BCR, &readval) >= 0)
|
||||
{
|
||||
readval &= ~LAN8742_BCR_LOOPBACK;
|
||||
|
||||
/* Apply configuration */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_BCR, readval) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Enable IT source.
|
||||
* @param pObj: Pointer to device object.
|
||||
* @param Interrupt: IT source to be enabled
|
||||
* should be a value or a combination of the following:
|
||||
* LAN8742_WOL_IT
|
||||
* LAN8742_ENERGYON_IT
|
||||
* LAN8742_AUTONEGO_COMPLETE_IT
|
||||
* LAN8742_REMOTE_FAULT_IT
|
||||
* LAN8742_LINK_DOWN_IT
|
||||
* LAN8742_AUTONEGO_LP_ACK_IT
|
||||
* LAN8742_PARALLEL_DETECTION_FAULT_IT
|
||||
* LAN8742_AUTONEGO_PAGE_RECEIVED_IT
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_EnableIT(lan8742_Object_t *pObj, uint32_t Interrupt)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_IMR, &readval) >= 0)
|
||||
{
|
||||
readval |= Interrupt;
|
||||
|
||||
/* Apply configuration */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_IMR, readval) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Disable IT source.
|
||||
* @param pObj: Pointer to device object.
|
||||
* @param Interrupt: IT source to be disabled
|
||||
* should be a value or a combination of the following:
|
||||
* LAN8742_WOL_IT
|
||||
* LAN8742_ENERGYON_IT
|
||||
* LAN8742_AUTONEGO_COMPLETE_IT
|
||||
* LAN8742_REMOTE_FAULT_IT
|
||||
* LAN8742_LINK_DOWN_IT
|
||||
* LAN8742_AUTONEGO_LP_ACK_IT
|
||||
* LAN8742_PARALLEL_DETECTION_FAULT_IT
|
||||
* LAN8742_AUTONEGO_PAGE_RECEIVED_IT
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
* LAN8742_STATUS_WRITE_ERROR if connot write to register
|
||||
*/
|
||||
int32_t LAN8742_DisableIT(lan8742_Object_t *pObj, uint32_t Interrupt)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_IMR, &readval) >= 0)
|
||||
{
|
||||
readval &= ~Interrupt;
|
||||
|
||||
/* Apply configuration */
|
||||
if(pObj->IO.WriteReg(pObj->DevAddr, LAN8742_IMR, readval) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_WRITE_ERROR;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Clear IT flag.
|
||||
* @param pObj: Pointer to device object.
|
||||
* @param Interrupt: IT flag to be cleared
|
||||
* should be a value or a combination of the following:
|
||||
* LAN8742_WOL_IT
|
||||
* LAN8742_ENERGYON_IT
|
||||
* LAN8742_AUTONEGO_COMPLETE_IT
|
||||
* LAN8742_REMOTE_FAULT_IT
|
||||
* LAN8742_LINK_DOWN_IT
|
||||
* LAN8742_AUTONEGO_LP_ACK_IT
|
||||
* LAN8742_PARALLEL_DETECTION_FAULT_IT
|
||||
* LAN8742_AUTONEGO_PAGE_RECEIVED_IT
|
||||
* @retval LAN8742_STATUS_OK if OK
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
*/
|
||||
int32_t LAN8742_ClearIT(lan8742_Object_t *pObj, uint32_t Interrupt)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = LAN8742_STATUS_OK;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_ISFR, &readval) < 0)
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Get IT Flag status.
|
||||
* @param pObj: Pointer to device object.
|
||||
* @param Interrupt: IT Flag to be checked,
|
||||
* should be a value or a combination of the following:
|
||||
* LAN8742_WOL_IT
|
||||
* LAN8742_ENERGYON_IT
|
||||
* LAN8742_AUTONEGO_COMPLETE_IT
|
||||
* LAN8742_REMOTE_FAULT_IT
|
||||
* LAN8742_LINK_DOWN_IT
|
||||
* LAN8742_AUTONEGO_LP_ACK_IT
|
||||
* LAN8742_PARALLEL_DETECTION_FAULT_IT
|
||||
* LAN8742_AUTONEGO_PAGE_RECEIVED_IT
|
||||
* @retval 1 IT flag is SET
|
||||
* 0 IT flag is RESET
|
||||
* LAN8742_STATUS_READ_ERROR if connot read register
|
||||
*/
|
||||
int32_t LAN8742_GetITStatus(lan8742_Object_t *pObj, uint32_t Interrupt)
|
||||
{
|
||||
uint32_t readval = 0;
|
||||
int32_t status = 0;
|
||||
|
||||
if(pObj->IO.ReadReg(pObj->DevAddr, LAN8742_ISFR, &readval) >= 0)
|
||||
{
|
||||
status = ((readval & Interrupt) == Interrupt);
|
||||
}
|
||||
else
|
||||
{
|
||||
status = LAN8742_STATUS_READ_ERROR;
|
||||
}
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
448
project/Drivers/BSP/Components/lan8742/lan8742.h
Normal file
448
project/Drivers/BSP/Components/lan8742/lan8742.h
Normal file
@@ -0,0 +1,448 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file lan8742.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the functions prototypes for the
|
||||
* lan8742.c PHY driver.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© Copyright (c) 2017 STMicroelectronics.
|
||||
* All rights reserved.</center></h2>
|
||||
*
|
||||
* This software component is licensed by ST under BSD 3-Clause license,
|
||||
* the "License"; You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at:
|
||||
* opensource.org/licenses/BSD-3-Clause
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef LAN8742_H
|
||||
#define LAN8742_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
#include <stdint.h>
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Component
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742
|
||||
* @{
|
||||
*/
|
||||
/* Exported constants --------------------------------------------------------*/
|
||||
/** @defgroup LAN8742_Exported_Constants LAN8742 Exported Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_Registers_Mapping LAN8742 Registers Mapping
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_BCR ((uint16_t)0x0000U)
|
||||
#define LAN8742_BSR ((uint16_t)0x0001U)
|
||||
#define LAN8742_PHYI1R ((uint16_t)0x0002U)
|
||||
#define LAN8742_PHYI2R ((uint16_t)0x0003U)
|
||||
#define LAN8742_ANAR ((uint16_t)0x0004U)
|
||||
#define LAN8742_ANLPAR ((uint16_t)0x0005U)
|
||||
#define LAN8742_ANER ((uint16_t)0x0006U)
|
||||
#define LAN8742_ANNPTR ((uint16_t)0x0007U)
|
||||
#define LAN8742_ANNPRR ((uint16_t)0x0008U)
|
||||
#define LAN8742_MMDACR ((uint16_t)0x000DU)
|
||||
#define LAN8742_MMDAADR ((uint16_t)0x000EU)
|
||||
#define LAN8742_ENCTR ((uint16_t)0x0010U)
|
||||
#define LAN8742_MCSR ((uint16_t)0x0011U)
|
||||
#define LAN8742_SMR ((uint16_t)0x0012U)
|
||||
#define LAN8742_TPDCR ((uint16_t)0x0018U)
|
||||
#define LAN8742_TCSR ((uint16_t)0x0019U)
|
||||
#define LAN8742_SECR ((uint16_t)0x001AU)
|
||||
#define LAN8742_SCSIR ((uint16_t)0x001BU)
|
||||
#define LAN8742_CLR ((uint16_t)0x001CU)
|
||||
#define LAN8742_ISFR ((uint16_t)0x001DU)
|
||||
#define LAN8742_IMR ((uint16_t)0x001EU)
|
||||
#define LAN8742_PHYSCSR ((uint16_t)0x001FU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_BCR_Bit_Definition LAN8742 BCR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_BCR_SOFT_RESET ((uint16_t)0x8000U)
|
||||
#define LAN8742_BCR_LOOPBACK ((uint16_t)0x4000U)
|
||||
#define LAN8742_BCR_SPEED_SELECT ((uint16_t)0x2000U)
|
||||
#define LAN8742_BCR_AUTONEGO_EN ((uint16_t)0x1000U)
|
||||
#define LAN8742_BCR_POWER_DOWN ((uint16_t)0x0800U)
|
||||
#define LAN8742_BCR_ISOLATE ((uint16_t)0x0400U)
|
||||
#define LAN8742_BCR_RESTART_AUTONEGO ((uint16_t)0x0200U)
|
||||
#define LAN8742_BCR_DUPLEX_MODE ((uint16_t)0x0100U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_BSR_Bit_Definition LAN8742 BSR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_BSR_100BASE_T4 ((uint16_t)0x8000U)
|
||||
#define LAN8742_BSR_100BASE_TX_FD ((uint16_t)0x4000U)
|
||||
#define LAN8742_BSR_100BASE_TX_HD ((uint16_t)0x2000U)
|
||||
#define LAN8742_BSR_10BASE_T_FD ((uint16_t)0x1000U)
|
||||
#define LAN8742_BSR_10BASE_T_HD ((uint16_t)0x0800U)
|
||||
#define LAN8742_BSR_100BASE_T2_FD ((uint16_t)0x0400U)
|
||||
#define LAN8742_BSR_100BASE_T2_HD ((uint16_t)0x0200U)
|
||||
#define LAN8742_BSR_EXTENDED_STATUS ((uint16_t)0x0100U)
|
||||
#define LAN8742_BSR_AUTONEGO_CPLT ((uint16_t)0x0020U)
|
||||
#define LAN8742_BSR_REMOTE_FAULT ((uint16_t)0x0010U)
|
||||
#define LAN8742_BSR_AUTONEGO_ABILITY ((uint16_t)0x0008U)
|
||||
#define LAN8742_BSR_LINK_STATUS ((uint16_t)0x0004U)
|
||||
#define LAN8742_BSR_JABBER_DETECT ((uint16_t)0x0002U)
|
||||
#define LAN8742_BSR_EXTENDED_CAP ((uint16_t)0x0001U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_PHYI1R_Bit_Definition LAN8742 PHYI1R Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_PHYI1R_OUI_3_18 ((uint16_t)0xFFFFU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_PHYI2R_Bit_Definition LAN8742 PHYI2R Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_PHYI2R_OUI_19_24 ((uint16_t)0xFC00U)
|
||||
#define LAN8742_PHYI2R_MODEL_NBR ((uint16_t)0x03F0U)
|
||||
#define LAN8742_PHYI2R_REVISION_NBR ((uint16_t)0x000FU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_ANAR_Bit_Definition LAN8742 ANAR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_ANAR_NEXT_PAGE ((uint16_t)0x8000U)
|
||||
#define LAN8742_ANAR_REMOTE_FAULT ((uint16_t)0x2000U)
|
||||
#define LAN8742_ANAR_PAUSE_OPERATION ((uint16_t)0x0C00U)
|
||||
#define LAN8742_ANAR_PO_NOPAUSE ((uint16_t)0x0000U)
|
||||
#define LAN8742_ANAR_PO_SYMMETRIC_PAUSE ((uint16_t)0x0400U)
|
||||
#define LAN8742_ANAR_PO_ASYMMETRIC_PAUSE ((uint16_t)0x0800U)
|
||||
#define LAN8742_ANAR_PO_ADVERTISE_SUPPORT ((uint16_t)0x0C00U)
|
||||
#define LAN8742_ANAR_100BASE_TX_FD ((uint16_t)0x0100U)
|
||||
#define LAN8742_ANAR_100BASE_TX ((uint16_t)0x0080U)
|
||||
#define LAN8742_ANAR_10BASE_T_FD ((uint16_t)0x0040U)
|
||||
#define LAN8742_ANAR_10BASE_T ((uint16_t)0x0020U)
|
||||
#define LAN8742_ANAR_SELECTOR_FIELD ((uint16_t)0x000FU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_ANLPAR_Bit_Definition LAN8742 ANLPAR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_ANLPAR_NEXT_PAGE ((uint16_t)0x8000U)
|
||||
#define LAN8742_ANLPAR_REMOTE_FAULT ((uint16_t)0x2000U)
|
||||
#define LAN8742_ANLPAR_PAUSE_OPERATION ((uint16_t)0x0C00U)
|
||||
#define LAN8742_ANLPAR_PO_NOPAUSE ((uint16_t)0x0000U)
|
||||
#define LAN8742_ANLPAR_PO_SYMMETRIC_PAUSE ((uint16_t)0x0400U)
|
||||
#define LAN8742_ANLPAR_PO_ASYMMETRIC_PAUSE ((uint16_t)0x0800U)
|
||||
#define LAN8742_ANLPAR_PO_ADVERTISE_SUPPORT ((uint16_t)0x0C00U)
|
||||
#define LAN8742_ANLPAR_100BASE_TX_FD ((uint16_t)0x0100U)
|
||||
#define LAN8742_ANLPAR_100BASE_TX ((uint16_t)0x0080U)
|
||||
#define LAN8742_ANLPAR_10BASE_T_FD ((uint16_t)0x0040U)
|
||||
#define LAN8742_ANLPAR_10BASE_T ((uint16_t)0x0020U)
|
||||
#define LAN8742_ANLPAR_SELECTOR_FIELD ((uint16_t)0x000FU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_ANER_Bit_Definition LAN8742 ANER Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_ANER_RX_NP_LOCATION_ABLE ((uint16_t)0x0040U)
|
||||
#define LAN8742_ANER_RX_NP_STORAGE_LOCATION ((uint16_t)0x0020U)
|
||||
#define LAN8742_ANER_PARALLEL_DETECT_FAULT ((uint16_t)0x0010U)
|
||||
#define LAN8742_ANER_LP_NP_ABLE ((uint16_t)0x0008U)
|
||||
#define LAN8742_ANER_NP_ABLE ((uint16_t)0x0004U)
|
||||
#define LAN8742_ANER_PAGE_RECEIVED ((uint16_t)0x0002U)
|
||||
#define LAN8742_ANER_LP_AUTONEG_ABLE ((uint16_t)0x0001U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_ANNPTR_Bit_Definition LAN8742 ANNPTR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_ANNPTR_NEXT_PAGE ((uint16_t)0x8000U)
|
||||
#define LAN8742_ANNPTR_MESSAGE_PAGE ((uint16_t)0x2000U)
|
||||
#define LAN8742_ANNPTR_ACK2 ((uint16_t)0x1000U)
|
||||
#define LAN8742_ANNPTR_TOGGLE ((uint16_t)0x0800U)
|
||||
#define LAN8742_ANNPTR_MESSAGGE_CODE ((uint16_t)0x07FFU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_ANNPRR_Bit_Definition LAN8742 ANNPRR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_ANNPTR_NEXT_PAGE ((uint16_t)0x8000U)
|
||||
#define LAN8742_ANNPRR_ACK ((uint16_t)0x4000U)
|
||||
#define LAN8742_ANNPRR_MESSAGE_PAGE ((uint16_t)0x2000U)
|
||||
#define LAN8742_ANNPRR_ACK2 ((uint16_t)0x1000U)
|
||||
#define LAN8742_ANNPRR_TOGGLE ((uint16_t)0x0800U)
|
||||
#define LAN8742_ANNPRR_MESSAGGE_CODE ((uint16_t)0x07FFU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_MMDACR_Bit_Definition LAN8742 MMDACR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_MMDACR_MMD_FUNCTION ((uint16_t)0xC000U)
|
||||
#define LAN8742_MMDACR_MMD_FUNCTION_ADDR ((uint16_t)0x0000U)
|
||||
#define LAN8742_MMDACR_MMD_FUNCTION_DATA ((uint16_t)0x4000U)
|
||||
#define LAN8742_MMDACR_MMD_DEV_ADDR ((uint16_t)0x001FU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_ENCTR_Bit_Definition LAN8742 ENCTR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_ENCTR_TX_ENABLE ((uint16_t)0x8000U)
|
||||
#define LAN8742_ENCTR_TX_TIMER ((uint16_t)0x6000U)
|
||||
#define LAN8742_ENCTR_TX_TIMER_1S ((uint16_t)0x0000U)
|
||||
#define LAN8742_ENCTR_TX_TIMER_768MS ((uint16_t)0x2000U)
|
||||
#define LAN8742_ENCTR_TX_TIMER_512MS ((uint16_t)0x4000U)
|
||||
#define LAN8742_ENCTR_TX_TIMER_265MS ((uint16_t)0x6000U)
|
||||
#define LAN8742_ENCTR_RX_ENABLE ((uint16_t)0x1000U)
|
||||
#define LAN8742_ENCTR_RX_MAX_INTERVAL ((uint16_t)0x0C00U)
|
||||
#define LAN8742_ENCTR_RX_MAX_INTERVAL_64MS ((uint16_t)0x0000U)
|
||||
#define LAN8742_ENCTR_RX_MAX_INTERVAL_256MS ((uint16_t)0x0400U)
|
||||
#define LAN8742_ENCTR_RX_MAX_INTERVAL_512MS ((uint16_t)0x0800U)
|
||||
#define LAN8742_ENCTR_RX_MAX_INTERVAL_1S ((uint16_t)0x0C00U)
|
||||
#define LAN8742_ENCTR_EX_CROSS_OVER ((uint16_t)0x0002U)
|
||||
#define LAN8742_ENCTR_EX_MANUAL_CROSS_OVER ((uint16_t)0x0001U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_MCSR_Bit_Definition LAN8742 MCSR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_MCSR_EDPWRDOWN ((uint16_t)0x2000U)
|
||||
#define LAN8742_MCSR_FARLOOPBACK ((uint16_t)0x0200U)
|
||||
#define LAN8742_MCSR_ALTINT ((uint16_t)0x0040U)
|
||||
#define LAN8742_MCSR_ENERGYON ((uint16_t)0x0002U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_SMR_Bit_Definition LAN8742 SMR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_SMR_MODE ((uint16_t)0x00E0U)
|
||||
#define LAN8742_SMR_PHY_ADDR ((uint16_t)0x001FU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_TPDCR_Bit_Definition LAN8742 TPDCR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_TPDCR_DELAY_IN ((uint16_t)0x8000U)
|
||||
#define LAN8742_TPDCR_LINE_BREAK_COUNTER ((uint16_t)0x7000U)
|
||||
#define LAN8742_TPDCR_PATTERN_HIGH ((uint16_t)0x0FC0U)
|
||||
#define LAN8742_TPDCR_PATTERN_LOW ((uint16_t)0x003FU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_TCSR_Bit_Definition LAN8742 TCSR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_TCSR_TDR_ENABLE ((uint16_t)0x8000U)
|
||||
#define LAN8742_TCSR_TDR_AD_FILTER_ENABLE ((uint16_t)0x4000U)
|
||||
#define LAN8742_TCSR_TDR_CH_CABLE_TYPE ((uint16_t)0x0600U)
|
||||
#define LAN8742_TCSR_TDR_CH_CABLE_DEFAULT ((uint16_t)0x0000U)
|
||||
#define LAN8742_TCSR_TDR_CH_CABLE_SHORTED ((uint16_t)0x0200U)
|
||||
#define LAN8742_TCSR_TDR_CH_CABLE_OPEN ((uint16_t)0x0400U)
|
||||
#define LAN8742_TCSR_TDR_CH_CABLE_MATCH ((uint16_t)0x0600U)
|
||||
#define LAN8742_TCSR_TDR_CH_STATUS ((uint16_t)0x0100U)
|
||||
#define LAN8742_TCSR_TDR_CH_LENGTH ((uint16_t)0x00FFU)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_SCSIR_Bit_Definition LAN8742 SCSIR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_SCSIR_AUTO_MDIX_ENABLE ((uint16_t)0x8000U)
|
||||
#define LAN8742_SCSIR_CHANNEL_SELECT ((uint16_t)0x2000U)
|
||||
#define LAN8742_SCSIR_SQE_DISABLE ((uint16_t)0x0800U)
|
||||
#define LAN8742_SCSIR_XPOLALITY ((uint16_t)0x0010U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_CLR_Bit_Definition LAN8742 CLR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_CLR_CABLE_LENGTH ((uint16_t)0xF000U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_IMR_ISFR_Bit_Definition LAN8742 IMR ISFR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_INT_8 ((uint16_t)0x0100U)
|
||||
#define LAN8742_INT_7 ((uint16_t)0x0080U)
|
||||
#define LAN8742_INT_6 ((uint16_t)0x0040U)
|
||||
#define LAN8742_INT_5 ((uint16_t)0x0020U)
|
||||
#define LAN8742_INT_4 ((uint16_t)0x0010U)
|
||||
#define LAN8742_INT_3 ((uint16_t)0x0008U)
|
||||
#define LAN8742_INT_2 ((uint16_t)0x0004U)
|
||||
#define LAN8742_INT_1 ((uint16_t)0x0002U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_PHYSCSR_Bit_Definition LAN8742 PHYSCSR Bit Definition
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_PHYSCSR_AUTONEGO_DONE ((uint16_t)0x1000U)
|
||||
#define LAN8742_PHYSCSR_HCDSPEEDMASK ((uint16_t)0x001CU)
|
||||
#define LAN8742_PHYSCSR_10BT_HD ((uint16_t)0x0004U)
|
||||
#define LAN8742_PHYSCSR_10BT_FD ((uint16_t)0x0014U)
|
||||
#define LAN8742_PHYSCSR_100BTX_HD ((uint16_t)0x0008U)
|
||||
#define LAN8742_PHYSCSR_100BTX_FD ((uint16_t)0x0018U)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_Status LAN8742 Status
|
||||
* @{
|
||||
*/
|
||||
|
||||
#define LAN8742_STATUS_READ_ERROR ((int32_t)-5)
|
||||
#define LAN8742_STATUS_WRITE_ERROR ((int32_t)-4)
|
||||
#define LAN8742_STATUS_ADDRESS_ERROR ((int32_t)-3)
|
||||
#define LAN8742_STATUS_RESET_TIMEOUT ((int32_t)-2)
|
||||
#define LAN8742_STATUS_ERROR ((int32_t)-1)
|
||||
#define LAN8742_STATUS_OK ((int32_t) 0)
|
||||
#define LAN8742_STATUS_LINK_DOWN ((int32_t) 1)
|
||||
#define LAN8742_STATUS_100MBITS_FULLDUPLEX ((int32_t) 2)
|
||||
#define LAN8742_STATUS_100MBITS_HALFDUPLEX ((int32_t) 3)
|
||||
#define LAN8742_STATUS_10MBITS_FULLDUPLEX ((int32_t) 4)
|
||||
#define LAN8742_STATUS_10MBITS_HALFDUPLEX ((int32_t) 5)
|
||||
#define LAN8742_STATUS_AUTONEGO_NOTDONE ((int32_t) 6)
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup LAN8742_IT_Flags LAN8742 IT Flags
|
||||
* @{
|
||||
*/
|
||||
#define LAN8742_WOL_IT LAN8742_INT_8
|
||||
#define LAN8742_ENERGYON_IT LAN8742_INT_7
|
||||
#define LAN8742_AUTONEGO_COMPLETE_IT LAN8742_INT_6
|
||||
#define LAN8742_REMOTE_FAULT_IT LAN8742_INT_5
|
||||
#define LAN8742_LINK_DOWN_IT LAN8742_INT_4
|
||||
#define LAN8742_AUTONEGO_LP_ACK_IT LAN8742_INT_3
|
||||
#define LAN8742_PARALLEL_DETECTION_FAULT_IT LAN8742_INT_2
|
||||
#define LAN8742_AUTONEGO_PAGE_RECEIVED_IT LAN8742_INT_1
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported types ------------------------------------------------------------*/
|
||||
/** @defgroup LAN8742_Exported_Types LAN8742 Exported Types
|
||||
* @{
|
||||
*/
|
||||
typedef int32_t (*lan8742_Init_Func) (void);
|
||||
typedef int32_t (*lan8742_DeInit_Func) (void);
|
||||
typedef int32_t (*lan8742_ReadReg_Func) (uint32_t, uint32_t, uint32_t *);
|
||||
typedef int32_t (*lan8742_WriteReg_Func) (uint32_t, uint32_t, uint32_t);
|
||||
typedef int32_t (*lan8742_GetTick_Func) (void);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
lan8742_Init_Func Init;
|
||||
lan8742_DeInit_Func DeInit;
|
||||
lan8742_WriteReg_Func WriteReg;
|
||||
lan8742_ReadReg_Func ReadReg;
|
||||
lan8742_GetTick_Func GetTick;
|
||||
} lan8742_IOCtx_t;
|
||||
|
||||
|
||||
typedef struct
|
||||
{
|
||||
uint32_t DevAddr;
|
||||
uint32_t Is_Initialized;
|
||||
lan8742_IOCtx_t IO;
|
||||
void *pData;
|
||||
}lan8742_Object_t;
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/* Exported macro ------------------------------------------------------------*/
|
||||
/* Exported functions --------------------------------------------------------*/
|
||||
/** @defgroup LAN8742_Exported_Functions LAN8742 Exported Functions
|
||||
* @{
|
||||
*/
|
||||
int32_t LAN8742_RegisterBusIO(lan8742_Object_t *pObj, lan8742_IOCtx_t *ioctx);
|
||||
int32_t LAN8742_Init(lan8742_Object_t *pObj);
|
||||
int32_t LAN8742_DeInit(lan8742_Object_t *pObj);
|
||||
int32_t LAN8742_DisablePowerDownMode(lan8742_Object_t *pObj);
|
||||
int32_t LAN8742_EnablePowerDownMode(lan8742_Object_t *pObj);
|
||||
int32_t LAN8742_StartAutoNego(lan8742_Object_t *pObj);
|
||||
int32_t LAN8742_GetLinkState(lan8742_Object_t *pObj);
|
||||
int32_t LAN8742_SetLinkState(lan8742_Object_t *pObj, uint32_t LinkState);
|
||||
int32_t LAN8742_EnableLoopbackMode(lan8742_Object_t *pObj);
|
||||
int32_t LAN8742_DisableLoopbackMode(lan8742_Object_t *pObj);
|
||||
int32_t LAN8742_EnableIT(lan8742_Object_t *pObj, uint32_t Interrupt);
|
||||
int32_t LAN8742_DisableIT(lan8742_Object_t *pObj, uint32_t Interrupt);
|
||||
int32_t LAN8742_ClearIT(lan8742_Object_t *pObj, uint32_t Interrupt);
|
||||
int32_t LAN8742_GetITStatus(lan8742_Object_t *pObj, uint32_t Interrupt);
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /* LAN8742_H */
|
||||
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
246
project/Drivers/BSP/Components/rk043fn48h/Release_Notes.html
Normal file
246
project/Drivers/BSP/Components/rk043fn48h/Release_Notes.html
Normal file
@@ -0,0 +1,246 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40"><head>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
||||
|
||||
|
||||
<link rel="File-List" href="Library_files/filelist.xml">
|
||||
|
||||
|
||||
<link rel="Edit-Time-Data" href="Library_files/editdata.mso"><!--[if !mso]> <style> v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} </style> <![endif]--><title>Release Notes for RK043FN48H-CT672B LCD Component Driver</title><!--[if gte mso 9]><xml> <o:DocumentProperties> <o:Author>STMicroelectronics</o:Author> <o:LastAuthor>STMicroelectronics</o:LastAuthor> <o:Revision>37</o:Revision> <o:TotalTime>136</o:TotalTime> <o:Created>2009-02-27T19:26:00Z</o:Created> <o:LastSaved>2009-03-01T17:56:00Z</o:LastSaved> <o:Pages>1</o:Pages> <o:Words>522</o:Words> <o:Characters>2977</o:Characters> <o:Company>STMicroelectronics</o:Company> <o:Lines>24</o:Lines> <o:Paragraphs>6</o:Paragraphs> <o:CharactersWithSpaces>3493</o:CharactersWithSpaces> <o:Version>11.6568</o:Version> </o:DocumentProperties> </xml><![endif]--><!--[if gte mso 9]><xml> <w:WordDocument> <w:Zoom>110</w:Zoom> <w:ValidateAgainstSchemas/> <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid> <w:IgnoreMixedContent>false</w:IgnoreMixedContent> <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText> <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]--><!--[if gte mso 9]><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]-->
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
<!--
|
||||
/* Style Definitions */
|
||||
p.MsoNormal, li.MsoNormal, div.MsoNormal
|
||||
{mso-style-parent:"";
|
||||
margin:0in;
|
||||
margin-bottom:.0001pt;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
h2
|
||||
{mso-style-next:Normal;
|
||||
margin-top:12.0pt;
|
||||
margin-right:0in;
|
||||
margin-bottom:3.0pt;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
page-break-after:avoid;
|
||||
mso-outline-level:2;
|
||||
font-size:14.0pt;
|
||||
font-family:Arial;
|
||||
font-weight:bold;
|
||||
font-style:italic;}
|
||||
a:link, span.MsoHyperlink
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
a:visited, span.MsoHyperlinkFollowed
|
||||
{color:blue;
|
||||
text-decoration:underline;
|
||||
text-underline:single;}
|
||||
p
|
||||
{mso-margin-top-alt:auto;
|
||||
margin-right:0in;
|
||||
mso-margin-bottom-alt:auto;
|
||||
margin-left:0in;
|
||||
mso-pagination:widow-orphan;
|
||||
font-size:12.0pt;
|
||||
font-family:"Times New Roman";
|
||||
mso-fareast-font-family:"Times New Roman";}
|
||||
@page Section1
|
||||
{size:8.5in 11.0in;
|
||||
margin:1.0in 1.25in 1.0in 1.25in;
|
||||
mso-header-margin:.5in;
|
||||
mso-footer-margin:.5in;
|
||||
mso-paper-source:0;}
|
||||
div.Section1
|
||||
{page:Section1;}
|
||||
-->
|
||||
</style><!--[if gte mso 10]> <style> /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:""; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:"Times New Roman"; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} </style> <![endif]--><!--[if gte mso 9]><xml> <o:shapedefaults v:ext="edit" spidmax="5122"/> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext="edit"> <o:idmap v:ext="edit" data="1"/> </o:shapelayout></xml><![endif]-->
|
||||
<meta content="MCD Application Team" name="author"></head>
|
||||
<body link="blue" vlink="blue">
|
||||
<div class="Section1">
|
||||
<p class="MsoNormal"><span style="font-family: Arial;"><o:p><br>
|
||||
</o:p></span></p>
|
||||
<div align="center">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" cellspacing="0" width="900">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top;">
|
||||
<p class="MsoNormal"><span style="font-size: 8pt; font-family: Arial; color: blue;"><a href="../../../../Release_Notes.html">Back to Release page</a><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr style="">
|
||||
<td style="padding: 1.5pt;">
|
||||
<h1 style="margin-bottom: 18pt; text-align: center;" align="center"><span style="font-size: 20pt; font-family: Verdana; color: rgb(51, 102, 255);">Release
|
||||
Notes for RK043FN48H-CT672B LCD Component Driver</span><span style="font-size: 20pt; font-family: Verdana;"><o:p></o:p></span></h1>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;">Copyright
|
||||
2015 STMicroelectronics</span><span style="color: black;"><u1:p></u1:p><o:p></o:p></span></p>
|
||||
<p class="MsoNormal" style="text-align: center;" align="center"><span style="font-size: 10pt; font-family: Arial; color: black;"><img alt="" id="_x0000_i1025" src="../../../../_htmresc/st_logo.png" style="border: 0px solid ; width: 86px; height: 65px;"></span><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-family: Arial; display: none;"><o:p> </o:p></span></p>
|
||||
<table class="MsoNormalTable" style="width: 675pt;" border="0" cellpadding="0" width="900">
|
||||
<tbody>
|
||||
<tr style="">
|
||||
<td style="padding: 0cm;" valign="top">
|
||||
<span style="font-family: "Times New Roman";">
|
||||
</span>
|
||||
<h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="History"></a><span style="font-size: 12pt; color: white;">Update History</span></h2><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.1
|
||||
/ 02-June-2017 <o:p></o:p></span></h3>
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
<ul style="list-style-type: square;"><li><span style="font-size: 10pt; font-family: Verdana;">Update comments to be used for PDSC generation</span></li></ul><h3 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; margin-right: 500pt; width: 180px;"><span style="font-size: 10pt; font-family: Arial; color: white;">V1.0.0 / 25-June-2015 <o:p></o:p></span></h3>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt;"><b style=""><u><span style="font-size: 10pt; font-family: Verdana; color: black;">Main
|
||||
Changes<o:p></o:p></span></u></b></p>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;"></span><span style="font-size: 10pt; font-family: Verdana;"></span>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<ul style="list-style-type: square;">
|
||||
<li>
|
||||
|
||||
<span style="font-size: 10pt; font-family: Verdana;">First official release of RK043FN48H LCD component driver </span><span style="font-size: 10pt; font-family: Verdana;"></span></li>
|
||||
</ul><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"><span style="font-style: italic; font-weight: bold;"></span></span><span style="font-size: 10pt; font-family: Verdana;"></span><h2 style="background: rgb(51, 102, 255) none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial;"><a name="License"></a><span style="font-size: 12pt; color: white;">License<o:p></o:p></span><br></h2>
|
||||
<div style="text-align: justify;"><font size="-1"><span style="font-family: "Verdana","sans-serif";">
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are
|
||||
met:</span><br>
|
||||
</font>
|
||||
<ol><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Redistributions
|
||||
in binary form must reproduce the above copyright notice, this list of
|
||||
conditions and the following disclaimer in </span><span style="font-family: "Verdana","sans-serif";">the documentation and/or other materials provided with the distribution.</span><span style="font-family: "Verdana","sans-serif";"></span></font></li><li><font size="-1"><span style="font-family: "Verdana","sans-serif";">Neither the name of STMicroelectronics nor the names of its contributors may be used to endorse or promote products derived </span><br>
|
||||
</font>
|
||||
</li></ol>
|
||||
<font size="-1"><span style="font-family: "Verdana","sans-serif";"> from this software without specific prior written permission.</span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";"></span><br>
|
||||
<span style="font-family: "Verdana","sans-serif";">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED</span><span style="font-family: "Verdana","sans-serif";"> WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A </span><span style="font-family: "Verdana","sans-serif";">PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY </span><span style="font-family: "Verdana","sans-serif";">DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, </span><span style="font-family: "Verdana","sans-serif";">PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span><span style="font-family: "Verdana","sans-serif";"> CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR </span><span style="font-family: "Verdana","sans-serif";">OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></font>
|
||||
|
||||
</div>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Verdana","sans-serif"; color: black;"><font size="-1"></font><o:p></o:p></span></p>
|
||||
<b><span style="font-size: 10pt; font-family: Verdana; color: black;"></span></b>
|
||||
|
||||
<div class="MsoNormal" style="text-align: center;" align="center"><span style="color: black;">
|
||||
<hr align="center" size="2" width="100%"></span></div>
|
||||
<p class="MsoNormal" style="margin: 4.5pt 0cm 4.5pt 18pt; text-align: center;" align="center"><span style="font-size: 10pt; font-family: Verdana; color: black;">For
|
||||
complete documentation on </span><span style="font-size: 10pt; font-family: Verdana;">STM32<span style="color: black;"> Microcontrollers
|
||||
visit </span><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank">www.st.com/STM32</a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"><a href="http://www.st.com/internet/mcu/class/1734.jsp" target="_blank"></a></span></u></span><span style="font-size: 10pt; font-family: Verdana;"><a target="_blank" href="http://www.st.com/internet/mcu/family/141.jsp"><u><span style="color: blue;"></span></u></a></span><span style="font-size: 10pt; font-family: Verdana;"><u><span style="color: blue;"></span></u></span><span style="color: black;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<p class="MsoNormal"><span style="font-size: 10pt;"><o:p></o:p></span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<p class="MsoNormal"><o:p> </o:p></p>
|
||||
</div>
|
||||
|
||||
</body></html>
|
||||
119
project/Drivers/BSP/Components/rk043fn48h/rk043fn48h.h
Normal file
119
project/Drivers/BSP/Components/rk043fn48h/rk043fn48h.h
Normal file
@@ -0,0 +1,119 @@
|
||||
/**
|
||||
******************************************************************************
|
||||
* @file rk043fn48h.h
|
||||
* @author MCD Application Team
|
||||
* @brief This file contains all the constants parameters for the RK043FN48H-CT672B
|
||||
* LCD component.
|
||||
******************************************************************************
|
||||
* @attention
|
||||
*
|
||||
* <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification,
|
||||
* are permitted provided that the following conditions are met:
|
||||
* 1. Redistributions of source code must retain the above copyright notice,
|
||||
* this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
* this list of conditions and the following disclaimer in the documentation
|
||||
* and/or other materials provided with the distribution.
|
||||
* 3. Neither the name of STMicroelectronics nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
******************************************************************************
|
||||
*/
|
||||
|
||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||
#ifndef __RK043FN48H_H
|
||||
#define __RK043FN48H_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Includes ------------------------------------------------------------------*/
|
||||
|
||||
/** @addtogroup BSP
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup Components
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @addtogroup rk043fn48h
|
||||
* @{
|
||||
*/
|
||||
|
||||
/** @defgroup RK043FN48H_Exported_Types
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup RK043FN48H_Exported_Constants
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @brief RK043FN48H Size
|
||||
*/
|
||||
#define RK043FN48H_WIDTH ((uint16_t)480) /* LCD PIXEL WIDTH */
|
||||
#define RK043FN48H_HEIGHT ((uint16_t)272) /* LCD PIXEL HEIGHT */
|
||||
|
||||
/**
|
||||
* @brief RK043FN48H Timing
|
||||
*/
|
||||
#define RK043FN48H_HSYNC ((uint16_t)41) /* Horizontal synchronization */
|
||||
#define RK043FN48H_HBP ((uint16_t)13) /* Horizontal back porch */
|
||||
#define RK043FN48H_HFP ((uint16_t)32) /* Horizontal front porch */
|
||||
#define RK043FN48H_VSYNC ((uint16_t)10) /* Vertical synchronization */
|
||||
#define RK043FN48H_VBP ((uint16_t)2) /* Vertical back porch */
|
||||
#define RK043FN48H_VFP ((uint16_t)2) /* Vertical front porch */
|
||||
|
||||
/**
|
||||
* @brief RK043FN48H frequency divider
|
||||
*/
|
||||
#define RK043FN48H_FREQUENCY_DIVIDER 5 /* LCD Frequency divider */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/** @defgroup RK043FN48H_Exported_Functions
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __RK043FN48H_H */
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
|
||||
Reference in New Issue
Block a user