HT66F60A和HT66F70A引脚图与功能芯片解密 时间:2026-09-10 来源: 芯片解密 浏览:2次 字号:大 中 小 芯片解密NRF51822的一个串口通信例程芯片解密单片机源程序如下:/* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.** The information contained herein is property of Nordic Semiconductor ASA.* Terms and conditions of usage are described in detail in NORDIC* SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.** Licensees are granted free, non-transferable use of the information. NO* WARRANTY of ANY KIND is provided. This heading must NOT be removed from* the file.**/#include <stdint.h>#include "nrf.h"#include "simple_uart.h"#include "nrf_delay.h"#include "nrf_gpio.h"uint8_t simple_uart_get(void){ while (NRF_UART0->EVENTS_RXDRDY != 1) { // Wait for RXD data to be received } NRF_UART0->EVENTS_RXDRDY = 0; return (uint8_t)NRF_UART0->RXD;}bool simple_uart_get_with_timeout(int32_t timeout_ms, uint8_t *rx_data){ bool ret = true; while (NRF_UART0->EVENTS_RXDRDY != 1) { if (timeout_ms-- >= 0) { // wait in 1ms chunk before checking for status nrf_delay_us(1000); } else { ret = false; break; } } // Wait for RXD data to be received if (timeout_ms >= 0) { // clear the event and set rx_data with received byte NRF_UART0->EVENTS_RXDRDY = 0; *rx_data = (uint8_t)NRF_UART0->RXD; } return ret;}void simple_uart_put(uint8_t cr){ NRF_UART0->TXD = (uint8_t)cr; while (NRF_UART0->EVENTS_TXDRDY!=1) { // Wait for TXD data to be sent } NRF_UART0->EVENTS_TXDRDY=0;} 上一篇:单片机的电子秤设计单片机解密 下一篇:芯片破解新唐MCU芯片Keil调试