nrfcxx  0.1.0
C++-17 Framework for Nordic nRF5 Devices
impl.hpp
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0 */
2 /* Copyright 2015-2019 Peter A. Bigot */
3 
11 #ifndef NRFCXX_IMPL_HPP
12 #define NRFCXX_IMPL_HPP
13 #pragma once
14 
15 #include <nrfcxx/core.hpp>
16 
17 namespace nrfcxx {
18 namespace nrf5 {
19 namespace series {
20 
22 struct ADC_Base
23 {
24 
29  static void setup_result_bi (volatile uint16_t* ptr,
30  uint16_t maxcnt = 1)
31  {
32  result_ptr_ = ptr;
33  result_maxcnt_ = maxcnt;
34  }
35 
36  static volatile uint16_t* result_ptr_;
37  static uint16_t result_maxcnt_;
38 };
39 
40 } // ns series
41 } // ns nrf5
42 } // ns nrfcxx
43 
44 #if (51 == NRF_SERIES)
45 #include <nrfcxx/nrf51/impl.hpp>
46 #elif (52 == NRF_SERIES)
47 #include <nrfcxx/nrf52/impl.hpp>
48 #endif // NRF_SERIES
49 #include <nrfcxx/board.hpp>
50 
60 #define NRFCXX_BOARD_PSEL_SCOPEn -1
61 
62 namespace nrfcxx {
63 namespace board {
64 
76 static constexpr unsigned int default_lfclk_src ()
77 {
78  return (board::has_lfxt ? CLOCK_LFCLKSRC_SRC_Xtal : CLOCK_LFCLKSRC_SRC_RC);
79 }
80 
81 } // namespace board
82 
83 } // namespace nrfcxx
84 
85 #endif /* NRFCXX_IMPL_HPP */
nrfcxx::board::default_lfclk_src
static constexpr unsigned int default_lfclk_src()
Provide the LFCLKSRC value preferred by the board.
Definition: impl.hpp:76
nrfcxx::nrf5::series::ADC_Base
Material common to all ADC peripheral implementations.
Definition: impl.hpp:22
impl.hpp
API specific to the nRF51 series supporting <nrfcxx/impl.hpp>.
nrfcxx::nrf5::series::ADC_Base::setup_result_bi
static void setup_result_bi(volatile uint16_t *ptr, uint16_t maxcnt=1)
Record the destination address and count of ADC samples.
Definition: impl.hpp:29
impl.hpp
API specific to the nRF52 series supporting <nrfcxx/impl.hpp>.
core.hpp
Primary header for nrfcxx interface dependencies.
nrfcxx
Primary namespace for nrfcxx functionality.
Definition: clock.hpp:17