LPC2378: SPI driver from Lizhuoyi

This commit is contained in:
Gregory Nutt
2014-03-08 11:37:50 -06:00
parent 9318dc45a4
commit 6ebb9a6081
+26 -31
View File
@@ -6,7 +6,7 @@
* *
* This is part of the NuttX RTOS and based on the LPC2148 port: * This is part of the NuttX RTOS and based on the LPC2148 port:
* *
* Copyright (C) 2010 Gregory Nutt. All rights reserved. * Copyright (C) 2010, 2014 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org> * Author: Gregory Nutt <gnutt@nuttx.org>
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
@@ -38,35 +38,34 @@
* *
****************************************************************************/ ****************************************************************************/
#ifndef __ARCH_BOARD_BOARD_H #ifndef __CONFIGS_OLIMEX_LPC2378_INCLUDE_BOARD_H
#define __ARCH_BOARD_BOARD_H #define __CONFIGS_OLIMEX_LPC2378_INCLUDE_BOARD_H
#ifdef __cplusplus /************************************************************************************
extern "C" { * Pre-processor Definitions
#endif ************************************************************************************/
/* If USB is enabled, PLL must be configured for 48MHz to provide USB clocking */ /* If USB is enabled, PLL must be configured for 48MHz to provide USB
//-- F_pll = (2 * M * F_in)/N * clocking.
//-- F_out = ((2 * (PLL_M + 1 ) * FOSC)/(0+1))/(CCLK_DIV+1) = 288/5 = 57 600 000 Hz *
//~ #ifdef CONFIG_USBDEV * F_pll = (2 * M * F_in) / N
//~ # define FOSC (12000000) /* Oscillator frequency */ * F_out = ((2 * (PLL_M + 1) * FOSC)/(PLL_N + 1))/(CCLK_DIV + 1)
//~ # define CCLK (57600000) /* CPU running clock */ *
//~ # define FCCO (288000000) /* CPU CCO clock */ * With PLL_M=11, PLL_N=0, CCLK_DIV=4:
//~ #else *
# define FOSC (12000000) /* Oscillator frequency */ * F_out = ((2 * (11 + 1) * 12000000)/(0 + 1))/(4 + 1)
# define CCLK (57600000) /* CPU running clock */ * = 288,000,000 / 5 = 57,600,000 Hz
# define FCCO (288000000) /* CPU CCO clock */ */
//~ # define CCLK (72000000) /* CPU running clock */
//~ # define FCCO (360000000) /* CPU CCO clock */
//~ #endif
//~#define PLL_M ( (FCCO / (2 * FOSC))-1 ) #define FOSC (12000000) /* Oscillator frequency */
//~ #define PLL_N ( ((2 * PLL_M * FOSC) / FCCO)-1 ) #define FCCO (288000000) /* CPU CCO clock */
#define PLL_M 11 #define CCLK (57600000) /* CPU running clock */
#define PLL_N 0
#define CCLK_DIV 4 #define PLL_M 11
#define USBCLK_DIV 6 #define PLL_N 0
#define CCLK_DIV 4
#define USBCLK_DIV 6
/* LED definitions **********************************************************/ /* LED definitions **********************************************************/
@@ -79,12 +78,8 @@
#define LED_ASSERTION 6 #define LED_ASSERTION 6
#define LED_PANIC 7 #define LED_PANIC 7
#ifdef __cplusplus
}
#endif
/**************************************************************************** /****************************************************************************
* Inline Functions * Inline Functions
****************************************************************************/ ****************************************************************************/
#endif /* __ARCH_BOARD_BOARD_H */ #endif /* __CONFIGS_OLIMEX_LPC2378_INCLUDE_BOARD_H */