-
Datei
peripheral_STM32L452.c
/* Boxlib (c) 2021 by Malte Marwedel SPDX-License-Identifier: BSD-3-Clause */ #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include <stddef.h> #include "boxlib/peripheral.h" #include "main.h" #include "boxlib/lcd.h" #include "boxlib/flash.h" #include "boxlib/spiGeneric.h" #include "spiPlatform.h" void PeripheralBaseInit(void) { GPIO_InitTypeDef GPIO_InitStruct = {0}; __HAL_RCC_GPIOA_CLK_ENABLE(); //Backlight, power off pin __HAL_RCC_GPIOB_CLK_ENABLE(); //SPI2 pins __HAL_RCC_GPIOC_CLK_ENABLE(); //FlashCs, Lcd A0, LcdCs HAL_GPIO_WritePin(GPIOC, FlashCs_Pin | LcdA0_Pin | LcdCs_Pin, GPIO_PIN_RESET
in „STM32: SPI - HAL durch eigenen code ersetzen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
peripheralDma_STM32L452.c
/* Boxlib (c) 2025 by Malte Marwedel SPDX-License-Identifier: BSD-3-Clause */ #include <stdint.h> #include <stddef.h> #include <stdbool.h> #include <stdio.h> #include "boxlib/peripheralDma.h" #include "boxlib/peripheral.h" #include "boxlib/spiGeneric.h" #include "spiPlatform.h" #include "main.h" static uint8_t g_spi2Started; //0: Stopped, 1 = tx only, 2 = rx + tx //These values must fit together and are defined in the datasheet #define SPIPORT SPI2 #define DMACHANNELTX DMA1_Channel5 #define DMACHANNELTXSELECTION (1 << DMA_CSELR_C5S_Pos) #define DMACHANNELTXSELECTIONCLEAR DMA_CSELR_C5S_Msk #define
in „STM32: SPI - HAL durch eigenen code ersetzen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
spiPlatform_STM32L452.h
#pragma once /* Boxlib (c) 2025 by Malte Marwedel SPDX-License-Identifier: BSD-3-Clause */ #include <stdbool.h> #include <stdint.h> #include <stdio.h> #include "main.h" #define SPIQUEUEDEPTH 4 /*Initalizes the SPI to run in master mode with 8 bit data width, manual chip select and a divider of 64. The clock to the SPI has to be enabled before. pSpi: Give the desired SPI: SPI1, SPI2, SPI3 etc. Defined in the stm32******.h */ static inline void SpiPlatformInit(SPI_TypeDef * pSpi) { pSpi->CR1 = 0; pSpi->CR1 = SPI_CR1_MSTR | SPI_BAUDRATEPRESCALER_64 | SPI_CR1_SSM | SPI_CR1_SSI; pSpi->CR2 = SPI_CR2_DS
in „STM32: SPI - HAL durch eigenen code ersetzen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
stm32-families.txt
)Ix 462 STM32L451R(C-E)Tx 462 STM32L451R(C-E)Yx 462 STM32L451V(C-E)Ix 462 STM32L451V(C-E)Tx 462 STM32L452C(C-E)Ux 462 STM32L452R(C-E)Ix 462 STM32L452R(C-E)Tx 462 STM32L452R(C-E)Yx 462 STM32L452RETxP 462 STM32L452V(C-E)Ix 462 STM32L452V(C-E)Tx 462 STM32L462CEUx 462 STM32L462REIx 462 STM32L462RETx 462
in „Controller mit größerem Flash als angegeben?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
spiGeneric.h
STM32F411, according to the datasheet there the buffers seems to support only one element. For the STM32L452, the datasheet mentions 32bit of FIFO. This should be 4x 8bit data. As result, there will be an interruption for the STM32F411 between one byte sent and the next one put into the TX buffer, whereas the STM32L452 could work without interruption and reach the maximum possible SPI speed. */ size_t inQueue = 0; const size_t inQueueMax = SPIQUEUEDEPTH; //defined by hardware bool success = true; bool timeout =
in „STM32: SPI - HAL durch eigenen code ersetzen“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
stm32-families.txt
STM32L451R(C-E)Tx DIE462 STM32L451R(C-E)Yx DIE462 STM32L451V(C-E)Ix DIE462 STM32L451V(C-E)Tx DIE462 STM32L452C(C-E)Ux DIE462 STM32L452R(C-E)Ix DIE462 STM32L452R(C-E)Tx DIE462 STM32L452R(C-E)Yx DIE462 STM32L452RETxP DIE462 STM32L452V(C-E)Ix DIE462 STM32L452V(C-E)Tx DIE462 STM32L462CEUx DIE462 STM32L462REIx
in „Controller mit größerem Flash als angegeben?“ · Mikrocontroller und Digitale Elektronik ·
-
Datei
stm32-families.txt
STM32L451R(C-E)Tx DIE462 STM32L451R(C-E)Yx DIE462 STM32L451V(C-E)Ix DIE462 STM32L451V(C-E)Tx DIE462 STM32L452C(C-E)Ux DIE462 STM32L452CETx DIE462 STM32L452R(C-E)Ix DIE462 STM32L452R(C-E)Tx DIE462 STM32L452R(C-E)Yx DIE462 STM32L452RETxP DIE462 STM32L452V(C-E)Ix DIE462 STM32L452V(C-E)Tx DIE462 STM32L462CETx
in „Controller mit größerem Flash als angegeben?“ · Mikrocontroller und Digitale Elektronik ·
-
PDF
bom-v1-0.pdf
MCP 6542-I/SN 0,55 € 0,55 € U50 1AT45DB641-S, 64MBit SPI flash AT45DB641E-SHN 3,58 € 3,58 € U60 1STM32L452RET, 80MHz, 160KiB RAM 189-4029 8,22 € 8,22 €min order 2 U61 1Low power comparator, 1x MCP 65R41T-2402E 0,43 € 0,43 € U100, U101 2BD6221F-E2, motor driver 7-15V, 1A 699-6746 3,11 € 6,22 € U110 1MAX3221
in „Universalplatine für STM32, grobe Fehler vor der Herstellung?“ · Mikrocontroller und Digitale Elektronik ·