芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密

飞芯科技提供芯片解密,芯片破解,IC解密,单片机解密,MCU解密,STM解密逆向服务

HT66F60A和HT66F70A引脚图与功能芯片解密

芯片解密NRF51822的一个串口通信例程

芯片解密单片机源程序如下:

  1. /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
  2. *
  3. * The information contained herein is property of Nordic Semiconductor ASA.
  4. * Terms and conditions of usage are described in detail in NORDIC
  5. * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
  6. *
  7. * Licensees are granted free, non-transferable use of the information. NO
  8. * WARRANTY of ANY KIND is provided. This heading must NOT be removed from
  9. * the file.
  10. *
  11. */

  12. #include <stdint.h>

  13. #include "nrf.h"
  14. #include "simple_uart.h"
  15. #include "nrf_delay.h"
  16. #include "nrf_gpio.h"

  17. uint8_t simple_uart_get(void)
  18. {
  19.   while (NRF_UART0->EVENTS_RXDRDY != 1)
  20.   {
  21.     // Wait for RXD data to be received
  22.   }
  23.   
  24.   NRF_UART0->EVENTS_RXDRDY = 0;
  25.   return (uint8_t)NRF_UART0->RXD;
  26. }

  27. bool simple_uart_get_with_timeout(int32_t timeout_ms, uint8_t *rx_data)
  28. {
  29.   bool ret = true;
  30.   
  31.   while (NRF_UART0->EVENTS_RXDRDY != 1)
  32.   {
  33.     if (timeout_ms-- >= 0)
  34.     {
  35.       // wait in 1ms chunk before checking for status
  36.       nrf_delay_us(1000);
  37.     }
  38.     else
  39.     {
  40.       ret = false;
  41.       break;
  42.     }
  43.   }  // Wait for RXD data to be received

  44.   if (timeout_ms >= 0)
  45.   {
  46.     // clear the event and set rx_data with received byte
  47.       NRF_UART0->EVENTS_RXDRDY = 0;
  48.       *rx_data = (uint8_t)NRF_UART0->RXD;
  49.   }

  50.   return ret;
  51. }

  52. void simple_uart_put(uint8_t cr)
  53. {
  54.   NRF_UART0->TXD = (uint8_t)cr;

  55.   while (NRF_UART0->EVENTS_TXDRDY!=1)
  56.   {
  57.     // Wait for TXD data to be sent
  58.   }

  59.   NRF_UART0->EVENTS_TXDRDY=0;
  60. }



联系方式

地址:石家庄市新华区民族路77号华强广场D座2009
电话:0311-88816616/87087811
手机:13315190088
传真:0311-67901001
联系人:张工
网址:www.taihedz.cn
邮箱:feixindz@163.com
微信:xinpianjiemi
QQ:527263666/568069805

在线客服
热线电话

企业微信