CH579 Ethernet PHY

Hello!

For some reasons I need to disable autonegotiation and force Ethernet PHY to 10M Half-Duplex. I am tried to write a value 0 into PHY register 0, but without success. The register value still 0x1100. So the questions:

1) Is it possible to force PHY into specific mode?

2) What I need to do?

3) What is the exact procedure to write into PHY registers (it seems to be different from CH563)?


Self-reply. The correct functions to read and write PHY registers are:

void write_mii(uint8_t reg, uint16_t data)
{
    R32_ETH_MIWR = (data << 16) | 0x0100 | (reg & RB_ETH_MIREGADR_MASK);
    while (R8_ETH_MISTAT) { __DSB(); };
}

uint16_t read_mii(uint8_t reg)
{
    R32_ETH_MIWR = (reg & RB_ETH_MIREGADR_MASK);
    return R16_ETH_MIRD;
}



只有登录才能回复,可以选择微信账号登录