Cleanup headers in souce code

Change-Id: Ib277c3116e5116467a5a73a262ea2da5c12f4f21
This commit is contained in:
Andrey Perminov 2020-04-21 09:02:39 -07:00
parent 4b46dd7a7a
commit b86b821549
5 changed files with 50 additions and 61 deletions

View File

@ -29,9 +29,9 @@
#include "fpc_com_result.h"
/**
* @brief LED colors.
* @brief LED status.
*
* Different LED colors.
* Different LED status.
*/
typedef enum {
BMLITE_LED_STATUS_READY = 0,

View File

@ -24,16 +24,12 @@
* @brief Main file for FPC BM-Lite Communication example.
*/
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "bep_host_if.h"
#include "com_common.h"
#include "platform.h"
// #include "fpc_hal_interfaces.h"
void bmlite_on_error(bmlite_error_t error, int32_t value)
{
@ -113,12 +109,9 @@ int main (int argc, char **argv)
uint32_t current_id = 0;
bool match;
// These two lines for debug purpose only
memset(version, 0, 100);
fpc_bep_result_t res = bep_version(&hcp_chain, version, 99);
if (res == FPC_BEP_RESULT_OK)
{
printf("%s\n", version);
}
platform_set_led(BMLITE_LED_STATUS_READY);

View File

@ -1,36 +1,33 @@
/*
* Copyright (c) 2019 Fingerprint Cards AB <tech@fingerprints.com>
* Copyright (c) 2020 Fingerprint Cards AB
*
* All rights are reserved.
* Proprietary and confidential.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Any use is subject to an appropriate license granted by Fingerprint Cards AB.
* Licensed 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
*
* https://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.
*/
/**
* @file sensor.c
* @brief Sensor control functions.
* @file board_hal.c
* @brief Board Specific functions
*/
#include <string.h>
#include <stdbool.h>
#include "nrf_gpio.h"
#include "nrf_drv_spi.h"
#include "app_util_platform.h"
#include "nrf_gpio.h"
#include "nrf_delay.h"
#include "boards.h"
#include "app_error.h"
#include <string.h>
#define NRF_LOG_MODULE_NAME APP
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_gpio.h"
#include "nrf_gpiote.h"
#include "nrf_drv_gpiote.h"
#include "bmlite.h"
#include "platform_spi.h"
// #include "fpc_timebase.h"
#define FPC_PIN_RESET ARDUINO_2_PIN
#define FPC_PIN_INTERRUPT ARDUINO_A2_PIN

View File

@ -1,24 +1,27 @@
/*
* Copyright (c) 2019 Fingerprint Cards AB <tech@fingerprints.com>
* Copyright (c) 2020 Fingerprint Cards AB
*
* All rights are reserved.
* Proprietary and confidential.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Any use is subject to an appropriate license granted by Fingerprint Cards AB.
* Licensed 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
*
* https://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.
*/
/**
* @file btns_leds.c
* @brief Sensor control functions.
* @file board_leds.c
* @brief Leds control functions.
*/
#include "boards.h"
#include "btns_leds.h"
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
/** LED ON time in ms */
#define LED_SOLID_ON_TIME_MS 700

View File

@ -1,31 +1,27 @@
/*
* Copyright (c) 2019 Fingerprint Cards AB <tech@fingerprints.com>
* Copyright (c) 2020 Fingerprint Cards AB
*
* All rights are reserved.
* Proprietary and confidential.
* Unauthorized copying of this file, via any medium is strictly prohibited.
* Any use is subject to an appropriate license granted by Fingerprint Cards AB.
* Licensed 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
*
* https://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.
*/
/**
* @file spi.c
* @file platform_spi.c
* @brief SPI functions
*/
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#include "nrf_drv_spi.h"
#include "app_util_platform.h"
#include "nrf_gpio.h"
#include "nrf_delay.h"
#include "boards.h"
#include "app_error.h"
#include <string.h>
#define NRF_LOG_MODULE_NAME APP
#include "nrf_log.h"
#include "nrf_log_ctrl.h"
#include "nrf_gpio.h"
#include "nrf_gpiote.h"
#include "nrf_drv_gpiote.h"
@ -68,7 +64,7 @@ static void spi_write_read(uint8_t *write, uint8_t *read, size_t size, bool leav
nrf_drv_gpiote_out_clear(BMLITE_CS_PIN);
APP_ERROR_CHECK(nrf_drv_spi_transfer(&spi, m_tx_buf, size, m_rx_buf, size));
nrf_drv_spi_transfer(&spi, m_tx_buf, size, m_rx_buf, size);
while (!spi_xfer_done)
{
@ -106,9 +102,9 @@ void nordic_bmlite_spi_init(uint32_t speed_hz)
spi_config.mosi_pin = BMLITE_MOSI_PIN;
spi_config.sck_pin = BMLITE_CLK_PIN;
spi_config.frequency = NRF_SPI_FREQ_8M;// default to 8M for now
APP_ERROR_CHECK(nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL));
nrf_drv_spi_init(&spi, &spi_config, spi_event_handler, NULL);
nrf_drv_gpiote_out_config_t out_config = GPIOTE_CONFIG_OUT_SIMPLE(true);
APP_ERROR_CHECK(nrf_drv_gpiote_out_init(BMLITE_CS_PIN, &out_config));
nrf_drv_gpiote_out_init(BMLITE_CS_PIN, &out_config);
}