I'm using ADSP-SC573 EZ-board.
I try to understand the adi_twi_SetPrescale() function. What is the purpose of this?
The comments says:
Set the TWI prescale value.
The prescale value is used to establish a relationship between the system clock (SCLK) and the TWI controller's internally timed events. The internal time reference is derived from SCLK using a prescaled value. PRESCALE = fSCLK/10MHz
So can I use it like this?
uint32_t fsysclk; uint32_t fsclk0; // Used for SPI0 and SPI1 (See SPI Port—Master Timing in data sheet) uint32_t fsclk1; // Used for SPI2 if (adi_pwr_GetSystemFreq(0, &fsysclk, &fsclk0, &fsclk1)) break; uint16_t prescale = fsysclk / 10000000; if (adi_twi_SetPrescale(hDevice, prescale)) break;