LPC2378: SPI driver from Lizhuoyi

This commit is contained in:
Gregory Nutt
2014-03-08 11:37:50 -06:00
parent 9318dc45a4
commit 6ebb9a6081
+20 -25
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,30 +38,29 @@
* *
****************************************************************************/ ****************************************************************************/
#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.
*
* F_pll = (2 * M * F_in) / N
* F_out = ((2 * (PLL_M + 1) * FOSC)/(PLL_N + 1))/(CCLK_DIV + 1)
*
* With PLL_M=11, PLL_N=0, CCLK_DIV=4:
*
* F_out = ((2 * (11 + 1) * 12000000)/(0 + 1))/(4 + 1)
* = 288,000,000 / 5 = 57,600,000 Hz
*/
/* If USB is enabled, PLL must be configured for 48MHz to provide USB clocking */
//-- F_pll = (2 * M * F_in)/N
//-- F_out = ((2 * (PLL_M + 1 ) * FOSC)/(0+1))/(CCLK_DIV+1) = 288/5 = 57 600 000 Hz
//~ #ifdef CONFIG_USBDEV
//~ # define FOSC (12000000) /* Oscillator frequency */
//~ # define CCLK (57600000) /* CPU running clock */
//~ # define FCCO (288000000) /* CPU CCO clock */
//~ #else
#define FOSC (12000000) /* Oscillator frequency */ #define FOSC (12000000) /* Oscillator frequency */
# define CCLK (57600000) /* CPU running clock */
#define FCCO (288000000) /* CPU CCO clock */ #define FCCO (288000000) /* CPU CCO clock */
//~ # define CCLK (72000000) /* CPU running clock */ #define CCLK (57600000) /* CPU running clock */
//~ # define FCCO (360000000) /* CPU CCO clock */
//~ #endif
//~#define PLL_M ( (FCCO / (2 * FOSC))-1 )
//~ #define PLL_N ( ((2 * PLL_M * FOSC) / FCCO)-1 )
#define PLL_M 11 #define PLL_M 11
#define PLL_N 0 #define PLL_N 0
@@ -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 */