/ * @brief * Configure timing values of address latch bus accesses * * @param[in] banks * Mask of memory bank(s) to configure address timing for * * @param[in] setupCycles * Sets the number of cycles the address is held after ALE is asserted * * @param[in] holdCycles * Sets the number of cycles the address is driven onto the ADDRDAT bus before * ALE is asserted. If set 0, 1 cy
| 977 | * ALE is asserted. If set 0, 1 cycle is inserted by HW |
| 978 | ******************************************************************************/ |
| 979 | void EBI_BankAddressTimingSet(uint32_t banks, int setupCycles, int holdCycles) |
| 980 | { |
| 981 | uint32_t addressLatchTiming; |
| 982 | |
| 983 | /* Verify only valid banks are used */ |
| 984 | EFM_ASSERT((banks & ~(EBI_BANK0 | EBI_BANK1 | EBI_BANK2 | EBI_BANK3)) == 0); |
| 985 | |
| 986 | /* Check that timing values are within limits */ |
| 987 | EFM_ASSERT(setupCycles < 4); |
| 988 | EFM_ASSERT(holdCycles < 4); |
| 989 | |
| 990 | /* Configure address latch timing values */ |
| 991 | addressLatchTiming = (setupCycles << _EBI_ADDRTIMING_ADDRSETUP_SHIFT) | |
| 992 | (holdCycles << _EBI_ADDRTIMING_ADDRHOLD_SHIFT); |
| 993 | |
| 994 | if (banks & EBI_BANK0) |
| 995 | { |
| 996 | EBI->ADDRTIMING = (EBI->ADDRTIMING & |
| 997 | ~(_EBI_ADDRTIMING_ADDRSETUP_MASK | |
| 998 | _EBI_ADDRTIMING_ADDRHOLD_MASK)) | addressLatchTiming; |
| 999 | } |
| 1000 | if (banks & EBI_BANK1) |
| 1001 | { |
| 1002 | EBI->ADDRTIMING1 = (EBI->ADDRTIMING1 & |
| 1003 | ~(_EBI_ADDRTIMING1_ADDRSETUP_MASK | |
| 1004 | _EBI_ADDRTIMING1_ADDRHOLD_MASK)) | addressLatchTiming; |
| 1005 | } |
| 1006 | if (banks & EBI_BANK2) |
| 1007 | { |
| 1008 | EBI->ADDRTIMING2 = (EBI->ADDRTIMING2 & |
| 1009 | ~(_EBI_ADDRTIMING2_ADDRSETUP_MASK | |
| 1010 | _EBI_ADDRTIMING2_ADDRHOLD_MASK)) | addressLatchTiming; |
| 1011 | } |
| 1012 | if (banks & EBI_BANK3) |
| 1013 | { |
| 1014 | EBI->ADDRTIMING3 = (EBI->ADDRTIMING3 & |
| 1015 | ~(_EBI_ADDRTIMING3_ADDRSETUP_MASK | |
| 1016 | _EBI_ADDRTIMING3_ADDRHOLD_MASK)) | addressLatchTiming; |
| 1017 | } |
| 1018 | } |
| 1019 | |
| 1020 | |
| 1021 | /***************************************************************************//** |