資源簡介
NRF52832藍牙主從模式,基于SDK15.3,例子是官網uart藍牙例程的基礎上修改的
代碼片段和文件信息
/**
?*?Copyright?(c)?2016?-?2019?Nordic?Semiconductor?ASA?and?Luxoft?Global?Operations?Gmbh.
?*
?*?All?Rights?Reserved.
?*
?*?Redistribution?and?use?in?source?and?binary?forms?with?or?without?modification
?*?are?permitted?provided?that?the?following?conditions?are?met:
?*
?*?
?*?1.?Redistributions?of?source?code?must?retain?the?above?copyright?notice?this
?*????list?of?conditions?and?the?following?disclaimer.
?*
?*?2.?Redistributions?in?binary?form?except?as?embedded?into?a?Nordic
?*????Semiconductor?ASA?integrated?circuit?in?a?product?or?a?software?update?for
?*????such?product?must?reproduce?the?above?copyright?notice?this?list?of
?*????conditions?and?the?following?disclaimer?in?the?documentation?and/or?other
?*????materials?provided?with?the?distribution.
?*
?*?3.?Neither?the?name?of?Nordic?Semiconductor?ASA?nor?the?names?of?its
?*????contributors?may?be?used?to?endorse?or?promote?products?derived?from?this
?*????software?without?specific?prior?written?permission.
?*
?*?4.?This?software?with?or?without?modification?must?only?be?used?with?a
?*????Nordic?Semiconductor?ASA?integrated?circuit.
?*
?*?5.?Any?software?provided?in?binary?form?under?this?license?must?not?be?reverse
?*????engineered?decompiled?modified?and/or?disassembled.
?*
?*?
?*?THIS?SOFTWARE?IS?PROVIDED?BY?NORDIC?SEMICONDUCTOR?ASA?“AS?IS“?AND?ANY?EXPRESS
?*?OR?IMPLIED?WARRANTIES?INCLUDING?BUT?NOT?LIMITED?TO?THE?IMPLIED?WARRANTIES
?*?OF?MERCHANTABILITY?NONINFRINGEMENT?AND?FITNESS?FOR?A?PARTICULAR?PURPOSE?ARE
?*?DISCLAIMED.?IN?NO?EVENT?SHALL?NORDIC?SEMICONDUCTOR?ASA?OR?CONTRIBUTORS?BE
?*?LIABLE?FOR?ANY?DIRECT?INDIRECT?INCIDENTAL?SPECIAL?EXEMPLARY?OR
?*?CONSEQUENTIAL?DAMAGES?(INCLUDING?BUT?NOT?LIMITED?TO?PROCUREMENT?OF?SUBSTITUTE
?*?GOODS?OR?SERVICES;?LOSS?OF?USE?DATA?OR?PROFITS;?OR?BUSINESS?INTERRUPTION)
?*?HOWEVER?CAUSED?AND?ON?ANY?THEORY?OF?LIABILITY?WHETHER?IN?CONTRACT?STRICT
?*?LIABILITY?OR?TORT?(INCLUDING?NEGLIGENCE?OR?OTHERWISE)?ARISING?IN?ANY?WAY?OUT
?*?OF?THE?USE?OF?THIS?SOFTWARE?EVEN?IF?ADVISED?OF?THE?POSSIBILITY?OF?SUCH?DAMAGE.
?*
?*/
#include?
#include?“nrf_rng.h“
#include?“hal_rng.h“
#include?“sys_utils.h“
/**@brief?Initialize?hardware?random?generator.
?*/
void?hal_rand_init(void)
{
????/**?For?future?use?*/
}
/**@brief?Generates?random?number?using?hardware.
?*
?*?@details?The?process?takes?about?150?us.*/
uint8_t?hal_rand_get(void)
{
????nrf_rng_task_trigger(NRF_RNG_TASK_START);
????while(!nrf_rng_event_get(NRF_RNG_EVENT_VALRDY));
????nrf_rng_task_trigger(NRF_RNG_TASK_STOP);
????nrf_rng_event_clear(NRF_RNG_EVENT_VALRDY);
????return?nrf_rng_random_value_get();
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2019-02-15?22:09??master_slave_ble_demo_sdk15.3\
?????目錄???????????0??2019-02-14?21:05??master_slave_ble_demo_sdk15.3\components\
?????目錄???????????0??2019-02-14?21:05??master_slave_ble_demo_sdk15.3\components\802_15_4\
?????目錄???????????0??2019-02-14?20:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\
?????目錄???????????0??2019-02-14?20:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\
?????文件????????3325??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_atomic.h
?????文件????????2485??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_clock.h
?????文件????????3795??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_debug_interface.h
?????文件????????2740??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_delay.h
?????文件????????2421??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_led.h
?????文件????????3259??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_mutex.h
?????文件????????2872??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_rng.h
?????文件????????4061??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_sleep.h
?????文件????????4168??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_task_scheduler.h
?????文件????????2868??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_timer.h
?????文件????????3142??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_timer_critical.h
?????文件????????3684??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_trace_interface.h
?????文件???????12289??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_uart.h
?????文件????????4036??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\hal_uart_task_scheduler.h
?????目錄???????????0??2019-02-14?20:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\nrf52_soc\
?????文件????????3895??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\nrf52_soc\hal_nrf52_exceptions.h
?????文件????????3791??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\nrf52_soc\hal_nrf52_rtc.h
?????文件????????2685??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\HAL\nrf52_soc\hal_nrf52_timer.h
?????目錄???????????0??2019-02-14?20:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\MAC\
?????文件????????2551??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\MAC\mac_auto_request.h
?????文件???????25350??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\MAC\mac_common.h
?????文件???????12645??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\MAC\mac_mcps_data.h
?????文件????????5758??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\MAC\mac_mcps_purge.h
?????文件???????13387??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\MAC\mac_mlme_associate.h
?????文件????????7537??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\MAC\mac_mlme_beacon_notify.h
?????文件????????5325??2019-02-15?00:24??master_slave_ble_demo_sdk15.3\components\802_15_4\api\MAC\mac_mlme_comm_status.h
............此處省略3944個文件信息
評論
共有 條評論