1. 整数integer 和 小数 fraction
跟两个公式有关,整数和 小数 也就知道了
RFPLL : VCO_freq 频率6G~12G
LO :就是TX/RX发出的频率,如2.4G
REF: 40M频率
算出整数和小数之后,直接赋值给 寄存器,例如
1. 分别写
ad9361_spi_write(ad9361_phy->spi, REG_TX_FRACT_BYTE_0, 0x62);
ad9361_spi_write(ad9361_phy->spi, REG_TX_FRACT_BYTE_1, 0x66);
ad9361_spi_write(ad9361_phy->spi, REG_TX_FRACT_BYTE_2, 0x26);
ad9361_spi_write(ad9361_phy->spi, REG_TX_INTEGER_BYTE_1, 0x00);
ad9361_spi_write(ad9361_phy->spi, REG_TX_INTEGER_BYTE_0, 0x79);
ad9361_spi_write(ad9361_phy->spi,REG_RFPLL_DIVIDERS,0x11);
2. 连写
memcpy(tmpbuf,"\x26\x66\x62\x00\x79",5);
ad9361_spi_writem(ad9361_phy->spi, REG_TX_FRACT_BYTE_2, tmpbuf,5);
注:1. 高字节写入
2. VCO_cal 校正是 TX 的0x271 触发