Browse Source

Merge pull request #11 from FrankBoesing/patch-1

add 256MHz
main
Paul Stoffregen 6 years ago
parent
commit
c1ae2b46f2
No account linked to committer's email address
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      utility/KinetisSDHC.c

+ 5
- 1
utility/KinetisSDHC.c View File

#define SDHC_SYSCTL_DIVISOR(prescale, divisor) \ #define SDHC_SYSCTL_DIVISOR(prescale, divisor) \
(SDHC_SYSCTL_SDCLKFS((prescale)>>1)|SDHC_SYSCTL_DVS((divisor)-1)) (SDHC_SYSCTL_SDCLKFS((prescale)>>1)|SDHC_SYSCTL_DVS((divisor)-1))


#if (F_CPU == 240000000)
#if (F_CPU == 256000000)
#define SDHC_SYSCTL_400KHZ SDHC_SYSCTL_DIVISOR(64, 10) // 400 kHz
#define SDHC_SYSCTL_25MHZ SDHC_SYSCTL_DIVISOR(2, 6) // 21.3 MHz
#define SDHC_SYSCTL_50MHZ SDHC_SYSCTL_DIVISOR(2, 3) // 42.6 MHz
#elif (F_CPU == 240000000)
#define SDHC_SYSCTL_400KHZ SDHC_SYSCTL_DIVISOR(64, 10) // 375 kHz #define SDHC_SYSCTL_400KHZ SDHC_SYSCTL_DIVISOR(64, 10) // 375 kHz
#define SDHC_SYSCTL_25MHZ SDHC_SYSCTL_DIVISOR(2, 5) // 24 MHz #define SDHC_SYSCTL_25MHZ SDHC_SYSCTL_DIVISOR(2, 5) // 24 MHz
#define SDHC_SYSCTL_50MHZ SDHC_SYSCTL_DIVISOR(2, 3) // 40 MHz #define SDHC_SYSCTL_50MHZ SDHC_SYSCTL_DIVISOR(2, 3) // 40 MHz

Loading…
Cancel
Save