2019-08-14 16:43:29 +02:00
|
|
|
/****************************************************************************
|
|
|
|
* boards/arm/nuc1xx/nutiny-nuc120/include/board.h
|
2013-02-16 17:32:19 +01:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2013-02-16 17:32:19 +01:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2013-02-16 17:32:19 +01:00
|
|
|
*
|
2021-03-17 18:14:12 +01:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2013-02-16 17:32:19 +01:00
|
|
|
*
|
2019-08-14 16:43:29 +02:00
|
|
|
****************************************************************************/
|
2013-02-16 17:32:19 +01:00
|
|
|
|
2022-01-15 03:44:35 +01:00
|
|
|
#ifndef __BOARDS_ARM_NUC1XX_NUTINY_NUC120_INCLUDE_BOARD_H
|
|
|
|
#define __BOARDS_ARM_NUC1XX_NUTINY_NUC120_INCLUDE_BOARD_H
|
2013-02-16 17:32:19 +01:00
|
|
|
|
2019-08-14 16:43:29 +02:00
|
|
|
/****************************************************************************
|
2013-02-16 17:32:19 +01:00
|
|
|
* Included Files
|
2019-08-14 16:43:29 +02:00
|
|
|
****************************************************************************/
|
2013-02-16 17:32:19 +01:00
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#ifndef __ASSEMBLY__
|
|
|
|
# include <stdint.h>
|
|
|
|
#endif
|
|
|
|
|
2019-08-14 16:43:29 +02:00
|
|
|
/****************************************************************************
|
2015-04-08 17:15:17 +02:00
|
|
|
* Pre-processor Definitions
|
2019-08-14 16:43:29 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/* Clocking *****************************************************************/
|
|
|
|
|
2013-02-18 21:24:20 +01:00
|
|
|
/* Crystal frequencies */
|
|
|
|
|
2013-02-24 18:30:55 +01:00
|
|
|
#define BOARD_XTALHI_FREQUENCY 12000000
|
|
|
|
#define BOARD_XTALLO_FREQUENCY 32768
|
2013-02-18 21:24:20 +01:00
|
|
|
|
|
|
|
/* PLL: The PLL must be 48MHz x N times when using USB
|
|
|
|
*
|
|
|
|
* FOUT = FIN x (NF/NR) x (1 / NO)
|
|
|
|
* FIN = Input reference clock frequency
|
|
|
|
* NF = Feedback divider
|
|
|
|
* = (FB_DV + 2)
|
|
|
|
* NR = Input divider
|
|
|
|
* = (IN_DV + 2)
|
|
|
|
* NO = 1 if OUT_DV == 0
|
|
|
|
* 2 if OUT_DV == 1 or 2
|
|
|
|
* 4 if OUT_DV == 3
|
|
|
|
*
|
|
|
|
* FOUT = 12000000 x 48 / 3 / 4
|
|
|
|
* = 48MHz
|
|
|
|
*/
|
|
|
|
|
2013-02-24 18:30:55 +01:00
|
|
|
#define BOARD_PLL_FIN BOARD_XTALHI_FREQUENCY
|
2013-02-18 21:24:20 +01:00
|
|
|
#define BOARD_PLL_FB_DV 46
|
|
|
|
#define BOARD_PLL_NF (BOARD_PLL_FB_DV+2)
|
|
|
|
#define BOARD_PLL_IN_DV 1
|
|
|
|
#define BOARD_PLL_NR (BOARD_PLL_IN_DV+2)
|
|
|
|
#define BOARD_PLL_OUT_DV 3
|
|
|
|
#define BOARD_PLL_NO 4
|
|
|
|
|
|
|
|
#define BOARD_PLL_FOUT \
|
|
|
|
(BOARD_PLL_FIN * BOARD_PLL_NF / BOARD_PLL_NR / BOARD_PLL_NO)
|
|
|
|
|
|
|
|
/* HCLK. FOUT is the HCLK source clock. */
|
|
|
|
|
2013-02-24 00:42:06 +01:00
|
|
|
#define BOARD_HCLK_N 1
|
|
|
|
#define BOARD_HCLK_FREQUENCY (BOARD_PLL_FOUT / BOARD_HCLK_N)
|
2013-02-18 21:24:20 +01:00
|
|
|
|
|
|
|
/* USB. FOUT is the source. The USB CLK must be 48MHz */
|
|
|
|
|
2013-02-24 00:42:06 +01:00
|
|
|
#define BOARD_USB_N 1
|
|
|
|
#define BOARD_USB_FREQUENCY (BOARD_PLL_FOUT / BOARD_USB_N)
|
2013-02-16 17:32:19 +01:00
|
|
|
|
2019-08-14 16:43:29 +02:00
|
|
|
/* LED definitions **********************************************************/
|
|
|
|
|
2020-02-22 19:31:14 +01:00
|
|
|
/* The NuTiny has a single green LED that can be controlled from software.
|
2019-08-14 16:43:29 +02:00
|
|
|
* This LED is connected to PIN17.
|
|
|
|
* It is pulled high so a low value will illuminate the LED.
|
2013-02-16 17:32:19 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define BOARD_NLEDS 1
|
|
|
|
|
2019-08-14 16:43:29 +02:00
|
|
|
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
|
|
|
|
* the NuTiny.
|
|
|
|
* The following definitions describe how NuttX controls the LEDs:
|
2013-02-16 17:32:19 +01:00
|
|
|
*
|
|
|
|
* SYMBOL Meaning LED state
|
|
|
|
* Initially all LED is OFF
|
|
|
|
* ------------------- ----------------------- ------------- ------------
|
|
|
|
* LED_STARTED NuttX has been started LED ON
|
|
|
|
* LED_HEAPALLOCATE Heap has been allocated LED ON
|
|
|
|
* LED_IRQSENABLED Interrupts enabled LED ON
|
|
|
|
* LED_STACKCREATED Idle stack created LED ON
|
|
|
|
* LED_INIRQ In an interrupt LED should glow
|
|
|
|
* LED_SIGNAL In a signal handler LED might glow
|
2019-08-14 16:43:29 +02:00
|
|
|
* LED_ASSERTION An assertion failed LED ON while handling the
|
|
|
|
* assertion
|
2013-02-16 17:32:19 +01:00
|
|
|
* LED_PANIC The system has crashed LED Blinking at 2Hz
|
2013-02-18 00:53:44 +01:00
|
|
|
* LED_IDLE NUC1XX is is sleep mode (Optional, not used)
|
2013-02-16 17:32:19 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#define LED_STARTED 0
|
|
|
|
#define LED_HEAPALLOCATE 0
|
|
|
|
#define LED_IRQSENABLED 0
|
|
|
|
#define LED_STACKCREATED 0
|
|
|
|
#define LED_INIRQ 0
|
|
|
|
#define LED_SIGNAL 0
|
|
|
|
#define LED_ASSERTION 0
|
|
|
|
#define LED_PANIC 0
|
|
|
|
|
2019-08-14 16:43:29 +02:00
|
|
|
/* Button definitions *******************************************************/
|
|
|
|
|
2013-02-16 17:32:19 +01:00
|
|
|
/* The NuTiny has no buttons */
|
|
|
|
|
|
|
|
#define NUM_BUTTONS 0
|
|
|
|
|
2022-01-15 03:44:35 +01:00
|
|
|
#endif /* __BOARDS_ARM_NUC1XX_NUTINY_NUC120_INCLUDE_BOARD_H */
|