UART指纹模组使用手册:快速集成与识别

需积分: 27 0 下载量 155 浏览量 更新于2024-07-16 收藏 905KB PDF 举报
UART_Fingerprint_Sensor_(C)指纹模组是专为集成高效能指纹识别功能而设计的一款一体化模块。该模组结合了指纹识别主板和电容式指纹传感器,旨在提供小巧、易于集成的解决方案。模组的主要特点包括其简洁的API接口,用户无需深入了解指纹算法和内部构造,只需通过简单的指令即可实现指纹的录入、比对、图像采集以及特征值的处理。 模组的核心是基于高性能Cortex内核的主控,内置了高安全性的商用指纹算法。这确保了模组的稳定性和快速的识别速度。电容式传感器使得用户只需轻微接触采集窗口,就能实现快速、灵敏的指纹识别。模组的圆形设计允许360°旋转识别,适合各种角度的指纹扫描。 在硬件层面,模组采用不锈钢窄边圆形结构,增大了指纹传感器的接触面积,提供了更大的识别区域。此外,模组还内置了人体感应器件,支持掉电睡眠和触摸唤醒功能,从而降低了功耗。UART接口的配置使其能轻松与STM32、Raspberry Pi等硬件平台对接,方便进行系统集成。 该模组的关键技术参数如下: - 传感器类型:电容式触摸式传感器 - 分辨率:508DPI - 图像像素阵列:192x192 - 图像灰度等级:8级灰度 - 指纹容量:500枚 - 比对时间:小于500毫秒(1:N,N≤100) - 认假率:小于0.001% - 拒真率:小于0.1% - 工作电压:2.7~3.3伏特 - 工作电流:小于50毫安 - 睡眠电流:小于16微安 - 静电测试:接触放电8KV/空气放电15KV - 通信接口:UART - 通信波特率:19200bps 在使用过程中,用户可以通过串口通信协议进行交互,包括设置不同的命令类型来执行特定操作,如添加指纹、删除指定用户、清除所有用户以及采集图像并提取特征值上传。模组还提供了连接PC、XNUCLEO-F103RB开发板和Raspberry Pi的使用说明,包括硬件准备、连接步骤和测试过程。 总而言之,UART_Fingerprint_Sensor_(C)指纹模组是一款集成了高性能硬件和先进指纹算法的模块,适用于各种需要安全认证的小型化应用,如物联网设备、门禁系统、身份验证设备等。通过其简单的接口和丰富的功能,开发者可以轻松地将指纹识别功能集成到自己的项目中。

注释以下每一行代码#include "bflb_mtimer.h" #include "bflb_uart.h" #include "bflb_clock.h" #include "board.h" struct bflb_device_s *uartx; void uart_isr(int irq, void *arg) { uint32_t intstatus = bflb_uart_get_intstatus(uartx); int ret; uint32_t baudrate; if (intstatus & UART_INTSTS_RX_AD5) { bflb_uart_int_clear(uartx, UART_INTCLR_RX_AD5); ret = bflb_uart_feature_control(uartx, UART_CMD_GET_AUTO_BAUD, UART_AUTO_BAUD_0X55); baudrate = bflb_clk_get_peripheral_clock(BFLB_DEVICE_TYPE_UART, uartx->idx) / (ret + 1); printf("Detected baudrate by 0x55 is %d\r\n", baudrate); } if (intstatus & UART_INTSTS_RX_ADS) { bflb_uart_int_clear(uartx, UART_INTCLR_RX_ADS); ret = bflb_uart_feature_control(uartx, UART_CMD_GET_AUTO_BAUD, UART_AUTO_BAUD_START); baudrate = bflb_clk_get_peripheral_clock(BFLB_DEVICE_TYPE_UART, uartx->idx) / (ret + 1); printf("Detected baudrate by startbit is %d\r\n", baudrate); } } int main(void) { board_init(); board_uartx_gpio_init(); uartx = bflb_device_get_by_name(DEFAULT_TEST_UART); struct bflb_uart_config_s cfg; cfg.baudrate = 2000000; cfg.data_bits = UART_DATA_BITS_8; cfg.stop_bits = UART_STOP_BITS_1; cfg.parity = UART_PARITY_NONE; cfg.flow_ctrl = 0; cfg.tx_fifo_threshold = 7; cfg.rx_fifo_threshold = 7; bflb_uart_init(uartx, &cfg); bflb_uart_feature_control(uartx, UART_CMD_SET_AUTO_BAUD, 1); bflb_uart_feature_control(uartx, UART_CMD_SET_ABR_ALLOWABLE_ERROR, 3); bflb_irq_attach(uartx->irq_num, uart_isr, NULL); bflb_irq_enable(uartx->irq_num); while (1) { } }

2023-05-15 上传

怎么使用这个函数初始化串口3HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef huart) { / Check the UART handle allocation / if (huart == NULL) { return HAL_ERROR; } / Check the parameters / if (huart->Init.HwFlowCtl != UART_HWCONTROL_NONE) { / The hardware flow control is available only for USART1, USART2, USART3 and USART6. Except for STM32F446xx devices, that is available for USART1, USART2, USART3, USART6, UART4 and UART5. / assert_param(IS_UART_HWFLOW_INSTANCE(huart->Instance)); assert_param(IS_UART_HARDWARE_FLOW_CONTROL(huart->Init.HwFlowCtl)); } else { assert_param(IS_UART_INSTANCE(huart->Instance)); } assert_param(IS_UART_WORD_LENGTH(huart->Init.WordLength)); assert_param(IS_UART_OVERSAMPLING(huart->Init.OverSampling)); if (huart->gState == HAL_UART_STATE_RESET) { / Allocate lock resource and initialize it / huart->Lock = HAL_UNLOCKED; #if (USE_HAL_UART_REGISTER_CALLBACKS == 1) UART_InitCallbacksToDefault(huart); if (huart->MspInitCallback == NULL) { huart->MspInitCallback = HAL_UART_MspInit; } / Init the low level hardware / huart->MspInitCallback(huart); #else / Init the low level hardware : GPIO, CLOCK / HAL_UART_MspInit(huart); #endif / (USE_HAL_UART_REGISTER_CALLBACKS) / } huart->gState = HAL_UART_STATE_BUSY; / Disable the peripheral / __HAL_UART_DISABLE(huart); / Set the UART Communication parameters / UART_SetConfig(huart); / In asynchronous mode, the following bits must be kept cleared: - LINEN and CLKEN bits in the USART_CR2 register, - SCEN, HDSEL and IREN bits in the USART_CR3 register./ CLEAR_BIT(huart->Instance->CR2, (USART_CR2_LINEN | USART_CR2_CLKEN)); CLEAR_BIT(huart->Instance->CR3, (USART_CR3_SCEN | USART_CR3_HDSEL | USART_CR3_IREN)); / Enable the peripheral / __HAL_UART_ENABLE(huart); / Initialize the UART state */ huart->ErrorCode = HAL_UART_ERROR_NONE; huart->gState = HAL_UART_STATE_READY; huart->RxState = HAL_UART_STATE_READY; return HAL_OK; }

2023-05-24 上传