Moved FPC BM-Lite SDK to a separate folder
Moved FPC BM-Lite SDK to a reparate folder Checking result of execution of every command on BM-Lite Change-Id: I10ef898673dd2250b8e287ace86e7d7574ab40fc
This commit is contained in:
parent
630568b4d1
commit
02bf23c840
1
.vscode/c_cpp_properties.json
vendored
1
.vscode/c_cpp_properties.json
vendored
@ -20,6 +20,7 @@
|
|||||||
"/usr/arm-none-eabi/include/c++/7.3.1/arm-none-eabi",
|
"/usr/arm-none-eabi/include/c++/7.3.1/arm-none-eabi",
|
||||||
"/usr/arm-none-eabi/include/c++/7.3.1/backward",
|
"/usr/arm-none-eabi/include/c++/7.3.1/backward",
|
||||||
"${workspaceFolder}/BMLite_example/inc",
|
"${workspaceFolder}/BMLite_example/inc",
|
||||||
|
"${workspaceFolder}/BMLite_sdk/inc",
|
||||||
"${workspaceFolder}/HAL_Driver/CMSIS/Include",
|
"${workspaceFolder}/HAL_Driver/CMSIS/Include",
|
||||||
"${workspaceFolder}/HAL_Driver/inc",
|
"${workspaceFolder}/HAL_Driver/inc",
|
||||||
"${workspaceFolder}/HAL_Driver/sdk",
|
"${workspaceFolder}/HAL_Driver/sdk",
|
||||||
|
|||||||
@ -27,6 +27,7 @@ OUT := out
|
|||||||
DEPTH :=
|
DEPTH :=
|
||||||
HCP_PATH := ../hcp
|
HCP_PATH := ../hcp
|
||||||
MCUHAL_PATH := ../HAL_Driver
|
MCUHAL_PATH := ../HAL_Driver
|
||||||
|
BMLITE_PATH := ../BMLite_sdk
|
||||||
|
|
||||||
# Main target
|
# Main target
|
||||||
TARGET := $(OUT)/$(PRODUCT)
|
TARGET := $(OUT)/$(PRODUCT)
|
||||||
@ -72,6 +73,8 @@ PATH_INC += inc
|
|||||||
|
|
||||||
C_INC = $(addprefix -I,$(PATH_INC))
|
C_INC = $(addprefix -I,$(PATH_INC))
|
||||||
|
|
||||||
|
# Include BM-Lite SDK
|
||||||
|
include $(BMLITE_PATH)/bmlite.mk
|
||||||
# Include HAL
|
# Include HAL
|
||||||
include $(MCUHAL_PATH)/nordic.mk
|
include $(MCUHAL_PATH)/nordic.mk
|
||||||
|
|
||||||
|
|||||||
@ -89,8 +89,7 @@ void bmlite_on_identify_start()
|
|||||||
|
|
||||||
int main (int argc, char **argv)
|
int main (int argc, char **argv)
|
||||||
{
|
{
|
||||||
int baudrate = 4000000;
|
platform_init(NULL);
|
||||||
platform_init(baudrate);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
char version[100];
|
char version[100];
|
||||||
|
|||||||
13
BMLite_sdk/bmlite.mk
Normal file
13
BMLite_sdk/bmlite.mk
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Binary sources
|
||||||
|
|
||||||
|
BMLITE_SDK = $(DEPTH)../BMLite_sdk
|
||||||
|
|
||||||
|
VPATH += $(BMLITE_SDK)
|
||||||
|
|
||||||
|
C_INC += -I$(BMLITE_SDK)/inc
|
||||||
|
|
||||||
|
# Source Folders
|
||||||
|
VPATH += $(BMLITE_SDK)/src/
|
||||||
|
|
||||||
|
# C Sources
|
||||||
|
C_SRCS += $(notdir $(wildcard $(BMLITE_SDK)/src/*.c))
|
||||||
@ -1,5 +1,5 @@
|
|||||||
/**
|
/**
|
||||||
* @file bmlite.h
|
* @file bmlite_hal.h
|
||||||
* @brief BM-Lite HAL functions.
|
* @brief BM-Lite HAL functions.
|
||||||
*
|
*
|
||||||
* All functions must be implemented in order to support BM-Lite on a Board
|
* All functions must be implemented in order to support BM-Lite on a Board
|
||||||
@ -8,10 +8,18 @@
|
|||||||
#ifndef BMLITE_H
|
#ifndef BMLITE_H
|
||||||
#define BMLITE_H
|
#define BMLITE_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "fpc_bep_types.h"
|
#include "fpc_bep_types.h"
|
||||||
|
|
||||||
|
#ifdef __arm__
|
||||||
|
typedef uint32_t hal_tick_t;
|
||||||
|
#else
|
||||||
|
typedef uint64_t hal_tick_t;
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief LED status.
|
* @brief LED status.
|
||||||
*
|
*
|
||||||
@ -29,10 +37,10 @@ typedef enum {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Board initialization
|
* @brief Board initialization
|
||||||
* @param[in] SPI CLK speed
|
* @param[in] params - pointer to additional parameters
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void hal_board_init(uint32_t speed_hz);
|
fpc_bep_result_t hal_board_init(void *params);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @brief Control BM-Lite Reset pin
|
* @brief Control BM-Lite Reset pin
|
||||||
@ -68,7 +76,7 @@ void hal_timebase_init(void);
|
|||||||
*
|
*
|
||||||
* @return Tick count since hal_timebase_init() call. [ms]
|
* @return Tick count since hal_timebase_init() call. [ms]
|
||||||
*/
|
*/
|
||||||
uint32_t hal_timebase_get_tick(void);
|
hal_tick_t hal_timebase_get_tick(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Busy wait.
|
* @brief Busy wait.
|
||||||
@ -17,8 +17,9 @@
|
|||||||
#ifndef FPC_BEP_TYPES_H
|
#ifndef FPC_BEP_TYPES_H
|
||||||
#define FPC_BEP_TYPES_H
|
#define FPC_BEP_TYPES_H
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
/**
|
/**
|
||||||
* @file fpc_bep_types.h
|
* @file fpc_bep_types.h
|
||||||
* @brief Biometric Embedded Platform types.
|
* @brief Biometric Embedded Platform types.
|
||||||
@ -31,9 +31,9 @@
|
|||||||
/**
|
/**
|
||||||
* @brief Initializes board
|
* @brief Initializes board
|
||||||
*
|
*
|
||||||
* @param[in] speed_hz Baudrate.
|
* @param[in] params - pointer to additional parameters.
|
||||||
*/
|
*/
|
||||||
bool platform_init(uint32_t speed_hz);
|
fpc_bep_result_t platform_init(void *params);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Does BM-Lite HW Reset
|
* @brief Does BM-Lite HW Reset
|
||||||
@ -7,9 +7,10 @@
|
|||||||
#include "bmlite_if_callbacks.h"
|
#include "bmlite_if_callbacks.h"
|
||||||
|
|
||||||
#define MAX_CAPTURE_ATTEMPTS 15
|
#define MAX_CAPTURE_ATTEMPTS 15
|
||||||
|
#define MAX_SINGLE_CAPTURE_ATTEMPTS 3
|
||||||
#define CAPTURE_TIMEOUT 3000
|
#define CAPTURE_TIMEOUT 3000
|
||||||
|
|
||||||
#define exit_if_err(c) { bep_result = c; if(bep_result) goto exit; }
|
#define exit_if_err(c) { bep_result = c; if(bep_result || chain->bep_result) goto exit; }
|
||||||
|
|
||||||
#define assert(c) { fpc_bep_result_t res = c; if(res) return res; }
|
#define assert(c) { fpc_bep_result_t res = c; if(res) return res; }
|
||||||
|
|
||||||
@ -79,7 +80,11 @@ fpc_bep_result_t bep_capture(HCP_comm_t *chain, uint16_t timeout)
|
|||||||
|
|
||||||
bmlite_on_start_capture();
|
bmlite_on_start_capture();
|
||||||
chain->phy_rx_timeout = timeout;
|
chain->phy_rx_timeout = timeout;
|
||||||
|
for(int i=0; i< MAX_SINGLE_CAPTURE_ATTEMPTS; i++) {
|
||||||
bep_result = bmlite_send_cmd_arg(chain, CMD_CAPTURE, ARG_NONE, ARG_TIMEOUT, &timeout, sizeof(timeout));
|
bep_result = bmlite_send_cmd_arg(chain, CMD_CAPTURE, ARG_NONE, ARG_TIMEOUT, &timeout, sizeof(timeout));
|
||||||
|
if( !(bep_result || chain->bep_result))
|
||||||
|
break;
|
||||||
|
}
|
||||||
chain->phy_rx_timeout = prev_timeout;
|
chain->phy_rx_timeout = prev_timeout;
|
||||||
bmlite_on_finish_capture();
|
bmlite_on_finish_capture();
|
||||||
|
|
||||||
@ -24,13 +24,15 @@
|
|||||||
#include "platform.h"
|
#include "platform.h"
|
||||||
#include "bmlite_hal.h"
|
#include "bmlite_hal.h"
|
||||||
|
|
||||||
bool platform_init(uint32_t speed_hz)
|
fpc_bep_result_t platform_init(void *params)
|
||||||
{
|
{
|
||||||
hal_board_init(4000000);
|
fpc_bep_result_t result;
|
||||||
|
result = hal_board_init(params);
|
||||||
|
if(result == FPC_BEP_RESULT_OK) {
|
||||||
hal_timebase_init();
|
hal_timebase_init();
|
||||||
|
|
||||||
platform_bmlite_reset();
|
platform_bmlite_reset();
|
||||||
return true;
|
}
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform_bmlite_reset(void)
|
void platform_bmlite_reset(void)
|
||||||
@ -37,8 +37,9 @@ static void nordic_bmlite_gpio_init(void);
|
|||||||
void nordic_bmlite_spi_init(uint32_t speed_hz);
|
void nordic_bmlite_spi_init(uint32_t speed_hz);
|
||||||
|
|
||||||
|
|
||||||
void hal_board_init(uint32_t speed_hz)
|
fpc_bep_result_t hal_board_init(void *params)
|
||||||
{
|
{
|
||||||
|
(void)params;
|
||||||
|
|
||||||
if (NRF_UICR->REGOUT0 != UICR_REGOUT0_VOUT_3V3)
|
if (NRF_UICR->REGOUT0 != UICR_REGOUT0_VOUT_3V3)
|
||||||
{
|
{
|
||||||
@ -52,9 +53,10 @@ void hal_board_init(uint32_t speed_hz)
|
|||||||
NRF_USBD->ENABLE = 1;
|
NRF_USBD->ENABLE = 1;
|
||||||
|
|
||||||
nordic_bmlite_gpio_init();
|
nordic_bmlite_gpio_init();
|
||||||
nordic_bmlite_spi_init(speed_hz);
|
nordic_bmlite_spi_init(4000000);
|
||||||
bsp_board_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS);
|
bsp_board_init(BSP_INIT_LEDS | BSP_INIT_BUTTONS);
|
||||||
|
|
||||||
|
return FPC_BEP_RESULT_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void hal_bmlite_reset(bool state)
|
void hal_bmlite_reset(bool state)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user