Nut/OS  5.0.5
API Reference
lpc_ssp.h
Go to the documentation of this file.
00001 #ifndef _ARCH_CM3_NXP_MACH_LPC_SSP_H_
00002 #define _ARCH_CM3_NXP_MACH_LPC_SSP_H_
00003 
00004 /*
00005  * Copyright 2011 by egnite GmbH
00006  *
00007  * Redistribution and use in source and binary forms, with or without
00008  * modification, are permitted provided that the following conditions
00009  * are met:
00010  *
00011  * 1. Redistributions of source code must retain the above copyright
00012  *    notice, this list of conditions and the following disclaimer.
00013  * 2. Redistributions in binary form must reproduce the above copyright
00014  *    notice, this list of conditions and the following disclaimer in the
00015  *    documentation and/or other materials provided with the distribution.
00016  * 3. Neither the name of the copyright holders nor the names of
00017  *    contributors may be used to endorse or promote products derived
00018  *    from this software without specific prior written permission.
00019  *
00020  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00021  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00022  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00023  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00024  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00025  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00026  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00027  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00028  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00029  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00030  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00031  * SUCH DAMAGE.
00032  *
00033  * For additional information see http://www.ethernut.de/
00034  */
00035 
00049 
00050 
00053 #define SSP_CR0_OFF         0x00000000
00054 #define SSP_CR0_DSS_MSK     0x0000000F
00055 #define SSP_CR0_DSS_LSB     0
00056 #define SSP_CR0_DSS(n)      (((n) - 1) << SSP_CR0_DSS_LSB)
00057 #define SSP_CR0_FRF_MSK     0x00000030
00058 #define SSP_CR0_FRF_SPI     0x00000000
00059 #define SSP_CR0_FRF_TI      0x00000010
00060 #define SSP_CR0_FRF_MW      0x00000020
00061 #define SSP_CR0_CPOL        0x00000040
00062 #define SSP_CR0_CPHA        0x00000080
00063 #define SSP_CR0_SPI_MODE0   0
00064 #define SSP_CR0_SPI_MODE1   SSP_CR0_CPHA
00065 #define SSP_CR0_SPI_MODE2   SSP_CR0_CPOL
00066 #define SSP_CR0_SPI_MODE3   (SSP_CR0_CPOL | SSP_CR0_CPHA)
00067 #define SSP_CR0_SCR_MSK     0x0000FF00
00068 #define SSP_CR0_SCR_LSB     8
00069 
00073 #define SSP_CR1_OFF         0x00000004
00074 #define SSP_CR1_LBM         0x00000001
00075 #define SSP_CR1_SSE         0x00000002
00076 #define SSP_CR1_MS          0x00000004
00077 #define SSP_CR1_SOD         0x00000008
00078 
00082 #define SSP_DR_OFF          0x00000008
00083 
00087 #define SSP_SR_OFF          0x0000000C
00088 #define SSP_SR_TFE          0x00000001
00089 #define SSP_SR_TNF          0x00000002
00090 #define SSP_SR_RNE          0x00000004
00091 #define SSP_SR_RFF          0x00000008
00092 #define SSP_SR_BSY          0x00000010
00093 
00097 #define SSP_CPSR_OFF        0x00000010
00098 
00102 #define SSP_IMSC_OFF        0x00000014
00103 #define SSP_RIS_OFF         0x00000018
00104 #define SSP_MIS_OFF         0x0000001C
00105 #define SSP_ICR_OFF         0x00000020
00106 #define SSP_RORI            0x00000001
00107 #define SSP_RTI             0x00000002
00108 #define SSP_RXI             0x00000004
00109 #define SSP_TXI             0x00000008
00110 
00114 #define SSP_DMACR_OFF       0x00000024
00115 #define SSP_RXDMAE          0x00000001
00116 #define SSP_TXDMAE          0x00000002
00117 
00121 #ifdef LPC_SSP0_BASE
00122 #define SSP0CR0             (LPC_SSP0_BASE + SSP_CR0_OFF)
00123 #define SSP0CR1             (LPC_SSP0_BASE + SSP_CR1_OFF)
00124 #define SSP0DR              (LPC_SSP0_BASE + SSP_DR_OFF)
00125 #define SSP0SR              (LPC_SSP0_BASE + SSP_SR_OFF)
00126 #define SSP0CPSR            (LPC_SSP0_BASE + SSP_CPSR_OFF)
00127 #define SSP0IMSC            (LPC_SSP0_BASE + SSP_IMSC_OFF)
00128 #define SSP0RIS             (LPC_SSP0_BASE + SSP_RIS_OFF)
00129 #define SSP0MIS             (LPC_SSP0_BASE + SSP_MIS_OFF)
00130 #define SSP0ICR             (LPC_SSP0_BASE + SSP_ICR_OFF)
00131 #define SSP0DMACR           (LPC_SSP0_BASE + SSP_DMACR_OFF)
00132 #endif
00133 
00136 #ifdef LPC_SSP1_BASE
00137 #define SSP1CR0             (LPC_SSP1_BASE + SSP_CR0_OFF)
00138 #define SSP1CR1             (LPC_SSP1_BASE + SSP_CR1_OFF)
00139 #define SSP1DR              (LPC_SSP1_BASE + SSP_DR_OFF)
00140 #define SSP1SR              (LPC_SSP1_BASE + SSP_SR_OFF)
00141 #define SSP1CPSR            (LPC_SSP1_BASE + SSP_CPSR_OFF)
00142 #define SSP1IMSC            (LPC_SSP1_BASE + SSP_IMSC_OFF)
00143 #define SSP1RIS             (LPC_SSP1_BASE + SSP_RIS_OFF)
00144 #define SSP1MIS             (LPC_SSP1_BASE + SSP_MIS_OFF)
00145 #define SSP1ICR             (LPC_SSP1_BASE + SSP_ICR_OFF)
00146 #define SSP1DMACR           (LPC_SSP1_BASE + SSP_DMACR_OFF)
00147 #endif
00148 
00150 #endif
00151