arch: arm: str71x: fix nxstyle errors
Fix nxstyle errors to pass CI Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
This commit is contained in:
parent
f30b6f9532
commit
29bf33839b
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/chip.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,14 +16,14 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_CHIP_H
|
||||
#define __ARCH_ARM_SRC_STR71X_CHIP_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
@ -46,20 +46,20 @@
|
||||
#include "str71x_apb.h" /* USB */
|
||||
#include "str71x_flash.h" /* Flash */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_CHIP_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,14 +16,14 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
@ -31,9 +31,9 @@
|
||||
|
||||
#include <arch/board/board.h>
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Calculate the values of PCLK1 and PCLK2 from settings in board.h.
|
||||
*
|
||||
@ -67,27 +67,28 @@
|
||||
#define STR71X_PCLK1 (STR71X_RCLK / STR71X_APB1_DIV) /* PCLK1 derives from RCLK */
|
||||
#define STR71X_PCLK2 (STR71X_RCLK / STR71X_APB2_DIV) /* PCLK2 derives from RCLK */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: str7x_xtiinitialize
|
||||
*
|
||||
* Description:
|
||||
* Configure XTI for operation. Note that the lines are not used as wake-up
|
||||
* sources in this implementation. Some extensions would be required for that
|
||||
* capability.
|
||||
* Configure XTI for operation.
|
||||
* Note that the lines are not used as wake-up sources in this
|
||||
* implementation.
|
||||
* Some extensions would be required for that capability.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STR71X_XTI
|
||||
int str71x_xtiinitialize(void);
|
||||
@ -95,14 +96,14 @@ int str71x_xtiinitialize(void);
|
||||
# define str71x_xtiinitialize()
|
||||
#endif /* CONFIG_STR71X_XTI */
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: str7x_xticonfig
|
||||
*
|
||||
* Description:
|
||||
* Configure an external line to provide interrupts. Interrupt is configured,
|
||||
* but disabled on return.
|
||||
* Configure an external line to provide interrupts.
|
||||
* Interrupt is configured, but disabled on return.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_STR71X_XTI
|
||||
int str71x_xticonfig(int irq, bool rising);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_adc12.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_ADC12_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_ADC12_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* ADC12 registers ******************************************************************/
|
||||
/* ADC12 registers **********************************************************/
|
||||
|
||||
#define STR71X_ADC12_DATA0 (STR71X_ADC12_BASE + 0x0000) /* 16-bits wide */
|
||||
#define STR71X_ADC12_DATA1 (STR71X_ADC12_BASE + 0x0008) /* 16-bits wide */
|
||||
@ -42,7 +42,8 @@
|
||||
#define STR71X_ADC12_CSR (STR71X_ADC12_BASE + 0x0020) /* 16-bits wide */
|
||||
#define STR71X_ADC12_CPR (STR71X_ADC12_BASE + 0x0030) /* 16-bits wide */
|
||||
|
||||
/* Register bit settings ************************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* ADC12 Conversion modes */
|
||||
|
||||
#define STR71X_ADC12_SINGLE (0)
|
||||
@ -79,16 +80,16 @@
|
||||
|
||||
#define STR71X_ADC12_START (0x0020)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_ADC12_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_apb.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,29 +16,29 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_APB_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_APB_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* APB register offsets *************************************************************/
|
||||
/* APB register offsets *****************************************************/
|
||||
|
||||
#define STR71X_APB_CKDIS_OFFSET (0x0010) /* 32-bits wide */
|
||||
#define STR71X_APB_SWRES_OFFSET (0x0014) /* 32-bits wide */
|
||||
|
||||
/* APB register addresses ***********************************************************/
|
||||
/* APB register addresses ***************************************************/
|
||||
|
||||
#define STR71X_APB1_CKDIS (STR71X_APB1_BASE + STR71X_APB_CKDIS_OFFSET)
|
||||
#define STR71X_APB1_SWRES (STR71X_APB1_BASE + STR71X_APB_SWRES_OFFSET)
|
||||
@ -46,7 +46,7 @@
|
||||
#define STR71X_APB2_CKDIS (STR71X_APB2_BASE + STR71X_APB_CKDIS_OFFSET)
|
||||
#define STR71X_APB2_SWRES (STR71X_APB2_BASE + STR71X_APB_SWRES_OFFSET)
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* APB1 periperals */
|
||||
|
||||
@ -79,16 +79,16 @@
|
||||
#define STR71X_APB2_EIC (0x4000) /* Bit 14: EIC */
|
||||
#define STR71X_APB2_APB2ALL (0x5fdd)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_APB_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_bspi.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_BSPI_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_BSPI_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Register Offsets *****************************************************************/
|
||||
/* Register Offsets *********************************************************/
|
||||
|
||||
#define STR71X_BSPI_RXR_OFFSET (0x0000) /* 16-bits wide */
|
||||
#define STR71X_BSPI_TXR_OFFSET (0x0004) /* 16-bits wide */
|
||||
@ -41,7 +41,7 @@
|
||||
#define STR71X_BSPI_CSR2_OFFSET (0x000c) /* 16-bits wide */
|
||||
#define STR71X_BSPI_CLK_OFFSET (0x0010) /* 16-bits wide */
|
||||
|
||||
/* Registers ************************************************************************/
|
||||
/* Registers ****************************************************************/
|
||||
|
||||
#define STR71X_BSPI_RXR(b) ((b) + STR71X_BSPI_RXR_OFFSET)
|
||||
#define STR71X_BSPI_TXR(b) ((b) + STR71X_BSPI_TXR_OFFSET)
|
||||
@ -61,7 +61,7 @@
|
||||
#define STR71X_BSPI1_CSR2 (STR71X_BSPI1_BASE + STR71X_BSPI_CSR2_OFFSET)
|
||||
#define STR71X_BSPI1_CLK (STR71X_BSPI1_BASE + STR71X_BSPI_CLK_OFFSET)
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* BSPI control/status register 1 */
|
||||
|
||||
@ -72,6 +72,7 @@
|
||||
#define STR71X_BSPICSR1_RIEDISABLED (0 << STR71X_BSPICSR1_RIESHIFT) /* Disabled */
|
||||
#define STR71X_BSPICSR1_RIERFNE (1 << STR71X_BSPICSR1_RIESHIFT) /* Receive FIFO not empty */
|
||||
#define STR71X_BSPICSR1_RIERFF (3 << STR71X_BSPICSR1_RIESHIFT) /* Receive FIFO full */
|
||||
|
||||
#define STR71X_BSPICSR1_REIE (1 << 4) /* Bit 4: Receive error interrupt enable */
|
||||
#define STR71X_BSPICSR1_BEIE (1 << 7) /* Bit 7: Bus error interrupt enable */
|
||||
#define STR71X_BSPICSR1_CPOL (1 << 8) /* Bit 8: Clock polarity select */
|
||||
@ -80,6 +81,7 @@
|
||||
#define STR71X_BSPICSR1_WLMASK (3 << STR71X_BSPICSR1_WLSHIFT)
|
||||
#define STR71X_BSPICSR1_WL8BIT (0 << STR71X_BSPICSR1_WLSHIFT) /* 8-bits */
|
||||
#define STR71X_BSPICSR1_WL16BIT (1 << STR71X_BSPICSR1_WLSHIFT) /* 16-bits */
|
||||
|
||||
#define STR71X_BSPICSR1_RFESHIFT 12 /* Bits 12-15: Receive FIFO enable */
|
||||
#define STR71X_BSPICSR1_RFEMASK (15 << STR71X_BSPICSR1_RFESHIFT)
|
||||
#define STR71X_BSPICSR1_RFE1 (0 << STR71X_BSPICSR1_RFESHIFT) /* Word 1 enabled */
|
||||
@ -116,6 +118,7 @@
|
||||
#define STR71X_BSPICSR2_TFE18 (7 << STR71X_BSPICSR2_TFESHIFT) /* Word 1-8 enabled */
|
||||
#define STR71X_BSPICSR2_TFE19 (8 << STR71X_BSPICSR2_TFESHIFT) /* Word 1-9 enabled */
|
||||
#define STR71X_BSPICSR2_TFE110 (9 << STR71X_BSPICSR2_TFESHIFT) /* Word 1-10 enabled */
|
||||
|
||||
#define STR71X_BSPICSR2_TIESHIFT 14 /* Bit 14-15: BSPI transmit interrupt enable */
|
||||
#define STR71X_BSPICSR2_TIEMASK (3 << STR71X_BSPICSR2_TIESHIFT)
|
||||
#define STR71X_BSPICSR2_TIEDISABLED (0 << STR71X_BSPICSR2_TIESHIFT) /* Disabled */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_can.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_CAN_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_CAN_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Registers ************************************************************************/
|
||||
/* Registers ****************************************************************/
|
||||
|
||||
#define STR71X_CAN_CR (STR71X_CAN_BASE + 0x0000) /* 16-bits wide */
|
||||
#define STR71X_CAN_SR (STR71X_CAN_BASE + 0x0004) /* 16-bits wide */
|
||||
@ -103,7 +103,7 @@
|
||||
#define STR71X_CAN_MV1R (STR71X_CAN_BASE + 0x0160) /* 16-bits wide */
|
||||
#define STR71X_CAN_MV2R (STR71X_CAN_BASE + 0x0164) /* 16-bits wide */
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* Control register */
|
||||
|
||||
@ -176,16 +176,16 @@
|
||||
#define STR41X_CAN_LASTSTDID ((1 << 11) - 1)
|
||||
#define STR41X_CAN_LASTEXTID ((1 << 29) - 1)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_CAN_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_decodeirq.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,11 +16,11 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
@ -37,20 +37,20 @@
|
||||
#include "arm_arch.h"
|
||||
#include "arm_internal.h"
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* arm_decodeirq()
|
||||
*
|
||||
* Description:
|
||||
* Read the IRQ number from the IVR register. During initialization, the IVR
|
||||
* register was set to zero. Each SIR[n] register was programmed to contain
|
||||
* the IRQ number. At IRQ processing time (when this function run), the IVR
|
||||
* should contain the desired IRQ number.
|
||||
* Read the IRQ number from the IVR register. During initialization, the
|
||||
* IVR register was set to zero. Each SIR[n] register was programmed to
|
||||
* contain the IRQ number. At IRQ processing time (when this function
|
||||
* run), the IVR should contain the desired IRQ number.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
uint32_t *arm_decodeirq(uint32_t *regs)
|
||||
{
|
||||
@ -76,8 +76,9 @@ uint32_t *arm_decodeirq(uint32_t *regs)
|
||||
{
|
||||
uint32_t *savestate;
|
||||
|
||||
/* Current regs non-zero indicates that we are processing an interrupt;
|
||||
* CURRENT_REGS is also used to manage interrupt level context switches.
|
||||
/* Current regs non-zero indicates that we are processing an
|
||||
* interrupt; CURRENT_REGS is also used to manage interrupt level
|
||||
* context switches.
|
||||
*/
|
||||
|
||||
savestate = (uint32_t *)CURRENT_REGS;
|
||||
@ -91,9 +92,9 @@ uint32_t *arm_decodeirq(uint32_t *regs)
|
||||
|
||||
irq_dispatch(irq, regs);
|
||||
|
||||
/* Restore the previous value of CURRENT_REGS. NULL would indicate that
|
||||
* we are no longer in an interrupt handler. It will be non-NULL if we
|
||||
* are returning from a nested interrupt.
|
||||
/* Restore the previous value of CURRENT_REGS.
|
||||
* NULL would indicate that we are no longer in an interrupt handler.
|
||||
* It will be non-NULL if we are returning from a nested interrupt.
|
||||
*/
|
||||
|
||||
CURRENT_REGS = savestate;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_eic.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_EIC_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_EIC_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <arch/irq.h>
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Enhanced Interrupt Controller (EIC) register offsets *****************************/
|
||||
/* Enhanced Interrupt Controller (EIC) register offsets *********************/
|
||||
|
||||
#define STR71X_EIC_ICR_OFFSET (0x0000) /* 32-bits wide */
|
||||
#define STR71X_EIC_CICR_OFFSET (0x0004) /* 32-bits wide */
|
||||
@ -80,7 +80,7 @@
|
||||
#define STR71X_EIC_NCHANNELS (32)
|
||||
#define STR71X_EIC_SIR_BASE (STR71X_EIC_BASE + STR71X_EIC_SIR_OFFSET)
|
||||
|
||||
/* Enhanced Interrupt Controller (EIC) registers ************************************/
|
||||
/* Enhanced Interrupt Controller (EIC) registers ****************************/
|
||||
|
||||
#define STR71X_EIC_ICR (STR71X_EIC_BASE + STR71X_EIC_ICR_OFFSET)
|
||||
#define STR71X_EIC_CICR (STR71X_EIC_BASE + STR71X_EIC_CICR_OFFSET)
|
||||
@ -125,7 +125,7 @@
|
||||
#define STR71X_EIC_SIR30 (STR71X_EIC_BASE + STR71X_EIC_SIR30_OFFSET)
|
||||
#define STR71X_EIC_SIR31 (STR71X_EIC_BASE + STR71X_EIC_SIR31_OFFSET)
|
||||
|
||||
/* Register bit settings ************************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* Interrupt control register (ICR) bit definitions */
|
||||
|
||||
@ -146,16 +146,16 @@
|
||||
#define STR71X_EICSIR_SIPLMASK (0x0000000f) /* Bits 0-3: Source interrupt priority level */
|
||||
#define STR71X_EICSIR_SIVMASK (0xffff0000) /* Bits 16-31: Source interrupt vector */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_EIC_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_emi.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,38 +16,38 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_EMI_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_EMI_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* External Memory Interfac (EMI) register offset ***********************************/
|
||||
/* External Memory Interfac (EMI) register offset ***************************/
|
||||
|
||||
#define STR71X_EMI_BCON0_OFFSET (0x0000) /* 16-bits wide */
|
||||
#define STR71X_EMI_BCON1_OFFSET (0x0004) /* 16-bits wide */
|
||||
#define STR71X_EMI_BCON2_OFFSET (0x0008) /* 16-bits wide */
|
||||
#define STR71X_EMI_BCON3_OFFSET (0x000c) /* 16-bits wide */
|
||||
|
||||
/* External Memory Interfac (EMI) register addresses ********************************/
|
||||
/* External Memory Interfac (EMI) register addresses ************************/
|
||||
|
||||
#define STR71X_EMI_BCON0 (STR71X_EMI_BASE + STR71X_EMI_BCON0_OFFSET)
|
||||
#define STR71X_EMI_BCON1 (STR71X_EMI_BASE + STR71X_EMI_BCON1_OFFSET)
|
||||
#define STR71X_EMI_BCON2 (STR71X_EMI_BASE + STR71X_EMI_BCON2_OFFSET)
|
||||
#define STR71X_EMI_BCON3 (STR71X_EMI_BASE + STR71X_EMI_BCON3_OFFSET)
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* Bank-N configuration register (BCONn) bit definitions */
|
||||
|
||||
@ -73,16 +73,16 @@
|
||||
#define STR71X_EMIBCON_WS15 (0x003c) /* 15 waitstates */
|
||||
#define STR71X_EMIBCON_ENABLE (0x8000) /* Bit 15: Bank enable */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_EMI_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_flash.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_FLASH_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_FLASH_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Flash registers ******************************************************************/
|
||||
/* Flash registers **********************************************************/
|
||||
|
||||
#define STR71X_FLASH_CR0 (STR71X_FLASHREG_BASE + 0x0000) /* 32-bits wide */
|
||||
#define STR71X_FLASH_CR1 (STR71X_FLASHREG_BASE + 0x0004) /* 32-bits wide */
|
||||
@ -42,7 +42,7 @@
|
||||
#define STR71X_FLASH_AR (STR71X_FLASHREG_BASE + 0x0010) /* 32-bits wide */
|
||||
#define STR71X_FLASH_ER (STR71X_FLASHREG_BASE + 0x0014) /* 32-bits wide */
|
||||
|
||||
/* Register bit settings ************************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
#define STR71X_FLASH_B0F0 (0x00000001)
|
||||
#define STR71X_FLASH_B0F1 (0x00000002)
|
||||
@ -93,16 +93,16 @@
|
||||
|
||||
#define STR71X_FLASH_INTM_Mask (0x00200000)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_FLASH_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_gpio.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,31 +16,31 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_GPIO_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_GPIO_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* GPIO register offsets ************************************************************/
|
||||
/* GPIO register offsets ****************************************************/
|
||||
|
||||
#define STR71X_GPIO_PC0_OFFSET (0x0000) /* 16-bits wide */
|
||||
#define STR71X_GPIO_PC1_OFFSET (0x0004) /* 16-bits wide */
|
||||
#define STR71X_GPIO_PC2_OFFSET (0x0008) /* 16-bits wide */
|
||||
#define STR71X_GPIO_PD_OFFSET (0x000c) /* 16-bits wide */
|
||||
|
||||
/* GPIO register addresses **********************************************************/
|
||||
/* GPIO register addresses **************************************************/
|
||||
|
||||
#define STR71X_GPIO_PC0(b) ((b) + STR71X_GPIO_PC0_OFFSET)
|
||||
#define STR71X_GPIO_PC1(b) ((b) + STR71X_GPIO_PC1_OFFSET)
|
||||
@ -62,18 +62,18 @@
|
||||
#define STR71X_GPIO2_PC2 (STR71X_GPIO2_BASE + STR71X_GPIO_PC2_OFFSET)
|
||||
#define STR71X_GPIO2_PD (STR71X_GPIO2_BASE + STR71X_GPIO_PD_OFFSET)
|
||||
|
||||
/* Register bit settings ************************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_GPIO_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_head.S
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,11 +16,11 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h> /* NuttX configuration settings */
|
||||
#include <arch/board/board.h> /* Board-specific settings */
|
||||
@ -30,9 +30,9 @@
|
||||
#include "arm_internal.h"
|
||||
#include "arm_arch.h"
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* This file holds the NuttX start logic that runs when the STR711
|
||||
* is reset. This logic must be located at address 0x4000:0000 in
|
||||
@ -40,9 +40,9 @@
|
||||
* reset.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* External references
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.globl str71x_prccuinit /* Clock initialization */
|
||||
.globl up_lowsetup /* Early initialization of UART */
|
||||
@ -57,18 +57,18 @@
|
||||
#endif
|
||||
.globl nx_start /* NuttX entry point */
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Macros
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: showprogress
|
||||
*
|
||||
* Description:
|
||||
* Print a character on the UART to show boot status. This macro will
|
||||
* modify r0, r1, r2 and r14
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.macro showprogress, code
|
||||
#ifdef CONFIG_DEBUG_FEATURES
|
||||
@ -77,13 +77,13 @@
|
||||
#endif
|
||||
.endm
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: emiinit
|
||||
*
|
||||
* Description:
|
||||
* Initialize external memory banks 0-3 as configured
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.macro emiinit, base, value
|
||||
#if defined(CONFIG_STR71X_BANK0) || defined(CONFIG_STR71X_BANK1) || \
|
||||
@ -239,7 +239,7 @@
|
||||
#endif
|
||||
.endm
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: eicinit
|
||||
*
|
||||
* Description:
|
||||
@ -257,7 +257,7 @@
|
||||
* At the time of IRQ processing, the IVR will contain the decoded IRQ
|
||||
* number needed by NuttX.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.macro eicinit, eicbase, value, irqno, offset
|
||||
/* Disable and clear all interrupts */
|
||||
@ -328,13 +328,13 @@ eicloop:
|
||||
blt eicloop
|
||||
.endm
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: periphinit
|
||||
*
|
||||
* Description:
|
||||
* Disable all perfipherals (except EIC)
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.macro periphinit, value, base1, base2
|
||||
#ifndef CONFIG_STR71X_DISABLE_PERIPHINIT
|
||||
@ -365,7 +365,7 @@ eicloop:
|
||||
#endif
|
||||
.endm
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: remap
|
||||
*
|
||||
* Description:
|
||||
@ -374,7 +374,7 @@ eicloop:
|
||||
* map the memory appropriately for the execution configuration. Various
|
||||
* options are possible, but only boot from FLASH is currently supported.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.macro remap, base, value
|
||||
|
||||
@ -393,13 +393,13 @@ eicloop:
|
||||
strh \value, [\base, #STR71X_PCU_BOOTCR_OFFSET]
|
||||
.endm
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Text
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.text
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: _vector_table
|
||||
*
|
||||
* Description:
|
||||
@ -408,7 +408,7 @@ eicloop:
|
||||
* address 0x00000000). The first entry in the vector table is the reset
|
||||
* vector and this is the code that will execute when the processor is reset.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.globl _vector_table
|
||||
.type _vector_table, %function
|
||||
@ -446,7 +446,7 @@ _vector_table:
|
||||
.long arm_vectorfiq
|
||||
.size _vector_table, . - _vector_table
|
||||
|
||||
/*****************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: __start
|
||||
*
|
||||
* Description:
|
||||
@ -454,7 +454,7 @@ _vector_table:
|
||||
* the processor is reset. It initializes hardware and then gives
|
||||
* control to NuttX.
|
||||
*
|
||||
*****************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
.global __start
|
||||
.type __start, #function
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_i2c.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_I2C_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_I2C_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Register offsets *****************************************************************/
|
||||
/* Register offsets *********************************************************/
|
||||
|
||||
#define STR71X_I2C_CR_OFFSET (0x0000) /* 8-bits wide */
|
||||
#define STR71X_I2C_SR1_OFFSET (0x0004) /* 8-bits wide */
|
||||
@ -44,7 +44,7 @@
|
||||
#define STR71X_I2C_DR_OFFSET (0x0018) /* 8-bits wide */
|
||||
#define STR71X_I2C_ECCR_OFFSET (0x001c) /* 8-bits wide */
|
||||
|
||||
/* Registers ************************************************************************/
|
||||
/* Registers ****************************************************************/
|
||||
|
||||
#define STR71X_I2C_CR(b) ((b) + STR71X_I2C_SR_OFFSET)
|
||||
#define STR71X_I2C_SR1(b) ((b) + STR71X_I2C_SR1_OFFSET)
|
||||
@ -73,7 +73,7 @@
|
||||
#define STR71X_I2C1_DR (STR71X_I2C1_BASE + STR71X_I2C_DR_OFFSET)
|
||||
#define STR71X_I2C1_ECCR (STR71X_I2C1_BASE + STR71X_I2C_ECCR_OFFSET)
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* I2C Control Register (CR) */
|
||||
|
||||
@ -123,16 +123,16 @@
|
||||
#define STR71X_I2COAR2_26_40 (0x60) /* FPCLK1 = 26.67 to 40 */
|
||||
#define STR71X_I2COAR2_40_53 (0x80) /* FPCLK1 = 40 to 53.33 */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_I2C_H */
|
||||
|
@ -40,6 +40,7 @@
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/* g_current_regs[] holds a references to the current interrupt level
|
||||
* register storage structure. If is non-NULL only during interrupt
|
||||
* processing. Access to g_current_regs[] must be through the macro
|
||||
@ -188,8 +189,8 @@ int up_prioritize_irq(int irq, int priority)
|
||||
uint32_t addr;
|
||||
uint32_t reg32;
|
||||
|
||||
/* The current interrupt priority (CIP) is always zero, so a minimum prioriy
|
||||
* of one is enforced to prevent disabling the interrupt.
|
||||
/* The current interrupt priority (CIP) is always zero, so a minimum
|
||||
* prioriy of one is enforced to prevent disabling the interrupt.
|
||||
*/
|
||||
|
||||
if ((unsigned)irq < STR71X_NBASEIRQS && priority > 0 && priority < 16)
|
||||
|
@ -35,7 +35,7 @@
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Configuration **********************************************************/
|
||||
/* Configuration ************************************************************/
|
||||
|
||||
/* Is there a UART enabled? */
|
||||
|
||||
@ -245,7 +245,8 @@ void arm_lowputc(char ch)
|
||||
#ifdef HAVE_CONSOLE
|
||||
/* Wait until the TX FIFO is not full */
|
||||
|
||||
while ((getreg16(STR71X_UART_SR(STR71X_UART_BASE)) & STR71X_UARTSR_TF) != 0);
|
||||
while ((getreg16(STR71X_UART_SR(STR71X_UART_BASE)) &
|
||||
STR71X_UARTSR_TF) != 0);
|
||||
|
||||
/* Then send the character */
|
||||
|
||||
@ -270,6 +271,7 @@ void up_lowsetup(void)
|
||||
uint16_t reg16;
|
||||
|
||||
/* Enable the selected console device */
|
||||
|
||||
/* Set the UART baud rate */
|
||||
|
||||
putreg16((uint16_t)UART_BAUDRATE, STR71X_UART_BR(STR71X_UART_BASE));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_map.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,22 +16,22 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_MAP_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_MAP_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Memory Map ***********************************************************************/
|
||||
/* Memory Map ***************************************************************/
|
||||
|
||||
#define STR71X_FLASHRAMEMI_BASE (0x00000000) /* Flash alias for booting */
|
||||
#define STR71X_RAM_BASE (0x20000000)
|
||||
@ -69,16 +69,16 @@
|
||||
#define STR71X_WDOG_BASE (STR71X_APB2_BASE + 0xe000)
|
||||
#define STR71X_EIC_BASE (0xfffff800)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif // __ARCH_ARM_SRC_STR71X_STR71X_MAP_H
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_pcu.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_PCU_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_PCU_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Power Control Unit (PCU) register offsets ****************************************/
|
||||
/* Power Control Unit (PCU) register offsets ********************************/
|
||||
|
||||
#define STR71X_PCU_MDIVR_OFFSET (0x0000) /* 16-bits wide */
|
||||
#define STR71X_PCU_PDIVR_OFFSET (0x0004) /* 16-bits wide */
|
||||
@ -42,7 +42,7 @@
|
||||
#define STR71X_PCU_BOOTCR_OFFSET (0x0010) /* 16-bits wide */
|
||||
#define STR71X_PCU_PWRCR_OFFSET (0x0014) /* 16-bits wide */
|
||||
|
||||
/* Power Control Unit (PCU) register addresses **************************************/
|
||||
/* Power Control Unit (PCU) register addresses ******************************/
|
||||
|
||||
#define STR71X_PCU_MDIVR (STR71X_PCU_BASE + STR71X_PCU_MDIVR_OFFSET)
|
||||
#define STR71X_PCU_PDIVR (STR71X_PCU_BASE + STR71X_PCU_PDIVR_OFFSET)
|
||||
@ -51,7 +51,7 @@
|
||||
#define STR71X_PCU_BOOTCR (STR71X_PCU_BASE + STR71X_PCU_BOOTCR_OFFSET)
|
||||
#define STR71X_PCU_PWRCR (STR71X_PCU_BASE + STR71X_PCU_PWRCR_OFFSET)
|
||||
|
||||
/* Register bit settings ************************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* PCU MDIVR register bit definitions */
|
||||
|
||||
@ -129,16 +129,16 @@
|
||||
#define STR71X_PCUPWRCR_BUSY (0x4000) /* Bit 14: PCU register backup logic busy */
|
||||
#define STR71X_PCUPWRCR_WREN (0x8000) /* Bit 15: PCU register write enable */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_PCU_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_prccu.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,11 +16,11 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
@ -35,9 +35,9 @@
|
||||
#include "arm_arch.h"
|
||||
#include "str71x.h"
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Select set of peripherals to be enabled */
|
||||
|
||||
@ -314,42 +314,42 @@
|
||||
# error "Unsupported value for STR71X_PLL2OUT_DIV"
|
||||
#endif
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Funstions
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: str71x_prccuinit
|
||||
*
|
||||
* Description:
|
||||
* Initialize the PCU/RCCU based on the NuttX configuration and the board-specific
|
||||
* settings in board.h
|
||||
* Initialize the PCU/RCCU based on the NuttX configuration and the
|
||||
* board-specific settings in board.h
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
void str71x_prccuinit(void)
|
||||
{
|
||||
uint32_t reg32;
|
||||
uint16_t reg16;
|
||||
|
||||
/* Divide RCLK to obtain PCLK1 & 2 clock for the APB1 & 2 peripherals. The divider
|
||||
* values are provided in board.h
|
||||
/* Divide RCLK to obtain PCLK1 & 2 clock for the APB1 & 2 peripherals.
|
||||
* The divider values are provided in board.h
|
||||
*/
|
||||
|
||||
reg16 = getreg16(STR71X_PCU_PDIVR);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_rccu.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_RCCU_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_RCCU_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Reset and Clock Control Unit (RCCU) register offsets *****************************/
|
||||
/* Reset and Clock Control Unit (RCCU) register offsets *********************/
|
||||
|
||||
/* All registers are 32-bits wide, but with the top 16 bits "reserved" */
|
||||
|
||||
@ -43,7 +43,7 @@
|
||||
#define STR71X_RCCU_PER_OFFSET (0x001c) /* 32-bits wide */
|
||||
#define STR71X_RCCU_SMR_OFFSET (0x0020) /* 32-bits wide */
|
||||
|
||||
/* Reset and Clock Control Unit (RCCU) register addresses ***************************/
|
||||
/* Reset and Clock Control Unit (RCCU) register addresses *******************/
|
||||
|
||||
#define STR71X_RCCU_CCR (STR71X_RCCU_BASE + STR71X_RCCU_CCR_OFFSET)
|
||||
#define STR71X_RCCU_CFR (STR71X_RCCU_BASE + STR71X_RCCU_CFR_OFFSET)
|
||||
@ -51,7 +51,7 @@
|
||||
#define STR71X_RCCU_PER (STR71X_RCCU_BASE + STR71X_RCCU_PER_OFFSET)
|
||||
#define STR71X_RCCU_SMR (STR71X_RCCU_BASE + STR71X_RCCU_SMR_OFFSET)
|
||||
|
||||
/* Register bit settings ************************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* RCCU CCR register bit definitions */
|
||||
|
||||
@ -113,16 +113,16 @@
|
||||
#define STR71X_RCCUSMR_WFI (0x00000001) /* Bit 0: Wait for interrupt */
|
||||
#define STR71X_RCCUSMR_HALT (0x00000000) /* Bit 1: Halt */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_RCCU_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_rtc.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_RTC_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_RTC_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* RTC Registers ********************************************************************/
|
||||
/* RTC Registers ************************************************************/
|
||||
|
||||
#define STR71X_RTC_CRH (STR71X_RTC_BASE + 0x0000) /* 16-bits wide */
|
||||
#define STR71X_RTC_CRL (STR71X_RTC_BASE + 0x0004) /* 16-bits wide */
|
||||
@ -46,7 +46,7 @@
|
||||
#define STR71X_RTC_ALRH (STR71X_RTC_BASE + 0x0020) /* 16-bits wide */
|
||||
#define STR71X_RTC_ALRL (STR71X_RTC_BASE + 0x0024) /* 16-bits wide */
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* RTC control register */
|
||||
|
||||
@ -62,16 +62,16 @@
|
||||
#define STR71X_RTCCRL_CNF (0x0010) /* Bit 4: Enter configuration mode */
|
||||
#define STR71X_RTCCRL_RTOFF (0x0020) /* Bit 5: RTC Operation Off */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_RTC_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_timer.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_TIMER_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_TIMER_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Register offsets *****************************************************************/
|
||||
/* Register offsets *********************************************************/
|
||||
|
||||
#define STR71X_TIMER_ICAR_OFFSET (0x0000) /* 16-bits wide */
|
||||
#define STR71X_TIMER_ICBR_OFFSET (0x0004) /* 16-bits wide */
|
||||
@ -44,7 +44,7 @@
|
||||
#define STR71X_TIMER_CR2_OFFSET (0x0018) /* 16-bits wide */
|
||||
#define STR71X_TIMER_SR_OFFSET (0x001c) /* 16-bits wide */
|
||||
|
||||
/* Register Addresses ***************************************************************/
|
||||
/* Register Addresses *******************************************************/
|
||||
|
||||
#define STR71X_TIMER_ICAR(b) ((b) + STR71X_TIMER_ICAR_OFFSET)
|
||||
#define STR71X_TIMER_ICBR(b) ((b) + STR71X_TIMER_ICBR_OFFSET)
|
||||
@ -91,7 +91,7 @@
|
||||
#define STR71X_TIMER3_CR2 (STR71X_TIMER3_BASE + STR71X_TIMER_CR2_OFFSET)
|
||||
#define STR71X_TIMER3_SR (STR71X_TIMER3_BASE + STR71X_TIMER_SR_OFFSET)
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* Timer control register (CR1 and CR2) */
|
||||
|
||||
@ -125,16 +125,16 @@
|
||||
#define STR71X_TIMERSR_OCFA (0x4000) /* Bit 14: Output capture flag A */
|
||||
#define STR71X_TIMERSR_ICFA (0x8000) /* Bit 15: Input capture flag A */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_TIMER_H */
|
||||
|
@ -56,7 +56,8 @@
|
||||
|
||||
/* In this case, the desired, maximum clocking would be MAX_TIM0CLK. For
|
||||
* example if CLK_TCK is the default of 100Hz, then the ideal clocking for
|
||||
* timer0 would be 6,553,500 */
|
||||
* timer0 would be 6,553,500
|
||||
*/
|
||||
|
||||
#define MAX_TIM0CLK (MAX_OCAR * CLK_TCK)
|
||||
|
||||
@ -150,13 +151,14 @@ void up_timer_initialize(void)
|
||||
putreg16(0x0000, STR71X_TIMER0_CR2);
|
||||
putreg16(0x0000, STR71X_TIMER0_SR);
|
||||
|
||||
/* Configure TIM0 so that it is clocked by the internal APB2 frequency (PCLK2)
|
||||
* divided by the above prescaler value (1) -- versus an external Clock.
|
||||
/* Configure TIM0 so that it is clocked by the internal APB2 frequency
|
||||
* (PCLK2) divided by the above prescaler value (1) -- versus an external
|
||||
* Clock.
|
||||
* -- Nothing to do because STR71X_TIMERCR1_ECKEN is already cleared.
|
||||
*
|
||||
* Select a divisor to reduce the frequency of clocking. This must be
|
||||
* done so that the entire timer interval can fit in the 16-bit OCAR register.
|
||||
* (see the discussion above).
|
||||
* Select a divisor to reduce the frequency of clocking.
|
||||
* This must be done so that the entire timer interval can fit in the
|
||||
* 16-bit OCAR register. (see the discussion above).
|
||||
*/
|
||||
|
||||
putreg16(STR71X_TIMERCR2_OCAIE | (PCLK2_DIVIDER - 1), STR71X_TIMER0_CR2);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_uart.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_UART_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_UART_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Registers offsets ****************************************************************/
|
||||
/* Registers offsets ********************************************************/
|
||||
|
||||
#define STR71X_UART_BR_OFFSET (0x0000) /* 16-bits wide */
|
||||
#define STR71X_UART_TXBUFR_OFFSET (0x0004) /* 16-bits wide */
|
||||
@ -46,7 +46,7 @@
|
||||
#define STR71X_UART_TXRSTR_OFFSET (0x0020) /* 16-bits wide */
|
||||
#define STR71X_UART_RXRSTR_OFFSET (0x0024) /* 16-bits wide */
|
||||
|
||||
/* Registers addresses **************************************************************/
|
||||
/* Registers addresses ******************************************************/
|
||||
|
||||
#define STR71X_UART_BR(b) ((b) + STR71X_UART_BR_OFFSET)
|
||||
#define STR71X_UART_TXBUFR(b) ((b) + STR71X_UART_TXBUFR_OFFSET)
|
||||
@ -103,7 +103,7 @@
|
||||
#define STR71X_UART3_TXRSTR (STR71X_UART3_BASE + STR71X_UART_TXRSTR_OFFSET)
|
||||
#define STR71X_UART3_RXRSTR (STR71X_UART3_BASE + STR71X_UART_RXRSTR_OFFSET)
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* UART control register (CR) */
|
||||
|
||||
@ -151,16 +151,16 @@
|
||||
#define STR71X_UARTSR_RHF (0x0100) /* Bit 8: Rx half full */
|
||||
#define STR71X_UARTSR_TF (0x0200) /* Bit 9: Tx full */
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_UART_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_usb.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_USB_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_USB_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* USB registers ********************************************************************/
|
||||
/* USB registers ************************************************************/
|
||||
|
||||
#define STR71X_USB_NENDPNTS (16)
|
||||
#define STR71X_USB_EPR(ep) (STR71X_USB_BASE + ((ep) << 4))
|
||||
@ -59,7 +59,7 @@
|
||||
#define STR71X_USB_DADDR (STR71X_USB_BASE + 0x004C) /* Device address register */
|
||||
#define STR71X_USB_BTABLE (STR71X_USB_BASE + 0x0050) /* Buffer Table address register */
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* Control Register (CNTR) */
|
||||
|
||||
@ -119,6 +119,7 @@
|
||||
# define USB_EPR_TXVALID (3 << USB_EPR_TXSTAT_SHIFT) /* Endpoint TX valid */
|
||||
# define USB_EPR_TXDTOG1 (1 << USB_EPR_TXSTAT_SHIFT) /* Bit : Endpoint TX data toggle bit1 */
|
||||
# define USB_EPR_TXDTOG2 (2 << USB_EPR_TXSTAT_SHIFT) /* Bit : Endpoint TX data toggle bit2 */
|
||||
|
||||
#define USB_EPR_DTOGTX (1 << 6) /* Bit 6: Endpoint data toggle TX */
|
||||
#define USB_EPR_CTRTX (1 << 7) /* Bit 7: Endpoint correct transfer TX */
|
||||
#define USB_EPR_KIND (1 << 8) /* Bit 8: Endpoint kind */
|
||||
@ -128,6 +129,7 @@
|
||||
# define USB_EPR_CONTROL (1 << USB_EPR_EPTYPE_SHIFT) /* Endpoint CONTROL */
|
||||
# define USB_EPR_ISOC (2 << USB_EPR_EPTYPE_SHIFT)) /* Endpoint ISOCHRONOUS */
|
||||
# define USB_EPR_INTERRUPT (3 << USB_EPR_EPTYPE_SHIFT) /* Endpoint INTERRUPT */
|
||||
|
||||
#define USB_EPR_SETUP (1 << 11) /* Bit 11: Endpoint setup */
|
||||
#define USB_EPR_RXSTAT_SHIFT 12 /* Bits 12-13: Endpoint RX status bit */
|
||||
#define USB_EPR_RXSTAT_MASK (3 << USB_EPR_RXSTAT_SHIFT)
|
||||
@ -137,6 +139,7 @@
|
||||
# define USB_EPR_RXVALID (3 << USB_EPR_RXSTAT_SHIFT) /* Endpoint RX valid */
|
||||
# define USB_EPR_RXDTOG1 (1 << USB_EPR_RXSTAT_SHIFT) /* Endpoint RX data toggle bit1 */
|
||||
# define USB_EPR_RXDTOG2 (2 << USB_EPR_RXSTAT_SHIFT) /* Endpoint RX data toggle bit2 */
|
||||
|
||||
#define USB_EPR_DTOGRX (1 << 14) /* Bit 14: Endpoint data toggle RX */
|
||||
#define USB_EPR_CTRRX (1 << 15) /* Bit 15: Endpoint correct transfer RX */
|
||||
|
||||
@ -150,16 +153,16 @@
|
||||
#define USB_EPR_TXDTOG_MASK (USB_EPR_TXSTAT_MASK|USB_EPR_NOTOGGLE_MASK)
|
||||
#define USB_EPR_RXDTOG_MASK (USB_EPR_RXSTAT_MASK|USB_EPR_NOTOGGLE_MASK)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_USB_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_wdog.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_WDOG_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_WDOG_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* Registers ************************************************************************/
|
||||
/* Registers ****************************************************************/
|
||||
|
||||
#define STR71X_WDOG_CR (STR71X_WDOG_BASE + 0x0000) /* 16-bits wide */
|
||||
#define STR71X_WDOG_PR (STR71X_WDOG_BASE + 0x0004) /* 16-bits wide */
|
||||
@ -43,18 +43,18 @@
|
||||
#define STR71X_WDOG_MR (STR71X_WDOG_BASE + 0x0014) /* 16-bits wide */
|
||||
#define STR71X_WDOG_KR (STR71X_WDOG_BASE + 0x00018 /* 16-bits wide */
|
||||
|
||||
/* Register bit settings ***********************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STR71X_STR71X_WDOG_H */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_xti.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,11 +16,11 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
@ -40,13 +40,13 @@
|
||||
|
||||
#ifdef CONFIG_STR71X_XTI
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
struct xtiregs_s
|
||||
{
|
||||
@ -54,9 +54,9 @@ struct xtiregs_s
|
||||
uint32_t tr; /* Trigger polarity register */
|
||||
};
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static const struct xtiregs_s g_xtiregs[2] =
|
||||
{
|
||||
@ -64,21 +64,21 @@ static const struct xtiregs_s g_xtiregs[2] =
|
||||
{ STR71X_XTI_MRH, STR71X_XTI_TRH }
|
||||
};
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: str71x_xtiinterrupt
|
||||
*
|
||||
* Description:
|
||||
* Dispatch an XTI interrupt.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
static int str71x_xtiinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
{
|
||||
@ -112,10 +112,10 @@ static int str71x_xtiinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
}
|
||||
|
||||
/* Clear the pending interrupts. This should be safe: "it is necessary to
|
||||
* clear at least one pending bit: this operation allows a rising edge to be
|
||||
* generated on the internal line (if there is at least one more pending bit
|
||||
* set and not masked) and so to set the interrupt controller pending bit
|
||||
* again.
|
||||
* clear at least one pending bit: this operation allows a rising edge to
|
||||
* be generated on the internal line (if there is at least one more pending
|
||||
* bit set and not masked) and so to set the interrupt controller pending
|
||||
* bit again.
|
||||
*/
|
||||
|
||||
putreg8(0, STR71X_XTI_PRH);
|
||||
@ -123,19 +123,20 @@ static int str71x_xtiinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: str71x_xtiinitialize
|
||||
*
|
||||
* Description:
|
||||
* Configure XTI for operation. Note that the lines are not used as wake-up
|
||||
* sources in this implementation. Some extensions would be required for that
|
||||
* Configure XTI for operation.
|
||||
* Note that the lines are not used as wake-up sources in this
|
||||
* implementation. Some extensions would be required for that
|
||||
* capability.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int str71x_xtiinitialize(void)
|
||||
{
|
||||
@ -164,16 +165,17 @@ int str71x_xtiinitialize(void)
|
||||
|
||||
up_enable_irq(STR71X_IRQ_XTI);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/********************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: str71x_xticonfig
|
||||
*
|
||||
* Description:
|
||||
* Configure an external line to provide interrupts.
|
||||
*
|
||||
********************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int str71x_xticonfig(int irq, bool rising)
|
||||
{
|
||||
@ -213,12 +215,14 @@ int str71x_xticonfig(int irq, bool rising)
|
||||
{
|
||||
regval &= ~(1 << bit);
|
||||
}
|
||||
|
||||
putreg8(regval, g_xtiregs[ndx].tr);
|
||||
|
||||
/* Return success */
|
||||
|
||||
ret = OK;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* arch/arm/src/str71x/str71x_xti.h
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
@ -16,24 +16,24 @@
|
||||
* License for the specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STR71X_STR71X_XTI_H
|
||||
#define __ARCH_ARM_SRC_STR71X_STR71X_XTI_H
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "str71x_map.h"
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/* External Interrupt Controller (XTI) registers ************************************/
|
||||
/* External Interrupt Controller (XTI) registers ****************************/
|
||||
|
||||
#define STR71X_XTI_SR (STR71X_XTI_BASE + 0x001c) /* 8-bits wide */
|
||||
#define STR71X_XTI_CTRL (STR71X_XTI_BASE + 0x0024) /* 8-bits wide */
|
||||
@ -44,7 +44,7 @@
|
||||
#define STR71X_XTI_PRH (STR71X_XTI_BASE + 0x0038) /* 8-bits wide */
|
||||
#define STR71X_XTI_PRL (STR71X_XTI_BASE + 0x003c) /* 8-bits wide */
|
||||
|
||||
/* Register bit settings ************************************************************/
|
||||
/* Register bit settings ****************************************************/
|
||||
|
||||
/* Control register (CTRL) */
|
||||
|
||||
@ -52,8 +52,8 @@
|
||||
#define STR71X_XTICTRL_ID1S (0x02)
|
||||
#define STR71X_XTICTRL_STOP (0x04)
|
||||
|
||||
/* Most registers are address by external interrupt line in two 8-bit high and low
|
||||
* registers
|
||||
/* Most registers are address by external interrupt line in two 8-bit high
|
||||
* and low registers
|
||||
*/
|
||||
|
||||
#define STR71X_XTI_LINE(n) (1 << (n))
|
||||
@ -75,16 +75,16 @@
|
||||
#define STR71X_XTI_LINE14 STR71X_XTI_LINE(14)
|
||||
#define STR71X_XTI_LINE15 STR71X_XTI_LINE(15)
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* _ARCH_ARM_SRC_STR71X_STR71X_XTI_H */
|
||||
|
Loading…
Reference in New Issue
Block a user