• 大小: 413KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-16
  • 语言: 其他
  • 标签: nrf51822  ADC  

资源简介

nrf51822关于ADC的采集例程,内嵌s110协议栈和串口通信,希望对大家有所帮助,欢迎大家下载。

资源截图

代码片段和文件信息

/* Copyright (c) 2013 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 “app_uart.h“
#include “app_fifo.h“
#include “nrf.h“
#include “nrf_gpio.h“
#include “app_error.h“
#include “app_util.h“
#include “app_gpiote.h“

#define FIFO_LENGTH(F)             (F.write_pos - F.read_pos)               /**< Macro to calculate length of a FIFO. */
#define UART_INSTANCE_GPIOTE_base  0x00FF                                   /**< Define the base for UART instance ID when flow control is used. The userid from GPIOTE will be used with padded 0xFF at LSB for easy converting the instance id to GPIOTE id. */
#define UART_INSTANCE_ID_INVALID   0x0000                                   /**< Value 0x0000 is used to indicate an invalid instance id. When 0 is provided as instance id upon initialization the module will provide a valid id to the caller. */

/** @brief States for the app_uart state machine. */
typedef enum
{
    UART_OFF                                                               /**< app_uart state OFF indicating CTS is low. */
    UART_READY                                                             /**< app_uart state ON indicating CTS is high. */
    UART_ON                                                                /**< app_uart state TX indicating UART is ongoing transmitting data. */
    UART_WAIT_CLOSE                                                        /**< app_uart state WAIT CLOSE indicating that CTS is low but a byte is currently being transmitted on the line. */
} app_uart_states_t;

/** @brief State transition events for the app_uart state machine. */
typedef enum
{
    ON_CTS_HIGH                                                            /**< Event: CTS gone high. */
    ON_CTS_LOW                                                             /**< Event: CTS gone low. */
    ON_UART_PUT                                                            /**< Event: Application wants to transmit data. */
    ON_TX_READY                                                            /**< Event: Data has been transmitted on the uart and line is available. */
    ON_UART_CLOSE                                                          /**< Event: The UART module are being stopped. */
} app_uart_state_events_t;

static app_fifo_t                  m_rx_fifo;                               /**< RX FIFO buffer for storing data received on the UART until the application fetches them using app_uart_get(). */
static app_fifo_t                  m_tx_fifo;                               /**< TX FIFO buffer for storing data to be transmitted on the UART when TXD is ready. Data is p

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2014-10-17 12:50  adc_sampling_ble_app_uart\
     目录           0  2014-10-17 15:20  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\
     文件       19572  2014-10-17 12:42  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\app_uart_fifo_mod.c
     目录           0  2014-10-17 15:23  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\arm\
     文件       17570  2014-10-17 15:22  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\arm\ble_app_uart.uvopt
     文件       20026  2014-10-17 12:42  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\arm\ble_app_uart.uvoptx
     文件       36958  2014-10-17 15:21  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\arm\ble_app_uart.uvproj
     文件       49520  2014-10-17 12:42  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\arm\ble_app_uart.uvprojx
     文件        9394  2014-10-17 12:42  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\ble_nus.c
     文件        6349  2014-10-17 12:42  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\ble_nus.h
     文件      389719  2014-10-17 12:42  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\Capture - Define the constant for the development kit in Keil Target Options.png
     文件       27019  2014-10-17 15:20  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\main.c
     文件        1534  2014-10-17 12:42  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\README.md
     文件        1466  2014-10-17 12:51  adc_sampling_ble_app_uart\app_uart_library_example_with_ble\uart_conf.h

评论

共有 条评论