HAL to LL migration: GPIO, HSEM, AES (#1069)

* gpio, hsem, crypto: switch from HAL to LL/registers
* Moved GPIO initialization to furi_hal
* More HAL removed
* All HAL modules disabled
* HAL is finally removed
* hal_gpio -> furi_hal_gpio, main.h removed
* Bootloader build fix
* RTOS config moved to freertos-glue
* delay -> furi_hal_delay

Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
Nikolay Minaylov
2022-03-30 18:23:40 +03:00
committed by GitHub
parent 648d8aaa54
commit 2f3ea9494e
93 changed files with 921 additions and 1270 deletions

View File

@@ -5,10 +5,8 @@
#include <stdbool.h>
#include <limits.h>
#include <cmsis_os2.h>
#include <gpio.h>
#include "timer.h"
#include "math.h"
#include "main.h"
#include <furi_hal_gpio.h>
#include <furi_hal_light.h>
#include <furi_hal_spi.h>
@@ -18,7 +16,7 @@ void platformSetIrqCallback(PlatformIrqCallback cb);
void platformEnableIrqCallback();
void platformDisableIrqCallback();
HAL_StatusTypeDef platformSpiTxRx(const uint8_t* txBuf, uint8_t* rxBuf, uint16_t len);
bool platformSpiTxRx(const uint8_t* txBuf, uint8_t* rxBuf, uint16_t len);
void platformProtectST25RComm();
void platformUnprotectST25RComm();
@@ -87,11 +85,18 @@ void platformUnprotectST25RComm();
#define platformUnprotectST25RIrqStatus() \
platformUnprotectST25RComm() /*!< Unprotect the IRQ status var - IRQ enable on a single thread environment (MCU) ; Mutex unlock on a multi thread environment */
#define platformGpioSet(port, pin) LL_GPIO_SetOutputPin(port, pin)
#define platformGpioSet(port, pin) \
furi_hal_gpio_write_port_pin( \
port, pin, true) /*!< Turns the given GPIO High */
#define platformGpioClear(port, pin) \
furi_hal_gpio_write_port_pin( \
port, pin, false) /*!< Turns the given GPIO Low */
#define platformGpioClear(port, pin) LL_GPIO_ResetOutputPin(port, pin)
#define platformGpioIsHigh(port, pin) LL_GPIO_IsInputPinSet(port, pin)
#define platformGpioIsHigh(port, pin) \
(furi_hal_gpio_read_port_pin(port, pin) == \
true) /*!< Checks if the given LED is High */
#define platformGpioIsLow(port, pin) \
(!platformGpioIsHigh(port, pin)) /*!< Checks if the given LED is Low */
#define platformTimerCreate(t) \
timerCalculateTimer(t) /*!< Create a timer with the given time (ms) */