mirror of
https://github.com/apache/nuttx.git
synced 2026-09-24 00:42:03 +08:00
!arch/stm32: move stm32l1 and finalize the directory split
Move the stm32l1 sources, headers and boards into arch/arm/src/stm32l1, arch/arm/include/stm32l1 and boards/arm/stm32l1, then finalize the split: source each split family directly in arch/arm/Kconfig and boards/Kconfig and remove the now-empty combined arch/arm/src/stm32 and boards/arm/stm32 trees. BREAKING CHANGE: The legacy STM32 architecture and board paths were split into stm32f1, stm32l1, stm32f2, stm32f3, stm32f4, and stm32g4 directories. Out-of-tree boards must move from stm32 to the matching split family. Signed-off-by: raiden00pl <raiden00@railab.me>
This commit is contained in:
+1757
-1609
File diff suppressed because it is too large
Load Diff
@@ -4,4 +4,4 @@
|
||||
|
||||
This examples has ports of several FTDI demos for the FTDI/BridgeTek FT80x GUI
|
||||
chip. As an example configuration, see
|
||||
``nuttx/boards/arm/stm32/viewtool-stm32f107/configs/ft80x/defconfig``.
|
||||
``nuttx/boards/arm/stm32f1/viewtool-stm32f107/configs/ft80x/defconfig``.
|
||||
|
||||
@@ -13,7 +13,7 @@ This function will be called by the ``system/usbmsc`` indirectly via the ``board
|
||||
block device drivers. For examples of the implementation of
|
||||
``board_usbmsc_initialize()`` see
|
||||
``boards/arm/lpc214x/mcu123-lpc214x/src/up_usbmsc.c`` or
|
||||
``boards/arm/stm32/stm3210e-eval/src/usbmsc.c``.
|
||||
``boards/arm/stm32f1/stm3210e-eval/src/usbmsc.c``.
|
||||
|
||||
Configuration options:
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ Files supporting USERLED can be found in the following locations:
|
||||
|
||||
Something important to note is that your board initialization code (normally named ``<arch>_bringup.c`` should call the function to register the driver.
|
||||
|
||||
For stm32f4discovery board this initialization code is placed at ``boards/arm/stm32/stm32f4discovery/src/stm32_bringup.c`` and this is the block responsible to initialize the subsystem:
|
||||
For stm32f4discovery board this initialization code is placed at ``boards/arm/stm32f4/stm32f4discovery/src/stm32_bringup.c`` and this is the block responsible to initialize the subsystem:
|
||||
|
||||
.. code-block:: C
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ Serial Device Drivers
|
||||
`character drivers <#chardrivers>`__ and are accessed as other
|
||||
character drivers.
|
||||
|
||||
- **Examples**: ``arch/arm/src/stm32/stm32_serial.c``,
|
||||
- **Examples**: ``arch/arm/src/common/stm32/stm32_serial_m3m4_v1v2v3v4.c``,
|
||||
``arch/arm/src/lpc214x/lpc214x_serial.c``,
|
||||
``arch/z16/src/z16f/z16f_serial.c``, etc.
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ LCDs
|
||||
Generic LCD driver for LCDs based on the Solomon Systech
|
||||
SSD1289 LCD controller. Think of this as a template for an LCD driver
|
||||
that you will probably have to customize for any particular LCD
|
||||
hardware. (See also boards/arm/stm32/hymini-stm32v/src/ssd1289.c below).
|
||||
hardware. (See also boards/arm/stm32f1/hymini-stm32v/src/ssd1289.c below).
|
||||
|
||||
- ``st7567.c``
|
||||
|
||||
@@ -120,7 +120,7 @@ OLEDs
|
||||
OLED Display Module, UUG-2864AMBAG01, Univision Technology Inc.
|
||||
Based on the SH1101A controller. Example usage::
|
||||
|
||||
boards/arm/stm32/stm32f4discovery
|
||||
boards/arm/stm32f4/stm32f4discovery
|
||||
boards/arm/lpc214x/zp214xpa
|
||||
|
||||
- ``ug-9664hswag01.c``
|
||||
@@ -140,7 +140,7 @@ OLEDs
|
||||
Densitron Technologies DD-12864WO-4A which is based on SSD1309 LCD
|
||||
controller. Example usage::
|
||||
|
||||
boards/arm/stm32/stm32f4discovery
|
||||
boards/arm/stm32f4/stm32f4discovery
|
||||
boards/arm/sam34/sam4l-xplained
|
||||
|
||||
Segment LCDS (SLCDs)
|
||||
|
||||
@@ -29,7 +29,7 @@ SDIO Device Drivers
|
||||
#. Provide that instance to the initialization method of the
|
||||
higher level device driver.
|
||||
|
||||
- **Examples**: ``arch/arm/src/stm32/stm32_sdio.c`` and
|
||||
- **Examples**: ``arch/arm/src/common/stm32/stm32_sdio_m3m4_v1.c`` and
|
||||
``drivers/mmcsd/mmcsd_sdio.c``
|
||||
|
||||
Implementing an SDIO lower-half
|
||||
|
||||
@@ -19,7 +19,7 @@ USB Device-Side Drivers
|
||||
``arch/arm/src/lpc17xx_40xx/lpc17_40_usbdev.c``,
|
||||
``arch/arm/src/lpc214x/lpc214x_usbdev.c``,
|
||||
``arch/arm/src/lpc313x/lpc313x_usbdev.c``, and
|
||||
``arch/arm/src/stm32/stm32_usbdev.c``.
|
||||
``arch/arm/src/common/stm32/stm32_usbdev_m3m4_v1.c``.
|
||||
|
||||
- ``struct usbdevclass_driver_s``. Each USB device class
|
||||
driver must implement an instance of
|
||||
|
||||
@@ -17,7 +17,7 @@ USB Host-Side Drivers
|
||||
|
||||
|
||||
**Examples**: ``arch/arm/src/lpc17xx_40xx/lpc17_40_usbhost.c``,
|
||||
``arch/arm/src/stm32/stm32_otgfshost.c``,
|
||||
``arch/arm/src/common/stm32/stm32_otgfshost_m3m4_v1.c``,
|
||||
``arch/arm/src/sama5/sam_ohci.c``, and
|
||||
``arch/arm/src/sama5/sam_ehci.c``.
|
||||
|
||||
|
||||
@@ -227,7 +227,7 @@ squash before submitting the Pull Request:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
arch/arm/stm32/: Add arch support for stm32 platform
|
||||
arch/arm/stm32f4/: Add arch support for stm32f4 platform
|
||||
|
||||
This patch adds initial support for stm32 platform. Please read
|
||||
the documentation included for more details how to wire the display.
|
||||
|
||||
@@ -28,7 +28,7 @@ Custom Clock Configuration
|
||||
The ``configs/vsn/`` configuration does something like you say. It skips the
|
||||
initial clock configuration by defining
|
||||
``CONFIG_ARCH_BOARD_STM32_CUSTOM_CLOCKCONFIG=y``. Then the normal clock
|
||||
configuration logic in ``arch/arm/src/stm32/stm32_rcc.c`` is not executed.
|
||||
configuration logic in ``arch/arm/src/stm32f4/stm32_rcc.c`` is not executed.
|
||||
Instead, the "custom" clock initialization at ``configs/vsn/src/sysclock.c``
|
||||
is called:
|
||||
|
||||
@@ -83,7 +83,7 @@ are hardcoded in the board.h header file. So you have two options:
|
||||
|
||||
2. **Variable Peripheral Clocking**. You can make the peripheral clocking
|
||||
variable. I had to do this for the SAMA5Dx family. Look at
|
||||
``boards/arm/stm32/sama5d4-ek/include/board_sdram.h`` for example. Notice
|
||||
``boards/arm/sama5/sama5d4-ek/include/board_sdram.h`` for example. Notice
|
||||
that the frequencies are not constants, but function calls:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
@@ -86,7 +86,7 @@ behave as follows at Nuttx start-up time:
|
||||
``CONFIG_ETC_ROMFS=y`` in the NuttX configuration file. They might
|
||||
provide useful examples:
|
||||
|
||||
- ``boards/arm/stm32/hymini-stm32v/nsh2``
|
||||
- ``boards/arm/stm32f1/hymini-stm32v/nsh2``
|
||||
- ``boards/arm/dm320/ntosd-dm320/nsh``
|
||||
- ``boards/sim/sim/sim/nsh``
|
||||
- ``boards/sim/sim/sim/nsh2``
|
||||
|
||||
@@ -218,7 +218,7 @@ Board Configurations
|
||||
|
||||
At present, there are three board configuration that are pre-configured to
|
||||
use IPv6: ``nuttx/boards/arm/tiva/dk-tm4c129x/configs/ipv6``,
|
||||
``nuttx/boards/arm/stm32/stm32f4discovery/ipv6``, and
|
||||
``nuttx/boards/arm/stm32f4/stm32f4discovery/ipv6``, and
|
||||
``nuttx/boards/arm/tiva/tm4c1294-launchpad/configs/ipv6``. These default
|
||||
configurations have only IPv6 enabled. But the `README` files at in those
|
||||
board directories describes how to enable `both` IPv4 and IPv6 simultaneously.
|
||||
@@ -345,4 +345,4 @@ the network utils (``netutils``).
|
||||
* Netutils: The network utilities in ``apps/netutils`` have been adapted to
|
||||
work with IPv6: DHCP, FTP, TFTP, Telnet, etc. Support for managing IPv6
|
||||
address have been included in the ``netlib``, but nothing else has yet been
|
||||
updated.
|
||||
updated.
|
||||
|
||||
@@ -45,7 +45,7 @@ must be satisfied:
|
||||
are implemented for Atmel SAM4/4, SAMA5 families, and for the STMicro STM32.
|
||||
See ``nuttx/arch/arm/src/sam34/sam_emac.c``,
|
||||
``nuttx/arch/arm/src/sam34/sam_emaca.c``, ``sam_emacb.c``, and ``sam_gmac.c``,
|
||||
and ``nuttx/arch/arm/src/stm32/stm32_eth.c``.
|
||||
and ``nuttx/arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c``.
|
||||
- ``CONFIG_ARCH_PHY_INTERRUPT``
|
||||
This is not a user-selectable option. Rather, it is set when selecting a board
|
||||
that supports PHY interrupts. In most architectures, the PHY interrupt is not
|
||||
|
||||
@@ -52,7 +52,7 @@ Precautions
|
||||
1.If you need to implement the ofloader on a different board,
|
||||
you will need to read the `wiki <https://wiki.segger.com/SEGGER_Flash_Loader>`
|
||||
and refer to the implementation of "ofloader.ld" linker script located
|
||||
in the "boards/arm/stm32/stm32f429i-disco/scripts" directory.
|
||||
in the "boards/arm/stm32f4/stm32f429i-disco/scripts" directory.
|
||||
This linker script defines how the different sections of the NuttX image are placed in memory.
|
||||
You should configure the corresponding sections to be located in RAM,
|
||||
where the J-Link can write the image correctly.
|
||||
|
||||
@@ -40,7 +40,7 @@ compatible with the example provided here:
|
||||
|
||||
In this example, let's illustrate this using an STM32F4-Discovery
|
||||
configuration. We will assume that you have modified the
|
||||
``boards/arm/stm32/stm32fdiscovery/src/stm32_bringup.c`` file, adding the
|
||||
``boards/arm/stm32f4/stm32f4discovery/src/stm32_bringup.c`` file, adding the
|
||||
following:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
@@ -191,7 +191,7 @@ An Example
|
||||
There is a good example in the STM32 Ethernet driver. The STM32 F7
|
||||
Ethernet driver (``arch/arm/src/stm32f7/stm32_ethernet.c``) derives
|
||||
directly from the STM32 F4 Ethernet driver
|
||||
(``arch/arm/src/stm32/stm32_eth.c``). These two Ethernet MAC peripherals
|
||||
(``arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c``). These two Ethernet MAC peripherals
|
||||
are nearly identical. Only changes that are a direct consequence of the
|
||||
STM32 F7 D-Cache were required to make the driver work on the STM32 F7.
|
||||
Those changes are summarized below.
|
||||
|
||||
@@ -177,10 +177,10 @@ Files and Directories
|
||||
Here is a summary of directories and files used by the STM32F4Discovery
|
||||
protected build:
|
||||
|
||||
* ``boards/arm/stm32/stm32f4discovery/configs/kostest``. This is the kernel
|
||||
* ``boards/arm/stm32f4/stm32f4discovery/configs/kostest``. This is the kernel
|
||||
mode OS test configuration. The two standard configuration files
|
||||
can be found in this directory: (1) ``defconfig`` and (2) ``Make.defs``.
|
||||
* ``boards/arm/stm32/stm32f4discovery/kernel``. This is the first past
|
||||
* ``boards/arm/stm32f4/stm32f4discovery/kernel``. This is the first past
|
||||
build directory. The Makefile in this directory is invoked to
|
||||
produce the pass1 object (``nuttx_user.elf`` in this case). The
|
||||
second pass object is created by ``arch/arm/src/Makefile``. Also
|
||||
@@ -188,7 +188,7 @@ protected build:
|
||||
contains a header that includes information need by the kernel
|
||||
blob in order to interface with the user-code. That header is
|
||||
defined in by this file.
|
||||
* ``boards/arm/stm32/stm32f4discovery/scripts``. Linker scripts for
|
||||
* ``boards/arm/stm32f4/stm32f4discovery/scripts``. Linker scripts for
|
||||
the kernel mode build are found in this directory. This includes
|
||||
(1) ``memory.ld`` which hold the common memory map, (2) ``user-space.ld``
|
||||
that is used for linking the pass1 user-mode blob, and (3)
|
||||
@@ -314,11 +314,11 @@ Comparing the "Flat" Build Configuration with the Protected Build Configuration
|
||||
===============================================================================
|
||||
|
||||
Compare, for example the configuration
|
||||
``boards/arm/stm32/stm32f4discovery/configs/ostest`` and the
|
||||
configuration ``boards/arm/stm32/stm32f4discovery/configs/kostest``.
|
||||
``boards/arm/stm32f4/stm32f4discovery/configs/ostest`` and the
|
||||
configuration ``boards/arm/stm32f4/stm32f4discovery/configs/kostest``.
|
||||
These two configurations are identical except that one builds a
|
||||
"flat" version of OS test and the other builds a kernel version
|
||||
of the OS test. See the file ``boards/arm/stm32/stm32f4discovery/README.txt``
|
||||
of the OS test. See the file ``boards/arm/stm32f4/stm32f4discovery/README.txt``
|
||||
for more details about those configurations.
|
||||
|
||||
The configurations can be compared using the ``cmpconfig`` tool:
|
||||
@@ -328,7 +328,7 @@ The configurations can be compared using the ``cmpconfig`` tool:
|
||||
cd tools
|
||||
make -f Makefile.host cmpconfig
|
||||
cd ..
|
||||
tools/cmpconfig boards/arm/stm32/stm32f4discovery/configs/ostest/defconfig boards/arm/stm32/stm32f4discovery/configs/kostest/defconfig
|
||||
tools/cmpconfig boards/arm/stm32f4/stm32f4discovery/configs/ostest/defconfig boards/arm/stm32f4/stm32f4discovery/configs/kostest/defconfig
|
||||
|
||||
Here is a summary of the meaning of all of the important differences in the
|
||||
configurations. This should be enough information for you to convert any
|
||||
@@ -337,7 +337,7 @@ configuration from a "flat" to a protected build:
|
||||
* ``CONFIG_BUILD_2PASS=y``. This enables the two pass build.
|
||||
* ``CONFIG_BUILD_PROTECTED=y``. This option enables the "two pass"
|
||||
protected build.
|
||||
* ``CONFIG_PASS1_BUILDIR="boards/arm/stm32/stm32f4discovery/kernel"``.
|
||||
* ``CONFIG_PASS1_BUILDIR="boards/arm/stm32f4/stm32f4discovery/kernel"``.
|
||||
This tells the build system the (relative) location of the pass1 build directory.
|
||||
* ``CONFIG_PASS1_OBJECT=""``. In some "two pass" build configurations,
|
||||
the build system need to know the name of the first pass object.
|
||||
@@ -382,7 +382,7 @@ configuration from a "flat" to a protected build:
|
||||
These includes such things as initializing device drivers.
|
||||
These same initialization steps must be performed in kernel
|
||||
mode for the protected build and ``CONFIG_BOARD_LATE_INITIALIZE``.
|
||||
See ``boards/arm/stm32/stm32f4discovery/src/up_boot.c`` for an
|
||||
See ``boards/arm/stm32f4/stm32f4discovery/src/up_boot.c`` for an
|
||||
example of such board initialization code.
|
||||
|
||||
Architecture-Specific Options:
|
||||
@@ -409,8 +409,8 @@ Size Expansion
|
||||
The protected build will, or course, result in a FLASH image that is
|
||||
larger than that of the corresponding "flat" build. How much larger?
|
||||
I don't have the numbers in hand, but you can build
|
||||
``boards/arm/stm32/stm32f4discovery/configs/nsh`` and
|
||||
``boards/arm/stm32/stm32f4discovery/configs/kostest`` and compare
|
||||
``boards/arm/stm32f4/stm32f4discovery/configs/nsh`` and
|
||||
``boards/arm/stm32f4/stm32f4discovery/configs/kostest`` and compare
|
||||
the resulting binaries for yourself using the ``size`` command.
|
||||
|
||||
Increases in size are expected because:
|
||||
|
||||
@@ -202,7 +202,7 @@ Most ARMv7-M architectures support two mechanism for handling interrupts:
|
||||
``CONFIG_ARMV7M_CMNVECTOR=y`` that can be found in
|
||||
``arch/arm/src/armv7-m/``, and
|
||||
* MCU-specific interrupt handling logic. For the
|
||||
STM32, this logic can be found at ``arch/arm/src/stm32/gnu/stm32_vectors.S``.
|
||||
STM32, this logic can be found at ``arch/arm/src/stm32f4/gnu/stm32_vectors.S``.
|
||||
|
||||
The `common` vector logic is slightly more efficient,
|
||||
the MCU-specific logic is slightly more flexible.
|
||||
@@ -229,7 +229,7 @@ This technical approach requires changes to three files:
|
||||
define ``only`` the small set of 20 ``mapped`` IRQ numbers in
|
||||
the range from 0 through 19. It would also set ``NR_IRQS``
|
||||
to the value 20.
|
||||
* A new header file at ``arch/arm/src/stm32/hardware``, say
|
||||
* A new header file at ``arch/arm/src/stm32f4/hardware``, say
|
||||
``xyz_vector.h``. It would be similar to the other vector
|
||||
definitions files in that directory: It will consist
|
||||
of a sequence of 100 ``VECTOR`` and ``UNUSED`` macros. It will
|
||||
@@ -248,7 +248,7 @@ This has all been replaced with the common vector handling at
|
||||
Vector Definitions
|
||||
==================
|
||||
|
||||
In ``arch/arm/src/stm32/gnu/stm32_vector.S``, notice that the
|
||||
In ``arch/arm/src/stm32f4/gnu/stm32_vectors.S``, notice that the
|
||||
``xyz_vector.h`` file will be included twice. Before each
|
||||
inclusion, the macros ``VECTOR`` and ``UNUSED`` are defined.
|
||||
|
||||
@@ -290,7 +290,7 @@ file like this:
|
||||
...
|
||||
|
||||
Where the value of ``STM32_IRQ_USART1`` was defined to
|
||||
be 12 in the ``arch/arm/include/stm32/xyz_irq.h`` header
|
||||
be 12 in the ``arch/arm/include/stm32f4/xyz_irq.h`` header
|
||||
file. When ``xyz_vector.h`` is included by ``stm32_vectors.S``
|
||||
with the above definitions for ``VECTOR`` and ``UNUSED``, the
|
||||
following would result:
|
||||
@@ -349,7 +349,7 @@ second time the ``xzy_vector.h`` is included by ``stm32_vectors.S``:
|
||||
In the above USART1 example, a single handler would be
|
||||
generated that will provide the IRQ number 12. Remember
|
||||
that 12 is the expansion of the macro ``STM32_IRQ_USART1``
|
||||
that is provided in the ``arch/arm/include/stm32/xyz_irq.h``
|
||||
that is provided in the ``arch/arm/include/stm32f4/xyz_irq.h``
|
||||
header file:
|
||||
|
||||
.. code-block:: asm
|
||||
|
||||
@@ -34,7 +34,7 @@ This memory allocator is automatically enabled when the following options are se
|
||||
* ``CONFIG_MM_MULTIHEAP`` Support for multiple heaps is enabled.
|
||||
|
||||
Under those conditions, the CCM memory allocator is enabled and the allocator
|
||||
interfaces prototyped in the ``arch/arm/src/stm32/stm32_ccm.h`` are available.
|
||||
interfaces prototyped in the ``arch/arm/src/common/stm32/stm32_ccm.h`` are available.
|
||||
|
||||
NOTE: These interfaces are, technically, not prototyped since they are really
|
||||
provided via C pre-processor macros.
|
||||
|
||||
@@ -52,7 +52,7 @@ In order to build the task into the OS as a kernel thread, you simply have to:
|
||||
(1) place the kernel thread code in your board source code directory, and (2)
|
||||
start it with ``kthread_create()`` in your board bring-up logic. There a few
|
||||
examples of this in the NuttX source tree. Here is one:
|
||||
`https://github.com/apache/nuttx/blob/master/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c <https://github.com/apache/nuttx/blob/master/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri.c>`_
|
||||
`https://github.com/apache/nuttx/blob/master/boards/arm/stm32f1/viewtool-stm32f107/src/stm32_highpri.c <https://github.com/apache/nuttx/blob/master/boards/arm/stm32f1/viewtool-stm32f107/src/stm32_highpri.c>`_
|
||||
|
||||
So that is another trick that you can use to architecture optimal solutions:
|
||||
Create parts of your applications as kernel threads: They need to reside in
|
||||
|
||||
@@ -302,8 +302,8 @@ You can find an example that tests the high priority, nested interrupts in the N
|
||||
* :doc:`/platforms/arm/stm32f1/boards/viewtool-stm32f107/index` Description of
|
||||
the configuration
|
||||
|
||||
* ``nuttx/boards/arm/stm32/viewtool-stm32f107/highpri`` Test configuration
|
||||
* ``nuttx/boards/arm/stm32f1/viewtool-stm32f107/highpri`` Test configuration
|
||||
|
||||
* ``nuttx/boards/arm/stm32/viewtool-stm32f107/src/stm32_highpri`` Test
|
||||
* ``nuttx/boards/arm/stm32f1/viewtool-stm32f107/src/stm32_highpri`` Test
|
||||
driver.
|
||||
|
||||
|
||||
@@ -12,16 +12,16 @@ If you wonder about the purpose of the two ``chip.h`` files in each arm chip.
|
||||
.. code:: sh
|
||||
|
||||
$ find arch/arm -name chip.h | grep stm32
|
||||
arch/arm/include/stm32/chip.h
|
||||
arch/arm/src/stm32/chip.h
|
||||
arch/arm/include/stm32f4/chip.h
|
||||
arch/arm/src/stm32f4/chip.h
|
||||
|
||||
The reason behind ``arch/arm/src/stm32/chip.h`` file was a bad idea
|
||||
The reason behind ``arch/arm/src/stm32f4/chip.h`` file was a bad idea
|
||||
that happened a long time ago.
|
||||
|
||||
Right now, I believe that its only required when ``CONFIG_ARMV7M_CMNVECTOR``
|
||||
is selected in the configuration. In that case, ``arch/arm/src/stm32/chip.h``
|
||||
is selected in the configuration. In that case, ``arch/arm/src/stm32f4/chip.h``
|
||||
is included by ``arch/arm/src/armv7-m/up_vectors.c`` in order provide
|
||||
the number of interrupt vectors. In stm32, ``arch/arm/src/stm32/chip.h``
|
||||
the number of interrupt vectors. In stm32, ``arch/arm/src/stm32f4/chip.h``
|
||||
provides the number of vectors indirectly by including the correct,
|
||||
chip-specific vectors.h file.
|
||||
This function is a little more obvious in ``arch/arm/srch/lpc43xx/chip.h``.
|
||||
|
||||
@@ -135,7 +135,7 @@ Detached File Helpers
|
||||
Once the file structure has been detached from its file descriptor,
|
||||
you can no longer use the standard VFS functions ``read()``, ``write()``,
|
||||
``ioctl()``, etc. Fortunately, there are a parallel set of interfaces
|
||||
that can be used with detached files. These are decribed in detail
|
||||
that can be used with detached files. These are described in detail
|
||||
in ``include/nuttx/fs/fs.h`` and only listed here below:
|
||||
|
||||
.. code-block:: c
|
||||
@@ -153,8 +153,8 @@ in ``include/nuttx/fs/fs.h`` and only listed here below:
|
||||
int file_vfcntl(FAR struct file *filep, int cmd, va_list ap);
|
||||
|
||||
|
||||
The SYLOG Device: A Case Study
|
||||
==============================
|
||||
The SYSLOG Device: A Case Study
|
||||
===============================
|
||||
|
||||
This technique is used for the SYSLOG device. Originally, NuttX used
|
||||
file descriptor ``1`` for SYSLOG output by default. For most task groups,
|
||||
@@ -179,7 +179,7 @@ Other Examples
|
||||
There are some other examples in analog joystick lower half drivers
|
||||
that use the ADC character driver to read joystick positions::
|
||||
|
||||
boards/arm/stm32/nucleo-f4x1re/src/stm32_ajoystick.c:
|
||||
boards/arm/stm32f4/nucleo-f411re/src/stm32_ajoystick.c:
|
||||
ret = file_detach(fd, &g_adcfile);
|
||||
|
||||
boards/arm/stm32l4/nucleo-l476rg/src/stm32_ajoystick.c:
|
||||
|
||||
@@ -35,7 +35,7 @@ to any supported architecture.
|
||||
|
||||
Here is the map of initialization function calls::
|
||||
|
||||
__start()-arch/arm/src/stm32/stm32_start.c
|
||||
__start()-arch/arm/src/common/stm32/stm32_start_m3m4_v1.c
|
||||
|
|
||||
+--*Set stack limit
|
||||
+--stm32_clockconfig()
|
||||
@@ -45,7 +45,7 @@ Here is the map of initialization function calls::
|
||||
+--showprogress('A')
|
||||
+--
|
||||
+--
|
||||
+--stm32_boardinitialize()-boards/arm/stm32/stm32f4discovery/src/stm32_boot.c
|
||||
+--stm32_boardinitialize()-boards/arm/stm32f4/stm32f4discovery/src/stm32_boot.c
|
||||
| |
|
||||
| +--stm32_spidev_initialize()-stm32_spi.c:ONLY CHIP SELECTS
|
||||
| +--stm32_usbinitialize()-
|
||||
@@ -196,7 +196,7 @@ There are few important things to note about this file.
|
||||
``.section .vectors, ax``. This pseudo operation will place all of the
|
||||
vectors into a special section call ``.vectors``.
|
||||
On of the STM32 F4 linker scripts is located at
|
||||
``nuttx/boards/arm/stm32/stm32f4discovery/scripts/ld.script``.
|
||||
``nuttx/boards/arm/stm32f4/stm32f4discovery/scripts/ld.script``.
|
||||
In that file, you can see that section ``.vectors`` is forced to lie
|
||||
at the very beginning of FLASH memory.
|
||||
The STM32 F4 can be configured to boot in different ways via strapping.
|
||||
@@ -229,7 +229,7 @@ nuttx/arch/arm/src/stm32_start.c
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
The reset vector ``__start`` lies in the file
|
||||
``nuttx/arch/arm/src/stm32/stm32_start.c`` and does the real,
|
||||
``nuttx/arch/arm/src/common/stm32/stm32_start_m3m4_v1.c`` and does the real,
|
||||
low-level architecture-specific initialization. This initialization includes:
|
||||
|
||||
1. ``stm32_clockconfig()`` - Initialize the PLLs and peripheral clocking
|
||||
@@ -262,7 +262,7 @@ low-level architecture-specific initialization. This initialization includes:
|
||||
7. ``stm32_boardinitialize()`` - Board-specific logic is initialized by
|
||||
calling this function. For the case of the STM32F4Discovery board,
|
||||
this logic can be found at
|
||||
``nuttx/boards/arm/stm32/stm32f4discovery/src/stm32_boot.c`` and does
|
||||
``nuttx/boards/arm/stm32f4/stm32f4discovery/src/stm32_boot.c`` and does
|
||||
the following operations:
|
||||
|
||||
a. ``stm32_spidev_initialize()`` - Initialize SPI chip selects
|
||||
@@ -351,19 +351,19 @@ file and in that case those operations are not performed:
|
||||
``nx_start()``. However, if the board supports multiple, discontiguous
|
||||
memory regions, any addition memory regions can be added to the heap
|
||||
by this function. For the STM32 F4, ``up_addregion()`` is implemented
|
||||
in ``nuttx/arch/arm/src/stm32/stm32_allocateheap.c``.
|
||||
in ``nuttx/arch/arm/src/common/stm32/stm32_allocateheap_m3m4_v1.c``.
|
||||
|
||||
* ``arm_pminitialize()`` - If ``CONFIG_PM`` is defined, the function must
|
||||
initialize the power management subsystem. This MCU-specific function
|
||||
must be called very early in the intialization sequence before any other
|
||||
must be called very early in the initialization sequence before any other
|
||||
device drivers are initialized (since they may attempt to register with
|
||||
the power management subsystem). There is no implementation
|
||||
of ``up_pminitialize()`` for any STM32 platform.
|
||||
|
||||
* ``arm_dmainitialize()`` - Initialize the DMA subsystem.
|
||||
For the STM32 F4, this DMA initialization can be found in
|
||||
``nuttx/arch/arm/src/stm32/stm32_dma.c`` (which includes
|
||||
``nuttx/arch/arm/src/stm32f4xxx_dma.c``).
|
||||
``nuttx/arch/arm/src/common/stm32/stm32_dma_m3m4_v1_8ch.c`` (which includes
|
||||
``nuttx/arch/arm/src/common/stm32/stm32_dma_m3m4_v1_8ch.c``).
|
||||
|
||||
* ``devnull_register()`` - Registers the standard ``/dev/null``.
|
||||
|
||||
@@ -381,11 +381,11 @@ file and in that case those operations are not performed:
|
||||
(found at ``nuttx/arch/arm/src/common/stm32/stm32_serial_m3m4_v1v2v3v4.c`` STM32 F4).
|
||||
|
||||
* ``arm_netinitialize()`` - Initialize the network. For the STM32 F4,
|
||||
this function is in ``nuttx/arch/arm/src/stm32/stm32_eth.c``.
|
||||
this function is in ``nuttx/arch/arm/src/common/stm32/stm32_eth_m3m4_v1.c``.
|
||||
|
||||
* ``arm_usbinitialize()`` - Initialize USB (host or device).
|
||||
For the STM32 F4, this function is in
|
||||
``nuttx/arch/arm/src/stm32/stm32_otgfsdev.c``.
|
||||
``nuttx/arch/arm/src/common/stm32/stm32_otgfsdev_m3m4_v1.c``.
|
||||
|
||||
* ``arm_l2ccinitialize()`` - Initialize the L2 cache if present
|
||||
and selected.
|
||||
@@ -448,7 +448,7 @@ This function performed the following specific operations:
|
||||
for a variety of purposes like misc garbage clean-up.
|
||||
|
||||
* ``nx_create_initthread()`` - Once the operating system has been initialized,
|
||||
this funcions either directly calls ``nx_start_application()`` or creates
|
||||
this functions either directly calls ``nx_start_application()`` or creates
|
||||
a thread for running it
|
||||
|
||||
* ``nx_start_application()`` - If set in the NuttX configuration,
|
||||
@@ -640,7 +640,7 @@ The resulting ROMFS file system can be found in
|
||||
|
||||
* ``board_app_initialize()`` - For the STM32F4Discovery, this architecture
|
||||
specific initialization can be found at
|
||||
``boards/arm/stm32/stm32f4discovery/src/stm32_appinit.c``.
|
||||
``boards/arm/stm32f4/stm32f4discovery/src/stm32_appinit.c``.
|
||||
This it does things like:
|
||||
|
||||
1. Initialize SPI devices.
|
||||
|
||||
@@ -228,13 +228,13 @@ OpenOCD
|
||||
=======
|
||||
|
||||
I have also used OpenOCD with the M3 Wildfire. In this case, I used
|
||||
the Olimex USB ARM OCD. See the script in boards/arm/stm32/fire-stm32v2/tools/oocd.sh
|
||||
the Olimex USB ARM OCD. See the script in boards/arm/stm32f1/fire-stm32v2/tools/oocd.sh
|
||||
for more information. Using the script:
|
||||
|
||||
- Start the OpenOCD GDB server::
|
||||
|
||||
cd <nuttx-build-directory>
|
||||
boards/arm/stm32/fire-stm32v2/tools/oocd.sh $PWD
|
||||
boards/arm/stm32f1/fire-stm32v2/tools/oocd.sh $PWD
|
||||
|
||||
- Load NuttX::
|
||||
|
||||
|
||||
@@ -517,7 +517,7 @@ NOTES:
|
||||
ADC_IN8 (PB0) CON5 CN14 Pin2
|
||||
ADC_IN9 (PB1) CON5 CN14 Pin1
|
||||
|
||||
The signal selection is hard-coded in boards/arm/stm32/shenzhou/src/up_adc.c: The
|
||||
The signal selection is hard-coded in boards/arm/stm32f1/shenzhou/src/up_adc.c: The
|
||||
potentiometer input (only) is selected.
|
||||
|
||||
These selections will enable sampling the potentiometer input at 100Hz using
|
||||
|
||||
@@ -87,13 +87,13 @@ OpenOCD
|
||||
=======
|
||||
|
||||
I have also used OpenOCD with the STM3210E-EVAL. In this case, I used
|
||||
the Olimex USB ARM OCD. See the script in boards/arm/stm32/stm3210e-eval/tools/oocd.sh
|
||||
the Olimex USB ARM OCD. See the script in boards/arm/stm32f1/stm3210e-eval/tools/oocd.sh
|
||||
for more information. Using the script:
|
||||
|
||||
- Start the OpenOCD GDB server::
|
||||
|
||||
cd <nuttx-build-directory>
|
||||
boards/arm/stm32/stm3210e-eval/tools/oocd.sh $PWD
|
||||
boards/arm/stm32f1/stm3210e-eval/tools/oocd.sh $PWD
|
||||
|
||||
- Load NuttX::
|
||||
|
||||
@@ -171,7 +171,7 @@ More complex temperature sensor operations are also available. See the
|
||||
IOCTL commands enumerated in include/nuttx/sensors/lm75.h. Also read the
|
||||
descriptions of the stm32_lm75initialize() and stm32_lm75attach()
|
||||
interfaces in the arch/board/board.h file (sames as
|
||||
boards/arm/stm32/stm3210e-eval/include/board.h).
|
||||
boards/arm/stm32f1/stm3210e-eval/include/board.h).
|
||||
|
||||
NSH Command Line Application
|
||||
----------------------------
|
||||
@@ -812,7 +812,7 @@ NOTES:
|
||||
CONFIG_ARCH_CUSTOM_PMINIT=y
|
||||
|
||||
CONFIG_ARCH_CUSTOM_PMINIT moves the PM initialization from
|
||||
arch/arm/src/stm32/stm32_pminitialiaze.c to boards/arm/stm32/stm3210-eval/src/stm32_pm.c.
|
||||
arch/arm/src/common/stm32/stm32_pminitialize_m3m4_v1.c to boards/arm/stm32f1/stm3210e-eval/src/stm32_pm.c.
|
||||
This allows us to support board-specific PM initialization.::
|
||||
|
||||
CONFIG_ARCH_IDLE_CUSTOM=y
|
||||
@@ -824,8 +824,8 @@ NOTES:
|
||||
management.
|
||||
|
||||
The configuration CONFIG_ARCH_IDLE_CUSTOM allows us to "steal" the
|
||||
normal STM32 IDLE loop (of arch/arm/src/stm32/stm32_idle.c) and replace
|
||||
this with our own custom IDLE loop (at boards/arm/stm32/stm3210-eval/src/up_idle.c).
|
||||
normal STM32 IDLE loop (of arch/arm/src/common/stm32/stm32_idle_m3m4_v1.c) and replace
|
||||
this with our own custom IDLE loop (at boards/arm/stm32f1/stm3210e-eval/src/up_idle.c).
|
||||
|
||||
4. Here are some additional things to note in the configuration::
|
||||
|
||||
|
||||
@@ -186,7 +186,7 @@ instead of 64KiB as documented in the datasheet and reported by its internal
|
||||
register.
|
||||
|
||||
In order to enable 128KiB you need modify the linker script to reflect this
|
||||
new size. Open the boards/arm/stm32/stm32f103-minimum/scripts/ld.script and replace::
|
||||
new size. Open the boards/arm/stm32f1/stm32f103-minimum/scripts/ld.script and replace::
|
||||
|
||||
flash (rx) : ORIGIN = 0x08000000, LENGTH = 64K
|
||||
|
||||
@@ -358,7 +358,7 @@ enable/disable these options using "make menuconfig" ::
|
||||
Memory Management --->
|
||||
[*] Small memory model
|
||||
|
||||
Also change the boards/arm/stm32/stm32f103-minimum/scripts/ld.script file to use 128KB
|
||||
Also change the boards/arm/stm32f1/stm32f103-minimum/scripts/ld.script file to use 128KB
|
||||
of Flash instead 64KB (since this board has a hidden 64KB flash) :
|
||||
|
||||
MEMORY
|
||||
|
||||
@@ -12,7 +12,7 @@ LEDs
|
||||
|
||||
It is assumed that STMicro STM32F100RB generic board board has one LED on PA0.
|
||||
You should configure the port and pin number in
|
||||
boards/arm/stm32/stm32vldiscovery/src/stm32vldiscovery.h. This LED is not used by
|
||||
boards/arm/stm32f1/stm32vldiscovery/src/stm32vldiscovery.h. This LED is not used by
|
||||
the board port unless CONFIG_ARCH_LEDS is defined. In that case, the usage by
|
||||
the board port is defined in include/board.h and src/up_leds.c. The LED is used
|
||||
to encode OS-related events as follows::
|
||||
|
||||
@@ -79,7 +79,7 @@ Using JTAG
|
||||
|
||||
The Clicker2 comes with the mikroBootloader installed. That bootloader
|
||||
has not been used and is possibly incompatible with the Clicker2-STM32
|
||||
linker script at boards/arm/stm32/clicker2-stm32/scripts/flash.ld. Often code must
|
||||
linker script at boards/arm/stm32f4/clicker2-stm32/scripts/flash.ld. Often code must
|
||||
be built to execute at an offset in to FLASH when a bootloader is used.
|
||||
Certainly that is the case for the ST-Micro DFU bootloader but I am not
|
||||
aware of the requirements for use with the mikroBootloader.
|
||||
|
||||
@@ -79,6 +79,6 @@ package as flexible as, say, an STM32F4 Discovery board.
|
||||
Build Instructions
|
||||
==================
|
||||
|
||||
The boards/arm/stm32/omnibusf4/nsh/defconfig file creates a basic setup, and
|
||||
The boards/arm/stm32f4/omnibusf4/nsh/defconfig file creates a basic setup, and
|
||||
includes drivers for all supported onboard chips. The console and
|
||||
command prompt are sent to USART3.
|
||||
|
||||
@@ -517,7 +517,7 @@ MAPPING TO STM32 F4::
|
||||
4 Also the reset pin for the CS43L22 audio Codec.
|
||||
|
||||
NOTE: The configuration to test this LCD configuration is available at
|
||||
boards/arm/stm32/stm32f4discovery/nxlines. As of this writing, I have not seen the
|
||||
boards/arm/stm32f4/stm32f4discovery/nxlines. As of this writing, I have not seen the
|
||||
LCD working so I probably have some things wrong.
|
||||
|
||||
I might need to use a bit-banging interface. Below is the pin configuration
|
||||
@@ -613,7 +613,7 @@ that I am using::
|
||||
|
||||
Darcy Gong recently added support for the UG-2864HSWEG01 OLED which is also
|
||||
an option with this configuration. I have little technical information about
|
||||
the UG-2864HSWEG01 interface (see boards/arm/stm32/stm32f4discovery/src/up_ug2864hsweg01.c).
|
||||
the UG-2864HSWEG01 interface (see boards/arm/stm32f4/stm32f4discovery/src/up_ug2864hsweg01.c).
|
||||
|
||||
NiceRF LoRa (2AD66-LoRa V2)
|
||||
===========================
|
||||
@@ -639,7 +639,7 @@ connect the CS to PA4, connect RST to PE1 and finally connect INT to PE4.
|
||||
|
||||
The next step is to enable the ENC28J60 in the menuconfig ("make menuconfig")
|
||||
and the necessary Network configuration, you can use the
|
||||
boards/arm/stm32/fire-stm32v2/configs/nsh/defconfig as reference.
|
||||
boards/arm/stm32f1/fire-stm32v2/configs/nsh/defconfig as reference.
|
||||
|
||||
HCI UART
|
||||
========
|
||||
@@ -1202,7 +1202,7 @@ NOTES:
|
||||
The HCI UART selection can be changed by re-configuring and assigning
|
||||
the different U[S]ART to the HCI. The U[S]ART pin selections can be
|
||||
changed by modifying the disambiguation definitions in
|
||||
boards/arm/stm32/stm32f4discovery/include/board.h
|
||||
boards/arm/stm32f4/stm32f4discovery/include/board.h
|
||||
|
||||
I have been testing with the DVK_BT960_SA board via J10 as follows::
|
||||
|
||||
@@ -2021,7 +2021,7 @@ NOTES:
|
||||
CONFIG_ARCH_CUSTOM_PMINIT=y
|
||||
|
||||
CONFIG_ARCH_CUSTOM_PMINIT moves the PM initialization from
|
||||
arch/arm/src/stm32/stm32_pminitialiaze.c to boards/arm/stm32/stm3210-eval/src/stm32_pm.c.
|
||||
arch/arm/src/common/stm32/stm32_pminitialize_m3m4_v1.c to boards/arm/stm32f1/stm3210e-eval/src/stm32_pm.c.
|
||||
This allows us to support board-specific PM initialization.::
|
||||
|
||||
CONFIG_ARCH_IDLE_CUSTOM=y
|
||||
@@ -2033,8 +2033,8 @@ NOTES:
|
||||
management.
|
||||
|
||||
The configuration CONFIG_ARCH_IDLE_CUSTOM allows us to "steal" the
|
||||
normal STM32 IDLE loop (of arch/arm/src/stm32/stm32_idle.c) and replace
|
||||
this with our own custom IDLE loop (at boards/arm/stm32/stm3210-eval/src/up_idle.c).
|
||||
normal STM32 IDLE loop (of arch/arm/src/common/stm32/stm32_idle_m3m4_v1.c) and replace
|
||||
this with our own custom IDLE loop (at boards/arm/stm32f1/stm3210e-eval/src/up_idle.c).
|
||||
|
||||
3. Here are some additional things to note in the configuration::
|
||||
|
||||
|
||||
@@ -389,7 +389,7 @@ Here are a few tips before you start that effort:
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
is arch/arm/src/stm32f4/gnu/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ Here are a few tips before you start that effort:
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
is arch/arm/src/stm32f4/gnu/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ Here are a few tips before you start that effort:
|
||||
on the command line.
|
||||
|
||||
Startup files will probably cause you some headaches. The NuttX startup file
|
||||
is arch/arm/src/stm32/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
is arch/arm/src/stm32f4/gnu/stm32_vectors.S. With RIDE, I have to build NuttX
|
||||
one time from the Cygwin command line in order to obtain the pre-built
|
||||
startup object needed by RIDE.
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ specified by several settings in the NuttX configuration file.
|
||||
sub-directories and are discussed in a paragraph
|
||||
`below <#boards-subdirectory-structure>`__.
|
||||
|
||||
The directory ``boards/arm/stm32/stm32f4disovery/``, as an
|
||||
The directory ``boards/arm/stm32f4/stm32f4discovery/``, as an
|
||||
example, holds board-specific logic for the STM32F4 Discovery
|
||||
board and is selected via the
|
||||
``CONFIG_ARCH_BOARD="stm32f4discovery"`` configuration setting.
|
||||
|
||||
@@ -2918,7 +2918,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
boards/arm/stm32/photon/src/stm32_wlan_firmware.c
|
||||
boards/arm/stm32f2/photon/src/stm32_wlan_firmware.c
|
||||
drivers/wireless/ieee80211/bcm43xxx/bcmf_ioctl.h
|
||||
================================================
|
||||
|
||||
@@ -3249,8 +3249,8 @@ ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
boards/arm/rp2040/common/src/rp2040_ina219.c
|
||||
boards/arm/stm32/common/src/stm32_ina219.c
|
||||
boards/arm/stm32/olimex-stm32-e407/src/stm32_dac.c
|
||||
boards/arm/common/stm32/src/stm32_ina219.c
|
||||
boards/arm/stm32f4/olimex-stm32-e407/src/stm32_dac.c
|
||||
===============================================
|
||||
Copyright (C) 2018,2019 Erle Robotics (Juan Flores Muñoz).
|
||||
All rights reserved.
|
||||
@@ -3282,9 +3282,9 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
boards/arm/stm32/nucleo-f303re/src/stm32_uid.c
|
||||
boards/arm/stm32/omnibusf4/src/stm32_uid.c
|
||||
boards/arm/stm32/stm32f4discovery/src/stm32_uid.c
|
||||
boards/arm/stm32f3/nucleo-f303re/src/stm32_uid.c
|
||||
boards/arm/stm32f4/omnibusf4/src/stm32_uid.c
|
||||
boards/arm/stm32f4/stm32f4discovery/src/stm32_uid.c
|
||||
boards/arm/stm32h7/nucleo-h743zi/src/stm32_uid.c
|
||||
boards/arm/stm32h7/stm32h747i-disco/src/stm32_uid.c
|
||||
===============================================
|
||||
@@ -3317,8 +3317,8 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
boards/arm/stm32/nucleo-f412zg/src/stm32_usb.c
|
||||
boards/arm/stm32/stm32f411e-disco/src/stm32_usb.c
|
||||
boards/arm/stm32f4/nucleo-f412zg/src/stm32_usb.c
|
||||
boards/arm/stm32f4/stm32f411e-disco/src/stm32_usb.c
|
||||
=================================================
|
||||
Copyright (C) 2017 Gregory Nutt. All rights reserved.
|
||||
Copyright (C) 2017 Brian Webb. All rights reserved.
|
||||
@@ -3350,10 +3350,10 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
boards/arm/stm32/omnibusf4/src/stm32_romfs.h
|
||||
boards/arm/stm32/omnibusf4/src/stm32_romfs_initialize.c
|
||||
boards/arm/stm32/stm32f4discovery/src/stm32_romfs.h
|
||||
boards/arm/stm32/stm32f4discovery/src/stm32_romfs_initialize.c
|
||||
boards/arm/stm32f4/omnibusf4/src/stm32_romfs.h
|
||||
boards/arm/stm32f4/omnibusf4/src/stm32_romfs_initialize.c
|
||||
boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs.h
|
||||
boards/arm/stm32f4/stm32f4discovery/src/stm32_romfs_initialize.c
|
||||
boards/arm/stm32f7/common/include/stm32_romfs.h
|
||||
boards/arm/stm32f7/common/src/stm32_romfs_initialize.c
|
||||
=============================================================
|
||||
@@ -3975,7 +3975,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
arch/arm/src/stm32/hardware/stm32f100_pinmap.h
|
||||
arch/arm/src/stm32f1/hardware/stm32f100_pinmap.h
|
||||
=================================================
|
||||
|
||||
Copyright (C) 2009 Gregory Nutt. All rights reserved.
|
||||
@@ -4009,7 +4009,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
arch/arm/src/stm32/hardware/stm32f37xxx_sdadc.h
|
||||
arch/arm/src/stm32f3/hardware/stm32f37xxx_sdadc.h
|
||||
====================================================
|
||||
|
||||
Copyright (C) 2009, 2011, 2013 Gregory Nutt. All rights reserved.
|
||||
@@ -4042,7 +4042,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
arch/arm/src/stm32/stm32_i2c_alt.c
|
||||
arch/arm/src/common/stm32/stm32_i2c_m3m4_v1_alt.c
|
||||
===================================
|
||||
|
||||
Copyright (C) 2011 Uros Platise. All rights reserved.
|
||||
@@ -4076,7 +4076,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
arch/arm/src/stm32/stm32_i2c_v2.c
|
||||
arch/arm/src/common/stm32/stm32_i2c_m3m4_v2.c
|
||||
===========================================
|
||||
|
||||
Copyright (C) 2011 Uros Platise. All rights reserved.
|
||||
@@ -4110,8 +4110,8 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
arch/arm/src/stm32/stm32_sdadc.c
|
||||
arch/arm/src/stm32/stm32_sdadc.h
|
||||
arch/arm/src/common/stm32/stm32_sdadc_m3m4_v1.c
|
||||
arch/arm/src/common/stm32/stm32_sdadc.h
|
||||
===================================
|
||||
|
||||
Copyright (C) 2011, 2013, 2015-2017 Gregory Nutt. All rights reserved.
|
||||
@@ -4144,7 +4144,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
arch/arm/src/stm32/stm32_tickless.c
|
||||
arch/arm/src/common/stm32/stm32_tickless_m3m4_v1.c
|
||||
======================================
|
||||
|
||||
Copyright (C) 2016-2017 Gregory Nutt. All rights reserved.
|
||||
@@ -4177,7 +4177,7 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
arch/arm/src/stm32/stm32_tim_lowerhalf.c
|
||||
arch/arm/src/common/stm32/stm32_tim_m3m4_v1v2v3_lowerhalf.c
|
||||
===========================================
|
||||
|
||||
Copyright (C) 2015 Wail Khemir. All rights reserved.
|
||||
@@ -4210,8 +4210,8 @@ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
arch/arm/src/stm32/stm32_uid.c
|
||||
arch/arm/src/stm32/stm32_uid.h
|
||||
arch/arm/src/common/stm32/stm32_uid_m3m4_v1v2.c
|
||||
arch/arm/src/common/stm32/stm32_uid.h
|
||||
===================================
|
||||
|
||||
Copyright (C) 2015 Marawan Ragab. All rights reserved.
|
||||
|
||||
+38
-6
@@ -1317,8 +1317,16 @@ config ARCH_CHIP
|
||||
default "samd5e5" if ARCH_CHIP_SAMD5X || ARCH_CHIP_SAME5X
|
||||
default "sam34" if ARCH_CHIP_SAM34
|
||||
default "samv7" if ARCH_CHIP_SAMV7
|
||||
default "stm32" if ARCH_CHIP_STM32F1 || ARCH_CHIP_STM32F2 || ARCH_CHIP_STM32F3 || ARCH_CHIP_STM32F4 || ARCH_CHIP_STM32G4 || ARCH_CHIP_STM32L1
|
||||
default "stm32f0l0g0" if ARCH_CHIP_STM32F0 || ARCH_CHIP_STM32L0 || ARCH_CHIP_STM32G0 || ARCH_CHIP_STM32C0
|
||||
default "stm32f1" if ARCH_CHIP_STM32F1
|
||||
default "stm32f2" if ARCH_CHIP_STM32F2
|
||||
default "stm32f3" if ARCH_CHIP_STM32F3
|
||||
default "stm32f4" if ARCH_CHIP_STM32F4
|
||||
default "stm32g4" if ARCH_CHIP_STM32G4
|
||||
default "stm32l1" if ARCH_CHIP_STM32L1
|
||||
default "stm32f0" if ARCH_CHIP_STM32F0
|
||||
default "stm32l0" if ARCH_CHIP_STM32L0
|
||||
default "stm32g0" if ARCH_CHIP_STM32G0
|
||||
default "stm32c0" if ARCH_CHIP_STM32C0
|
||||
default "stm32f7" if ARCH_CHIP_STM32F7
|
||||
default "stm32h7" if ARCH_CHIP_STM32H7
|
||||
default "stm32l4" if ARCH_CHIP_STM32L4
|
||||
@@ -1819,11 +1827,35 @@ endif
|
||||
if ARCH_CHIP_SAMV7
|
||||
source "arch/arm/src/samv7/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32F1 || ARCH_CHIP_STM32F2 || ARCH_CHIP_STM32F3 || ARCH_CHIP_STM32F4 || ARCH_CHIP_STM32G4 || ARCH_CHIP_STM32L1
|
||||
source "arch/arm/src/stm32/Kconfig"
|
||||
if ARCH_CHIP_STM32F1
|
||||
source "arch/arm/src/stm32f1/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32F0 || ARCH_CHIP_STM32L0 || ARCH_CHIP_STM32G0 || ARCH_CHIP_STM32C0
|
||||
source "arch/arm/src/stm32f0l0g0/Kconfig"
|
||||
if ARCH_CHIP_STM32F2
|
||||
source "arch/arm/src/stm32f2/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32F3
|
||||
source "arch/arm/src/stm32f3/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32F4
|
||||
source "arch/arm/src/stm32f4/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32G4
|
||||
source "arch/arm/src/stm32g4/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32L1
|
||||
source "arch/arm/src/stm32l1/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32F0
|
||||
source "arch/arm/src/stm32f0/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32L0
|
||||
source "arch/arm/src/stm32l0/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32G0
|
||||
source "arch/arm/src/stm32g0/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32C0
|
||||
source "arch/arm/src/stm32c0/Kconfig"
|
||||
endif
|
||||
if ARCH_CHIP_STM32F7
|
||||
source "arch/arm/src/stm32f7/Kconfig"
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,491 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/include/stm32l1/chip.h
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_INCLUDE_STM32L1_CHIP_H
|
||||
#define __ARCH_ARM_INCLUDE_STM32L1_CHIP_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/* Get customizations for each supported chip and provide alternate function
|
||||
* pin-mapping
|
||||
*
|
||||
* NOTE: Each GPIO pin may serve either for general purpose I/O or for a
|
||||
* special alternate function (such as USART, CAN, USB, SDIO, etc.). That
|
||||
* particular pin-mapping will depend on the package and STM32 family. If
|
||||
* you are incorporating a new STM32 chip into NuttX, you will need to add
|
||||
* the pin-mapping to a header file and to include that header file below.
|
||||
* The chip-specific pin-mapping is defined in the chip datasheet.
|
||||
*/
|
||||
|
||||
/* STM32L EnergyLite Line ***************************************************/
|
||||
|
||||
/* STM32L151XX -- No LCD
|
||||
* STM32L152XX -- With LCD
|
||||
*
|
||||
* STM32L15XCX -- 48-pins
|
||||
* STM32L15XRX -- 64-pins
|
||||
* STM32L15XVX -- 100-pins
|
||||
* STM32L15XZX -- 144-pins
|
||||
*
|
||||
* STM32L15XX6 -- 32KB FLASH, 10KB SRAM, 4KB EEPROM
|
||||
* STM32L15XX8 -- 64KB FLASH, 10KB SRAM, 4KB EEPROM
|
||||
* STM32L15XXB -- 128KB FLASH, 16KB SRAM, 4KB EEPROM
|
||||
*
|
||||
* STM32L15XXC -- 256KB FLASH, 32KB SRAM, 8KB EEPROM (medium+ density)
|
||||
*
|
||||
* STM32L16XXD -- 384KB FLASH, 48KB SRAM, 12KB EEPROM (high density)
|
||||
* STM32L16XXE -- 512KB FLASH, 80KB SRAM, 16KB EEPROM (high density)
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_ARCH_CHIP_STM32L151C6) || defined(CONFIG_ARCH_CHIP_STM32L151C8) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32L151CB)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 1 /* DMA1, 7-channels */
|
||||
# define STM32_NSPI 2 /* SPI1-2 */
|
||||
# define STM32_NI2S 0 /* No I2S */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 0 /* No LCD */
|
||||
# define STM32_NUSBOTG 0 /* No USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 37 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 14-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 13 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 0 /* No CRC */
|
||||
# define STM32_NETHERNET 0 /* No Ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L151R6) || defined(CONFIG_ARCH_CHIP_STM32L151R8) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32L151RB)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 1 /* DMA1, 7-channels */
|
||||
# define STM32_NSPI 2 /* SPI1-2 */
|
||||
# define STM32_NI2S 0 /* No I2S */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 0 /* No LCD */
|
||||
# define STM32_NUSBOTG 0 /* No USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 51 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 20-channels */
|
||||
# define STM32_NDAC 2 /* DAC , 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 20 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 0 /* No CRC */
|
||||
# define STM32_NETHERNET 0 /* No Ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L151V6) || defined(CONFIG_ARCH_CHIP_STM32L151V8) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32L151VB)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 1 /* DMA1, 7-channels */
|
||||
# define STM32_NSPI 2 /* SPI1-2 */
|
||||
# define STM32_NI2S 0 /* No I2S */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 0 /* No LCD */
|
||||
# define STM32_NUSBOTG 0 /* No USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 83 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 24-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 20 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 0 /* No CRC */
|
||||
# define STM32_NETHERNET 0 /* No Ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L152C6) || defined(CONFIG_ARCH_CHIP_STM32L152C8) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32L152CB)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 1 /* DMA1, 7-channels */
|
||||
# define STM32_NSPI 2 /* SPI1-2 */
|
||||
# define STM32_NI2S 0 /* No I2S */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x18 */
|
||||
# define STM32_NUSBOTG 0 /* No USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 37 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 14-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 13 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 0 /* No CRC */
|
||||
# define STM32_NETHERNET 0 /* No Ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L152R6) || defined(CONFIG_ARCH_CHIP_STM32L152R8) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32L152RB)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 1 /* DMA1, 7-channels */
|
||||
# define STM32_NSPI 2 /* SPI1-2 */
|
||||
# define STM32_NI2S 0 /* No I2S */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x32, 8x28 */
|
||||
# define STM32_NUSBOTG 0 /* No USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 51 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 20-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 20 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 0 /* No CRC */
|
||||
# define STM32_NETHERNET 0 /* No Ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L152V6) || defined(CONFIG_ARCH_CHIP_STM32L152V8) || \
|
||||
defined(CONFIG_ARCH_CHIP_STM32L152VB)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 1 /* DMA1, 7-channels */
|
||||
# define STM32_NSPI 2 /* SPI1-2 */
|
||||
# define STM32_NI2S 0 /* No I2S */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x44, 8x40 */
|
||||
# define STM32_NUSBOTG 0 /* No USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 83 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 24-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 20 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 0 /* No CRC */
|
||||
# define STM32_NETHERNET 0 /* No Ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L152CC)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 7-channels, DMA2 (5 channels) */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x18 */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 37 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 14-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 16 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L152RC)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 7-channels, DMA2 (5 channels) */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x32, 8x28 */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 51 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 21-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 23 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L152VC)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 7-channels, DMA2 (5 channels) */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 3 /* USART1-3 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x44, 8x40 */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 83 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 25-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 23 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L151RE) || defined(CONFIG_ARCH_CHIP_STM32L152RE)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 7-channels, DMA2 (5 channels) */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 5 /* USART1-5 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x44, 8x40 */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 51 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 25-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 23 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L151VE) || defined(CONFIG_ARCH_CHIP_STM32L152VE)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 7-channels, DMA2 (5 channels) */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 5 /* USART1-5 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x44, 8x40 */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 83 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 25-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 23 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L151QE) || defined(CONFIG_ARCH_CHIP_STM32L152QE)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 7-channels, DMA2 (5 channels) */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 5 /* USART1-5 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x44, 8x40 */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 109 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 25-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 33 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L151ZE) || defined(CONFIG_ARCH_CHIP_STM32L152ZE)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 3 /* 16-bit general up/down timers TIM2-4 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 7-channels, DMA2 (5 channels) */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 5 /* USART1-5 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x44, 8x40 */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 115 /* GPIOA-E,H */
|
||||
# define STM32_NADC 1 /* ADC1, 25-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 34 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L162ZD)
|
||||
# define STM32_NFSMC 1 /* FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 4 /* 16-bit general timers TIM2-4 with DMA
|
||||
* 32-bit general timer TIM5 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 without DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 7-channels, DMA2 (5 channels) */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 5 /* USART1-3, UART4-5 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 1 /* SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x44, 8x40 */
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 115 /* GPIOA-G,H */
|
||||
# define STM32_NADC 1 /* ADC1, 40-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 34 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
#elif defined(CONFIG_ARCH_CHIP_STM32L162VE)
|
||||
# define STM32_NFSMC 0 /* No FSMC */
|
||||
# define STM32_NATIM 0 /* No advanced timers */
|
||||
# define STM32_NGTIM 4 /* 16-bit general timers TIM2-4 with DMA
|
||||
* 32-bit general timer TIM5 with DMA */
|
||||
# define STM32_NGTIMNDMA 3 /* 16-bit general timers TIM9-11 without DMA */
|
||||
# define STM32_NBTIM 2 /* 2 basic timers: TIM6, TIM7 with DMA */
|
||||
# define STM32_NDMA 2 /* DMA1, 12-channels */
|
||||
# define STM32_NSPI 3 /* SPI1-3 */
|
||||
# define STM32_NI2S 2 /* I2S1-2, overlapping with SPI2-3 */
|
||||
# define STM32_NUSART 5 /* USART1-3, UART4-5 */
|
||||
# define STM32_NLPUART 0 /* No LPUART */
|
||||
# define STM32_NI2C 2 /* I2C1-2 */
|
||||
# define STM32_NCAN 0 /* No CAN */
|
||||
# define STM32_NSDIO 0 /* No SDIO */
|
||||
# define STM32_NLCD 1 /* LCD 4x44, 8x40*/
|
||||
# define STM32_NUSBOTG 1 /* USB OTG FS/HS (only USB 2.0 device) */
|
||||
# define STM32_NGPIO 83 /* GPIOA-G,H */
|
||||
|
||||
# define STM32_NADC 1 /* ADC1, 25-channels */
|
||||
# define STM32_NDAC 2 /* DAC 1, 2 channels */
|
||||
# define STM32_NCMP 2 /* (2) Comparators */
|
||||
# define STM32_NCAPSENSE 23 /* Capacitive sensing channels */
|
||||
# define STM32_NCRC 1 /* CRC */
|
||||
# define STM32_NETHERNET 0 /* No ethernet */
|
||||
# define STM32_NRNG 0 /* No random number generator (RNG) */
|
||||
# define STM32_NDCMI 0 /* No digital camera interface (DCMI) */
|
||||
|
||||
/* STM32 F100 Value Line ****************************************************/
|
||||
|
||||
#else
|
||||
# error "Unsupported STM32 chip"
|
||||
#endif
|
||||
|
||||
/* Peripheral IP versions ***************************************************/
|
||||
|
||||
/* Peripheral IP versions are invariant and should be decided here, not in
|
||||
* Kconfig.
|
||||
*
|
||||
* REVISIT: Currently only SPI IP version is handled here, with others being
|
||||
* handled in Kconfig. Those others need to be gradually refactored
|
||||
* and resolved here.
|
||||
*/
|
||||
|
||||
#define STM32_HAVE_IP_SPI_V1
|
||||
|
||||
/* NVIC priority levels *****************************************************/
|
||||
|
||||
#define NVIC_SYSH_PRIORITY_MIN 0xf0 /* All bits set in minimum priority */
|
||||
#define NVIC_SYSH_PRIORITY_DEFAULT 0x80 /* Midpoint is the default */
|
||||
#define NVIC_SYSH_PRIORITY_MAX 0x00 /* Zero is maximum priority */
|
||||
#define NVIC_SYSH_PRIORITY_STEP 0x10 /* Four bits of interrupt priority used */
|
||||
|
||||
#endif /* __ARCH_ARM_INCLUDE_STM32L1_CHIP_H */
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/include/stm32/stm32l15xxx_irq.h
|
||||
* arch/arm/include/stm32l1/irq.h
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
@@ -20,12 +20,12 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* This file should never be included directly but, rather, only indirectly
|
||||
* through nuttx/irq.h
|
||||
/* This file should never be included directly but, rather,
|
||||
* only indirectly through nuttx/irq.h
|
||||
*/
|
||||
|
||||
#ifndef __ARCH_ARM_INCLUDE_STM32_STM32FL15XXX_IRQ_H
|
||||
#define __ARCH_ARM_INCLUDE_STM32_STM32FL15XXX_IRQ_H
|
||||
#ifndef __ARCH_ARM_INCLUDE_STM32L1_IRQ_H
|
||||
#define __ARCH_ARM_INCLUDE_STM32L1_IRQ_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
@@ -33,22 +33,45 @@
|
||||
|
||||
#include <nuttx/config.h>
|
||||
#include <nuttx/irq.h>
|
||||
#include <arch/stm32l1/chip.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/* IRQ numbers. The IRQ number corresponds vector number and hence map
|
||||
* directly to bits in the NVIC. This does, however, waste several words of
|
||||
* memory in the IRQ to handle mapping tables.
|
||||
*
|
||||
* Processor Exceptions (vectors 0-15). These common definitions can be
|
||||
* found in nuttx/arch/arm/include/stm32/irq.h
|
||||
*
|
||||
* External interrupts (vectors >= 16) for low and medium density devices
|
||||
/* IRQ numbers.
|
||||
* The IRQ number corresponds vector number and hence map directly to
|
||||
* bits in the NVIC. This does, however, waste several words of memory in
|
||||
* the IRQ to handle mapping tables.
|
||||
*/
|
||||
|
||||
#if defined(CONFIG_STM32_LOWDENSITY) || defined(CONFIG_STM32_MEDIUMDENSITY)
|
||||
/* Processor Exceptions (vectors 0-15) */
|
||||
|
||||
#define STM32_IRQ_RESERVED (0) /* Reserved vector (only used with CONFIG_DEBUG_FEATURES) */
|
||||
/* Vector 0: Reset stack pointer value */
|
||||
/* Vector 1: Reset (not handler as an IRQ) */
|
||||
#define STM32_IRQ_NMI (2) /* Vector 2: Non-Maskable Interrupt (NMI) */
|
||||
#define STM32_IRQ_HARDFAULT (3) /* Vector 3: Hard fault */
|
||||
#define STM32_IRQ_MEMFAULT (4) /* Vector 4: Memory management (MPU) */
|
||||
#define STM32_IRQ_BUSFAULT (5) /* Vector 5: Bus fault */
|
||||
#define STM32_IRQ_USAGEFAULT (6) /* Vector 6: Usage fault */
|
||||
#define STM32_IRQ_SVCALL (11) /* Vector 11: SVC call */
|
||||
#define STM32_IRQ_DBGMONITOR (12) /* Vector 12: Debug Monitor */
|
||||
/* Vector 13: Reserved */
|
||||
#define STM32_IRQ_PENDSV (14) /* Vector 14: Pendable system service request */
|
||||
#define STM32_IRQ_SYSTICK (15) /* Vector 15: System tick */
|
||||
|
||||
/* External interrupts (vectors >= 16).
|
||||
* These definitions are chip-specific
|
||||
*/
|
||||
|
||||
#define STM32_IRQ_FIRST (16) /* Vector number of the first external interrupt */
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_STM32L1_LOWDENSITY) || defined(CONFIG_STM32L1_MEDIUMDENSITY)
|
||||
# define STM32_IRQ_WWDG (STM32_IRQ_FIRST + 0) /* 0: Window Watchdog interrupt */
|
||||
# define STM32_IRQ_PVD (STM32_IRQ_FIRST + 1) /* 1: PVD through EXTI Line detection interrupt */
|
||||
# define STM32_IRQ_TAMPER (STM32_IRQ_FIRST + 2) /* 2: Tamper through EXTI line interrupt, or */
|
||||
@@ -98,8 +121,6 @@
|
||||
|
||||
# define STM32_IRQ_NEXTINTS (45)
|
||||
|
||||
/* External interrupts (vectors >= 16) medium+ density devices */
|
||||
|
||||
#elif defined(CONFIG_STM32_MEDIUMPLUSDENSITY)
|
||||
# define STM32_IRQ_WWDG (STM32_IRQ_FIRST + 0) /* 0: Window Watchdog interrupt */
|
||||
# define STM32_IRQ_PVD (STM32_IRQ_FIRST + 1) /* 1: PVD through EXTI Line detection interrupt */
|
||||
@@ -160,9 +181,7 @@
|
||||
|
||||
# define STM32_IRQ_NEXTINTS (54)
|
||||
|
||||
/* External interrupts (vectors >= 16) high density devices */
|
||||
|
||||
#elif defined(CONFIG_STM32_HIGHDENSITY)
|
||||
#elif defined(CONFIG_STM32L1_HIGHDENSITY)
|
||||
# define STM32_IRQ_WWDG (STM32_IRQ_FIRST + 0) /* 0: Window Watchdog interrupt */
|
||||
# define STM32_IRQ_PVD (STM32_IRQ_FIRST + 1) /* 1: PVD through EXTI Line detection interrupt */
|
||||
# define STM32_IRQ_TAMPER (STM32_IRQ_FIRST + 2) /* 2: Tamper through EXTI line interrupt, or */
|
||||
@@ -230,31 +249,4 @@
|
||||
|
||||
# define NR_IRQS (STM32_IRQ_FIRST + STM32_IRQ_NEXTINTS)
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ASSEMBLY__
|
||||
#ifdef __cplusplus
|
||||
#define EXTERN extern "C"
|
||||
extern "C"
|
||||
{
|
||||
#else
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#endif /* __ARCH_ARM_INCLUDE_STM32_STM32FL15XXX_IRQ_H */
|
||||
#endif /* __ARCH_ARM_INCLUDE_STM32L1_IRQ_H */
|
||||
@@ -227,9 +227,8 @@ if(CONFIG_STM32_COMMON_LEGACY)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_ADC
|
||||
AND (CONFIG_STM32_HAVE_IP_ADC_M3M4_V1
|
||||
OR CONFIG_STM32_HAVE_IP_ADC_M3M4_V2))
|
||||
if(CONFIG_STM32_ADC AND (CONFIG_STM32_HAVE_IP_ADC_M3M4_V1
|
||||
OR CONFIG_STM32_HAVE_IP_ADC_M3M4_V2))
|
||||
list(APPEND SRCS stm32_adc_m3m4_v1v2.c)
|
||||
endif()
|
||||
|
||||
@@ -237,9 +236,8 @@ if(CONFIG_STM32_COMMON_LEGACY)
|
||||
list(APPEND SRCS stm32_sdadc_m3m4_v1.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_STM32_DAC
|
||||
AND (CONFIG_STM32_HAVE_IP_DAC_M3M4_V1
|
||||
OR CONFIG_STM32_HAVE_IP_DAC_M3M4_V2))
|
||||
if(CONFIG_STM32_DAC AND (CONFIG_STM32_HAVE_IP_DAC_M3M4_V1
|
||||
OR CONFIG_STM32_HAVE_IP_DAC_M3M4_V2))
|
||||
list(APPEND SRCS stm32_dac_m3m4_v1.c)
|
||||
endif()
|
||||
|
||||
@@ -358,12 +356,7 @@ if(CONFIG_STM32_COMMON_LEGACY)
|
||||
endif()
|
||||
|
||||
if(CONFIG_ARCH_CORTEXM0)
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
stm32_irq_m0_v1.c
|
||||
stm32_start_m0_v1.c
|
||||
stm32_lsi_m0_v1.c)
|
||||
list(APPEND SRCS stm32_irq_m0_v1.c stm32_start_m0_v1.c stm32_lsi_m0_v1.c)
|
||||
|
||||
if(CONFIG_STM32_HAVE_IP_GPIO_M0_V1)
|
||||
list(APPEND SRCS stm32_gpio_m0_v1.c)
|
||||
|
||||
@@ -1093,7 +1093,7 @@ int stm32_dma2dinitialize(void)
|
||||
stm32_dma2duninitialize();
|
||||
|
||||
/* Enable dma2d is done in rcc_enableahb1, see
|
||||
* arch/arm/src/stm32/stm32f40xxx_rcc.c
|
||||
* arch/arm/src/stm32f4/stm32_rcc.c
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_STM32_FB_CMAP
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* Ported from arch/arm/src/stm32/stm32_dma_v1mux.c */
|
||||
/* Ported from arch/arm/src/common/stm32/stm32_dma_m0_v1_7ch_dmamux.c */
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "stm32_gpio.h"
|
||||
#include "stm32_rcc.h"
|
||||
|
||||
/* Ported from arch/arm/src/stm32/stm32_fdcan.c */
|
||||
/* Ported from arch/arm/src/common/stm32/stm32_fdcan_m0_v1.c */
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
||||
@@ -1,57 +0,0 @@
|
||||
# ##############################################################################
|
||||
# arch/arm/src/stm32/CMakeLists.txt
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# 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
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
# ##############################################################################
|
||||
|
||||
set(SRCS)
|
||||
|
||||
list(
|
||||
APPEND
|
||||
SRCS
|
||||
stm32_allocateheap.c
|
||||
stm32_start.c
|
||||
stm32_rcc.c
|
||||
stm32_lse.c
|
||||
stm32_lsi.c
|
||||
stm32_irq.c
|
||||
stm32_lowputc.c)
|
||||
|
||||
if(CONFIG_STM32_TICKLESS_TIMER)
|
||||
list(APPEND SRCS stm32_tickless.c)
|
||||
else()
|
||||
list(APPEND SRCS stm32_timerisr.c)
|
||||
endif()
|
||||
|
||||
if(CONFIG_BUILD_PROTECTED)
|
||||
list(APPEND SRCS stm32_userspace.c stm32_mpuinit.c)
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_ARCH_IDLE_CUSTOM)
|
||||
list(APPEND SRCS stm32_idle.c)
|
||||
endif()
|
||||
|
||||
list(APPEND SRCS stm32_pmstop.c stm32_pmstandby.c stm32_pmsleep.c)
|
||||
|
||||
if(NOT CONFIG_ARCH_CUSTOM_PMINIT)
|
||||
list(APPEND SRCS stm32_pminitialize.c)
|
||||
endif()
|
||||
|
||||
target_sources(arch PRIVATE ${SRCS})
|
||||
add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../common/stm32 stm32_common)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,206 +0,0 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/stm32/hardware/stm32f10xxx_uart.h
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32_HARDWARE_STM32F10XXX_UART_H
|
||||
#define __ARCH_ARM_SRC_STM32_HARDWARE_STM32F10XXX_UART_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Register Offsets *********************************************************/
|
||||
|
||||
#define STM32_USART_SR_OFFSET 0x0000 /* Status register (32-bits) */
|
||||
#define STM32_USART_DR_OFFSET 0x0004 /* Data register (32-bits) */
|
||||
#define STM32_USART_BRR_OFFSET 0x0008 /* Baud Rate Register (32-bits) */
|
||||
#define STM32_USART_CR1_OFFSET 0x000c /* Control register 1 (32-bits) */
|
||||
#define STM32_USART_CR2_OFFSET 0x0010 /* Control register 2 (32-bits) */
|
||||
#define STM32_USART_CR3_OFFSET 0x0014 /* Control register 3 (32-bits) */
|
||||
#define STM32_USART_GTPR_OFFSET 0x0018 /* Guard time and prescaler register (32-bits) */
|
||||
|
||||
/* Register Addresses *******************************************************/
|
||||
|
||||
#if STM32_NUSART > 0
|
||||
# define STM32_USART1_SR (STM32_USART1_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_USART1_DR (STM32_USART1_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_USART1_BRR (STM32_USART1_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_USART1_CR1 (STM32_USART1_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_USART1_CR2 (STM32_USART1_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_USART1_CR3 (STM32_USART1_BASE+STM32_USART_CR3_OFFSET)
|
||||
# define STM32_USART1_GTPR (STM32_USART1_BASE+STM32_USART_GTPR_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 1
|
||||
# define STM32_USART2_SR (STM32_USART2_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_USART2_DR (STM32_USART2_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_USART2_BRR (STM32_USART2_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_USART2_CR1 (STM32_USART2_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_USART2_CR2 (STM32_USART2_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_USART2_CR3 (STM32_USART2_BASE+STM32_USART_CR3_OFFSET)
|
||||
# define STM32_USART2_GTPR (STM32_USART2_BASE+STM32_USART_GTPR_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 2
|
||||
# define STM32_USART3_SR (STM32_USART3_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_USART3_DR (STM32_USART3_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_USART3_BRR (STM32_USART3_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_USART3_CR1 (STM32_USART3_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_USART3_CR2 (STM32_USART3_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_USART3_CR3 (STM32_USART3_BASE+STM32_USART_CR3_OFFSET)
|
||||
# define STM32_USART3_GTPR (STM32_USART3_BASE+STM32_USART_GTPR_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 3
|
||||
# define STM32_UART4_SR (STM32_UART4_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_UART4_DR (STM32_UART4_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_UART4_BRR (STM32_UART4_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_UART4_CR1 (STM32_UART4_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_UART4_CR2 (STM32_UART4_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_UART4_CR3 (STM32_UART4_BASE+STM32_USART_CR3_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 4
|
||||
# define STM32_UART5_SR (STM32_UART5_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_UART5_DR (STM32_UART5_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_UART5_BRR (STM32_UART5_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_UART5_CR1 (STM32_UART5_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_UART5_CR2 (STM32_UART5_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_UART5_CR3 (STM32_UART5_BASE+STM32_USART_CR3_OFFSET)
|
||||
#endif
|
||||
|
||||
/* Register Bitfield Definitions ********************************************/
|
||||
|
||||
/* Status register */
|
||||
|
||||
#define USART_SR_PE (1 << 0) /* Bit 0: Parity Error */
|
||||
#define USART_SR_FE (1 << 1) /* Bit 1: Framing Error */
|
||||
#define USART_SR_NE (1 << 2) /* Bit 2: Noise Error Flag */
|
||||
#define USART_SR_ORE (1 << 3) /* Bit 3: OverRun Error */
|
||||
#define USART_SR_IDLE (1 << 4) /* Bit 4: IDLE line detected */
|
||||
#define USART_SR_RXNE (1 << 5) /* Bit 5: Read Data Register Not Empty */
|
||||
#define USART_SR_TC (1 << 6) /* Bit 6: Transmission Complete */
|
||||
#define USART_SR_TXE (1 << 7) /* Bit 7: Transmit Data Register Empty */
|
||||
#define USART_SR_LBD (1 << 8) /* Bit 8: LIN Break Detection Flag */
|
||||
#define USART_SR_CTS (1 << 9) /* Bit 9: CTS Flag */
|
||||
|
||||
#define USART_SR_ALLBITS (0x03ff)
|
||||
#define USART_SR_CLRBITS (USART_SR_CTS|USART_SR_LBD) /* Cleared by SW write to SR */
|
||||
|
||||
/* Data register */
|
||||
|
||||
#define USART_DR_SHIFT (0) /* Bits 8:0: Data value */
|
||||
#define USART_DR_MASK (0xff << USART_DR_SHIFT)
|
||||
|
||||
/* Baud Rate Register */
|
||||
|
||||
#define USART_BRR_FRAC_SHIFT (0) /* Bits 3-0: fraction of USARTDIV */
|
||||
#define USART_BRR_FRAC_MASK (0x0f << USART_BRR_FRAC_SHIFT)
|
||||
#define USART_BRR_MANT_SHIFT (4) /* Bits 15-4: mantissa of USARTDIV */
|
||||
#define USART_BRR_MANT_MASK (0x0fff << USART_BRR_MANT_SHIFT)
|
||||
|
||||
/* Control register 1 */
|
||||
|
||||
#define USART_CR1_SBK (1 << 0) /* Bit 0: Send Break */
|
||||
#define USART_CR1_RWU (1 << 1) /* Bit 1: Receiver wakeup */
|
||||
#define USART_CR1_RE (1 << 2) /* Bit 2: Receiver Enable */
|
||||
#define USART_CR1_TE (1 << 3) /* Bit 3: Transmitter Enable */
|
||||
#define USART_CR1_IDLEIE (1 << 4) /* Bit 4: IDLE Interrupt Enable */
|
||||
#define USART_CR1_RXNEIE (1 << 5) /* Bit 5: RXNE Interrupt Enable */
|
||||
#define USART_CR1_TCIE (1 << 6) /* Bit 6: Transmission Complete Interrupt Enable */
|
||||
#define USART_CR1_TXEIE (1 << 7) /* Bit 7: TXE Interrupt Enable */
|
||||
#define USART_CR1_PEIE (1 << 8) /* Bit 8: PE Interrupt Enable */
|
||||
#define USART_CR1_PS (1 << 9) /* Bit 9: Parity Selection */
|
||||
#define USART_CR1_PCE (1 << 10) /* Bit 10: Parity Control Enable */
|
||||
#define USART_CR1_WAKE (1 << 11) /* Bit 11: Wakeup method */
|
||||
#define USART_CR1_M (1 << 12) /* Bit 12: word length */
|
||||
#define USART_CR1_UE (1 << 13) /* Bit 13: USART Enable */
|
||||
|
||||
#define USART_CR1_ALLINTS (USART_CR1_IDLEIE|USART_CR1_RXNEIE|USART_CR1_TCIE|USART_CR1_PEIE)
|
||||
|
||||
/* Control register 2 */
|
||||
|
||||
#define USART_CR2_ADD_SHIFT (0) /* Bits 3-0: Address of the USART node */
|
||||
#define USART_CR2_ADD_MASK (0x0f << USART_CR2_ADD_SHIFT)
|
||||
#define USART_CR2_LBDL (1 << 5) /* Bit 5: LIN Break Detection Length */
|
||||
#define USART_CR2_LBDIE (1 << 6) /* Bit 6: LIN Break Detection Interrupt Enable */
|
||||
#define USART_CR2_LBCL (1 << 8) /* Bit 8: Last Bit Clock pulse */
|
||||
#define USART_CR2_CPHA (1 << 9) /* Bit 9: Clock Phase */
|
||||
#define USART_CR2_CPOL (1 << 10) /* Bit 10: Clock Polarity */
|
||||
#define USART_CR2_CLKEN (1 << 11) /* Bit 11: Clock Enable */
|
||||
#define USART_CR2_STOP_SHIFT (12) /* Bits 13-12: STOP bits */
|
||||
#define USART_CR2_STOP_MASK (3 << USART_CR2_STOP_SHIFT)
|
||||
# define USART_CR2_STOP1 (0 << USART_CR2_STOP_SHIFT) /* 00: 1 Stop bit */
|
||||
# define USART_CR2_STOP0p5 (1 << USART_CR2_STOP_SHIFT) /* 01: 0.5 Stop bit */
|
||||
# define USART_CR2_STOP2 (2 << USART_CR2_STOP_SHIFT) /* 10: 2 Stop bits */
|
||||
# define USART_CR2_STOP1p5 (3 << USART_CR2_STOP_SHIFT) /* 11: 1.5 Stop bit */
|
||||
|
||||
#define USART_CR2_LINEN (1 << 14) /* Bit 14: LIN mode enable */
|
||||
|
||||
/* Control register 3 */
|
||||
|
||||
#define USART_CR3_EIE (1 << 0) /* Bit 0: Error Interrupt Enable */
|
||||
#define USART_CR3_IREN (1 << 1) /* Bit 1: IrDA mode Enable */
|
||||
#define USART_CR3_IRLP (1 << 2) /* Bit 2: IrDA Low-Power */
|
||||
#define USART_CR3_HDSEL (1 << 3) /* Bit 3: Half-Duplex Selection */
|
||||
#define USART_CR3_NACK (1 << 4) /* Bit 4: Smartcard NACK enable */
|
||||
#define USART_CR3_SCEN (1 << 5) /* Bit 5: Smartcard mode enable */
|
||||
#define USART_CR3_DMAR (1 << 6) /* Bit 6: DMA Enable Receiver */
|
||||
#define USART_CR3_DMAT (1 << 7) /* Bit 7: DMA Enable Transmitter */
|
||||
#define USART_CR3_RTSE (1 << 8) /* Bit 8: RTS Enable */
|
||||
#define USART_CR3_CTSE (1 << 9) /* Bit 9: CTS Enable */
|
||||
#define USART_CR3_CTSIE (1 << 10) /* Bit 10: CTS Interrupt Enable */
|
||||
|
||||
/* Guard time and prescaler register */
|
||||
|
||||
#define USART_GTPR_PSC_SHIFT (0) /* Bits 0-7: Prescaler value */
|
||||
#define USART_GTPR_PSC_MASK (0xff << USART_GTPR_PSC_SHIFT)
|
||||
#define USART_GTPR_GT_SHIFT (8) /* Bits 8-15: Guard time value */
|
||||
#define USART_GTPR_GT_MASK (0xff << USART_GTPR_GT_SHIFT)
|
||||
|
||||
/* Compatibility definitions ************************************************/
|
||||
|
||||
/* F3 Transmit/Read registers */
|
||||
|
||||
#define STM32_USART_RDR_OFFSET STM32_USART_DR_OFFSET /* Receive data register */
|
||||
#define STM32_USART_TDR_OFFSET STM32_USART_DR_OFFSET /* Transmit data register */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32_HARDWARE_STM32F10XXX_UART_H */
|
||||
@@ -1,218 +0,0 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/stm32/hardware/stm32f20xxx_uart.h
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __ARCH_ARM_SRC_STM32_HARDWARE_STM32F20XXX_UART_H
|
||||
#define __ARCH_ARM_SRC_STM32_HARDWARE_STM32F20XXX_UART_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include "chip.h"
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/* Register Offsets *********************************************************/
|
||||
|
||||
#define STM32_USART_SR_OFFSET 0x0000 /* Status register (32-bits) */
|
||||
#define STM32_USART_DR_OFFSET 0x0004 /* Data register (32-bits) */
|
||||
#define STM32_USART_BRR_OFFSET 0x0008 /* Baud Rate Register (32-bits) */
|
||||
#define STM32_USART_CR1_OFFSET 0x000c /* Control register 1 (32-bits) */
|
||||
#define STM32_USART_CR2_OFFSET 0x0010 /* Control register 2 (32-bits) */
|
||||
#define STM32_USART_CR3_OFFSET 0x0014 /* Control register 3 (32-bits) */
|
||||
#define STM32_USART_GTPR_OFFSET 0x0018 /* Guard time and prescaler register (32-bits) */
|
||||
|
||||
/* Register Addresses *******************************************************/
|
||||
|
||||
#if STM32_NUSART > 0
|
||||
# define STM32_USART1_SR (STM32_USART1_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_USART1_DR (STM32_USART1_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_USART1_BRR (STM32_USART1_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_USART1_CR1 (STM32_USART1_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_USART1_CR2 (STM32_USART1_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_USART1_CR3 (STM32_USART1_BASE+STM32_USART_CR3_OFFSET)
|
||||
# define STM32_USART1_GTPR (STM32_USART1_BASE+STM32_USART_GTPR_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 1
|
||||
# define STM32_USART2_SR (STM32_USART2_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_USART2_DR (STM32_USART2_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_USART2_BRR (STM32_USART2_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_USART2_CR1 (STM32_USART2_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_USART2_CR2 (STM32_USART2_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_USART2_CR3 (STM32_USART2_BASE+STM32_USART_CR3_OFFSET)
|
||||
# define STM32_USART2_GTPR (STM32_USART2_BASE+STM32_USART_GTPR_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 2
|
||||
# define STM32_USART3_SR (STM32_USART3_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_USART3_DR (STM32_USART3_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_USART3_BRR (STM32_USART3_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_USART3_CR1 (STM32_USART3_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_USART3_CR2 (STM32_USART3_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_USART3_CR3 (STM32_USART3_BASE+STM32_USART_CR3_OFFSET)
|
||||
# define STM32_USART3_GTPR (STM32_USART3_BASE+STM32_USART_GTPR_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 3
|
||||
# define STM32_UART4_SR (STM32_UART4_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_UART4_DR (STM32_UART4_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_UART4_BRR (STM32_UART4_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_UART4_CR1 (STM32_UART4_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_UART4_CR2 (STM32_UART4_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_UART4_CR3 (STM32_UART4_BASE+STM32_USART_CR3_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 4
|
||||
# define STM32_UART5_SR (STM32_UART5_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_UART5_DR (STM32_UART5_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_UART5_BRR (STM32_UART5_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_UART5_CR1 (STM32_UART5_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_UART5_CR2 (STM32_UART5_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_UART5_CR3 (STM32_UART5_BASE+STM32_USART_CR3_OFFSET)
|
||||
#endif
|
||||
|
||||
#if STM32_NUSART > 5
|
||||
# define STM32_USART6_SR (STM32_USART6_BASE+STM32_USART_SR_OFFSET)
|
||||
# define STM32_USART6_DR (STM32_USART6_BASE+STM32_USART_DR_OFFSET)
|
||||
# define STM32_USART6_BRR (STM32_USART6_BASE+STM32_USART_BRR_OFFSET)
|
||||
# define STM32_USART6_CR1 (STM32_USART6_BASE+STM32_USART_CR1_OFFSET)
|
||||
# define STM32_USART6_CR2 (STM32_USART6_BASE+STM32_USART_CR2_OFFSET)
|
||||
# define STM32_USART6_CR3 (STM32_USART6_BASE+STM32_USART_CR3_OFFSET)
|
||||
# define STM32_USART6_GTPR (STM32_USART6_BASE+STM32_USART_GTPR_OFFSET)
|
||||
#endif
|
||||
|
||||
/* Register Bitfield Definitions ********************************************/
|
||||
|
||||
/* Status register */
|
||||
|
||||
#define USART_SR_PE (1 << 0) /* Bit 0: Parity Error */
|
||||
#define USART_SR_FE (1 << 1) /* Bit 1: Framing Error */
|
||||
#define USART_SR_NE (1 << 2) /* Bit 2: Noise Error Flag */
|
||||
#define USART_SR_ORE (1 << 3) /* Bit 3: OverRun Error */
|
||||
#define USART_SR_IDLE (1 << 4) /* Bit 4: IDLE line detected */
|
||||
#define USART_SR_RXNE (1 << 5) /* Bit 5: Read Data Register Not Empty */
|
||||
#define USART_SR_TC (1 << 6) /* Bit 6: Transmission Complete */
|
||||
#define USART_SR_TXE (1 << 7) /* Bit 7: Transmit Data Register Empty */
|
||||
#define USART_SR_LBD (1 << 8) /* Bit 8: LIN Break Detection Flag */
|
||||
#define USART_SR_CTS (1 << 9) /* Bit 9: CTS Flag */
|
||||
|
||||
#define USART_SR_ALLBITS (0x03ff)
|
||||
#define USART_SR_CLRBITS (USART_SR_CTS|USART_SR_LBD) /* Cleared by SW write to SR */
|
||||
|
||||
/* Data register */
|
||||
|
||||
#define USART_DR_SHIFT (0) /* Bits 8:0: Data value */
|
||||
#define USART_DR_MASK (0xff << USART_DR_SHIFT)
|
||||
|
||||
/* Baud Rate Register */
|
||||
|
||||
#define USART_BRR_FRAC_SHIFT (0) /* Bits 3-0: fraction of USARTDIV */
|
||||
#define USART_BRR_FRAC_MASK (0x0f << USART_BRR_FRAC_SHIFT)
|
||||
#define USART_BRR_MANT_SHIFT (4) /* Bits 15-4: mantissa of USARTDIV */
|
||||
#define USART_BRR_MANT_MASK (0x0fff << USART_BRR_MANT_SHIFT)
|
||||
|
||||
/* Control register 1 */
|
||||
|
||||
#define USART_CR1_SBK (1 << 0) /* Bit 0: Send Break */
|
||||
#define USART_CR1_RWU (1 << 1) /* Bit 1: Receiver wakeup */
|
||||
#define USART_CR1_RE (1 << 2) /* Bit 2: Receiver Enable */
|
||||
#define USART_CR1_TE (1 << 3) /* Bit 3: Transmitter Enable */
|
||||
#define USART_CR1_IDLEIE (1 << 4) /* Bit 4: IDLE Interrupt Enable */
|
||||
#define USART_CR1_RXNEIE (1 << 5) /* Bit 5: RXNE Interrupt Enable */
|
||||
#define USART_CR1_TCIE (1 << 6) /* Bit 6: Transmission Complete Interrupt Enable */
|
||||
#define USART_CR1_TXEIE (1 << 7) /* Bit 7: TXE Interrupt Enable */
|
||||
#define USART_CR1_PEIE (1 << 8) /* Bit 8: PE Interrupt Enable */
|
||||
#define USART_CR1_PS (1 << 9) /* Bit 9: Parity Selection */
|
||||
#define USART_CR1_PCE (1 << 10) /* Bit 10: Parity Control Enable */
|
||||
#define USART_CR1_WAKE (1 << 11) /* Bit 11: Wakeup method */
|
||||
#define USART_CR1_M (1 << 12) /* Bit 12: word length */
|
||||
#define USART_CR1_UE (1 << 13) /* Bit 13: USART Enable */
|
||||
#define USART_CR1_OVER8 (1 << 15) /* Bit 15: Oversampling mode */
|
||||
|
||||
#define USART_CR1_ALLINTS (USART_CR1_IDLEIE|USART_CR1_RXNEIE|USART_CR1_TCIE|USART_CR1_PEIE)
|
||||
|
||||
/* Control register 2 */
|
||||
|
||||
#define USART_CR2_ADD_SHIFT (0) /* Bits 3-0: Address of the USART node */
|
||||
#define USART_CR2_ADD_MASK (0x0f << USART_CR2_ADD_SHIFT)
|
||||
#define USART_CR2_LBDL (1 << 5) /* Bit 5: LIN Break Detection Length */
|
||||
#define USART_CR2_LBDIE (1 << 6) /* Bit 6: LIN Break Detection Interrupt Enable */
|
||||
#define USART_CR2_LBCL (1 << 8) /* Bit 8: Last Bit Clock pulse */
|
||||
#define USART_CR2_CPHA (1 << 9) /* Bit 9: Clock Phase */
|
||||
#define USART_CR2_CPOL (1 << 10) /* Bit 10: Clock Polarity */
|
||||
#define USART_CR2_CLKEN (1 << 11) /* Bit 11: Clock Enable */
|
||||
#define USART_CR2_STOP_SHIFT (12) /* Bits 13-12: STOP bits */
|
||||
#define USART_CR2_STOP_MASK (3 << USART_CR2_STOP_SHIFT)
|
||||
# define USART_CR2_STOP1 (0 << USART_CR2_STOP_SHIFT) /* 00: 1 Stop bit */
|
||||
# define USART_CR2_STOP0p5 (1 << USART_CR2_STOP_SHIFT) /* 01: 0.5 Stop bit */
|
||||
# define USART_CR2_STOP2 (2 << USART_CR2_STOP_SHIFT) /* 10: 2 Stop bits */
|
||||
# define USART_CR2_STOP1p5 (3 << USART_CR2_STOP_SHIFT) /* 11: 1.5 Stop bit */
|
||||
|
||||
#define USART_CR2_LINEN (1 << 14) /* Bit 14: LIN mode enable */
|
||||
|
||||
/* Control register 3 */
|
||||
|
||||
#define USART_CR3_EIE (1 << 0) /* Bit 0: Error Interrupt Enable */
|
||||
#define USART_CR3_IREN (1 << 1) /* Bit 1: IrDA mode Enable */
|
||||
#define USART_CR3_IRLP (1 << 2) /* Bit 2: IrDA Low-Power */
|
||||
#define USART_CR3_HDSEL (1 << 3) /* Bit 3: Half-Duplex Selection */
|
||||
#define USART_CR3_NACK (1 << 4) /* Bit 4: Smartcard NACK enable */
|
||||
#define USART_CR3_SCEN (1 << 5) /* Bit 5: Smartcard mode enable */
|
||||
#define USART_CR3_DMAR (1 << 6) /* Bit 6: DMA Enable Receiver */
|
||||
#define USART_CR3_DMAT (1 << 7) /* Bit 7: DMA Enable Transmitter */
|
||||
#define USART_CR3_RTSE (1 << 8) /* Bit 8: RTS Enable */
|
||||
#define USART_CR3_CTSE (1 << 9) /* Bit 9: CTS Enable */
|
||||
#define USART_CR3_CTSIE (1 << 10) /* Bit 10: CTS Interrupt Enable */
|
||||
#define USART_CR3_ONEBIT (1 << 11) /* Bit 11: One sample bit method enable */
|
||||
|
||||
/* Guard time and prescaler register */
|
||||
|
||||
#define USART_GTPR_PSC_SHIFT (0) /* Bits 0-7: Prescaler value */
|
||||
#define USART_GTPR_PSC_MASK (0xff << USART_GTPR_PSC_SHIFT)
|
||||
#define USART_GTPR_GT_SHIFT (8) /* Bits 8-15: Guard time value */
|
||||
#define USART_GTPR_GT_MASK (0xff << USART_GTPR_GT_SHIFT)
|
||||
|
||||
/* Compatibility definitions ************************************************/
|
||||
|
||||
/* F3 Transmit/Read registers */
|
||||
|
||||
#define STM32_USART_RDR_OFFSET STM32_USART_DR_OFFSET /* Receive data register */
|
||||
#define STM32_USART_TDR_OFFSET STM32_USART_DR_OFFSET /* Transmit data register */
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#endif /* __ARCH_ARM_SRC_STM32_HARDWARE_STM32F20XXX_UART_H */
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user