diff --git a/BMLite_example/inc/platform.h b/BMLite_example/inc/platform.h index c64a3b6..db4ac05 100644 --- a/BMLite_example/inc/platform.h +++ b/BMLite_example/inc/platform.h @@ -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, diff --git a/BMLite_example/src/main.c b/BMLite_example/src/main.c index a252c0f..9e3d40f 100644 --- a/BMLite_example/src/main.c +++ b/BMLite_example/src/main.c @@ -24,16 +24,12 @@ * @brief Main file for FPC BM-Lite Communication example. */ -#include -#include -#include #include #include #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); diff --git a/HAL_Driver/src/board_hal.c b/HAL_Driver/src/board_hal.c index 11d49ec..4808b9a 100755 --- a/HAL_Driver/src/board_hal.c +++ b/HAL_Driver/src/board_hal.c @@ -1,36 +1,33 @@ /* - * Copyright (c) 2019 Fingerprint Cards AB + * 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 #include -#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 -#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 diff --git a/HAL_Driver/src/board_leds.c b/HAL_Driver/src/board_leds.c index 5517e5f..01dbddb 100644 --- a/HAL_Driver/src/board_leds.c +++ b/HAL_Driver/src/board_leds.c @@ -1,24 +1,27 @@ /* - * Copyright (c) 2019 Fingerprint Cards AB + * 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 -#include -#include - /** LED ON time in ms */ #define LED_SOLID_ON_TIME_MS 700 diff --git a/HAL_Driver/src/platform_spi.c b/HAL_Driver/src/platform_spi.c index 6de0c20..bf41dbf 100755 --- a/HAL_Driver/src/platform_spi.c +++ b/HAL_Driver/src/platform_spi.c @@ -1,31 +1,27 @@ /* - * Copyright (c) 2019 Fingerprint Cards AB + * 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 -#include -#include - #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 -#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); }