Refactor F2/local before F3 merge (#220)
* add files from f3 * rollback lfs * Move assets from LFS * remove lfs from build Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 130 B After Width: | Height: | Size: 18 KiB |
@@ -1,14 +1,16 @@
|
||||
#include "platform.h"
|
||||
#include <assert.h>
|
||||
#include <main.h>
|
||||
#include <spi.h>
|
||||
|
||||
HAL_StatusTypeDef platformSpiTxRx(const uint8_t *txBuf, uint8_t *rxBuf, uint16_t len) {
|
||||
HAL_StatusTypeDef ret;
|
||||
if (txBuf && rxBuf) {
|
||||
ret = HAL_SPI_TransmitReceive(&hspi3, (uint8_t*)txBuf, rxBuf, len, HAL_MAX_DELAY);
|
||||
ret = HAL_SPI_TransmitReceive(&SPI_R, (uint8_t*)txBuf, rxBuf, len, HAL_MAX_DELAY);
|
||||
} else if (txBuf) {
|
||||
ret = HAL_SPI_Transmit(&hspi3, (uint8_t*)txBuf, len, HAL_MAX_DELAY);
|
||||
ret = HAL_SPI_Transmit(&SPI_R, (uint8_t*)txBuf, len, HAL_MAX_DELAY);
|
||||
} else if (rxBuf) {
|
||||
ret = HAL_SPI_Receive(&hspi3, (uint8_t*)rxBuf, len, HAL_MAX_DELAY);
|
||||
ret = HAL_SPI_Receive(&SPI_R, (uint8_t*)rxBuf, len, HAL_MAX_DELAY);
|
||||
}
|
||||
|
||||
if(ret != HAL_OK) {
|
||||
@@ -20,27 +22,7 @@ HAL_StatusTypeDef platformSpiTxRx(const uint8_t *txBuf, uint8_t *rxBuf, uint16_t
|
||||
|
||||
void platformProtectST25RComm()
|
||||
{
|
||||
if (HAL_SPI_DeInit(&hspi3) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
|
||||
hspi3.Init.Mode = SPI_MODE_MASTER;
|
||||
hspi3.Init.Direction = SPI_DIRECTION_2LINES;
|
||||
hspi3.Init.DataSize = SPI_DATASIZE_8BIT;
|
||||
hspi3.Init.CLKPolarity = SPI_POLARITY_LOW;
|
||||
hspi3.Init.CLKPhase = SPI_PHASE_2EDGE;
|
||||
hspi3.Init.NSS = SPI_NSS_SOFT;
|
||||
hspi3.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_64;
|
||||
hspi3.Init.FirstBit = SPI_FIRSTBIT_MSB;
|
||||
hspi3.Init.TIMode = SPI_TIMODE_DISABLE;
|
||||
hspi3.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;
|
||||
hspi3.Init.CRCPolynomial = 7;
|
||||
hspi3.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;
|
||||
hspi3.Init.NSSPMode = SPI_NSS_PULSE_DISABLE;
|
||||
|
||||
if (HAL_SPI_Init(&hspi3) != HAL_OK) {
|
||||
Error_Handler();
|
||||
}
|
||||
NFC_SPI_Reconfigure();
|
||||
}
|
||||
|
||||
void platformUnprotectST25RComm()
|
||||
|
@@ -5,7 +5,7 @@
|
||||
#include <stdbool.h>
|
||||
#include <limits.h>
|
||||
#include <cmsis_os2.h>
|
||||
#include "stm32l4xx_hal.h"
|
||||
#include <gpio.h>
|
||||
#include "timer.h"
|
||||
#include "math.h"
|
||||
#include "spi.h"
|
||||
@@ -18,8 +18,8 @@ void platformUnprotectST25RComm();
|
||||
#define ST25R_SS_PIN NFC_CS_Pin
|
||||
#define ST25R_SS_PORT NFC_CS_GPIO_Port
|
||||
|
||||
#define ST25R_INT_PIN RFID_PULL_Pin
|
||||
#define ST25R_INT_PORT RFID_PULL_GPIO_Port
|
||||
#define ST25R_INT_PIN NFC_IRQ_Pin
|
||||
#define ST25R_INT_PORT NFC_IRQ_GPIO_Port
|
||||
|
||||
#define RFAL_FEATURE_LISTEN_MODE true /*!< Enable/Disable RFAL support for Listen Mode */
|
||||
#define RFAL_FEATURE_WAKEUP_MODE true /*!< Enable/Disable RFAL support for the Wake-Up mode */
|
||||
|
Reference in New Issue
Block a user