Nol.A SDK Library  24.11.4
For IoT System Software Development
Public Types | Public Member Functions | Protected Member Functions | List of all members
McuNRF52 Class Reference

Nordic Semiconductor nRF52 MCU. More...

#include <McuNRF52.hpp>

Inheritance diagram for McuNRF52:
McuNRF51 McuARMCortexM RTCCalendar McuGeneric SystemPLM100S System_nRf52_DK

Public Types

enum  { RESET_REASON_NFC = (1ul << 19) }
 
enum  AdcReference_t {
  VREF_INTERNAL3V6 = 0 , VREF_INTERNAL3V = 1 , VREF_INTERNAL2V4 = 2 , VREF_INTERNAL1V8 = 3 ,
  VREF_INTERNAL1V2 = 4 , VREF_INTERNAL0V6 = 5 , VREF_INTERNAL0V3 = 6 , VREF_INTERNAL0V15 = 7 ,
  VREF_INTERNALVDD_6div4 = 8 , VREF_INTERNALVDD_5div4 = 9 , VREF_INTERNALVDD = 10 , VREF_INTERNALVDD_3div4 = 11 ,
  VREF_INTERNALVDD_2div4 = 12 , VREF_INTERNALVDD_1div4 = 13 , VREF_INTERNALVDD_1div8 = 14 , VREF_INTERNALVDD_1div16 = 15 ,
  VREF_DEFAULT = 2 , VREF_INTERNAL = 2
}
 ADC (analogRead()) 기준 전압 More...
 
- Public Types inherited from McuNRF51
enum  {
  RESET_REASON_RESETPIN = (1ul << 0) , RESET_REASON_DOG = (1ul << 1) , RESET_REASON_SREQ = (1ul << 2) , RESET_REASON_LOCKUP = (1ul << 3) ,
  RESET_REASON_OFF = (1ul << 16) , RESET_REASON_LPCOMP = (1ul << 17) , RESET_REASON_DIF = (1ul << 18)
}
 
enum  AdcReference_t {
  VREF_INTERNAL1V2 = 0 , VREF_INTERNAL1V8 = 1 , VREF_INTERNAL3V6 = 2 , VREF_INTERNALVDD = 3 ,
  VREF_INTERNALVDD_3div6 = 4 , VREF_INTERNALVDD_1div3 = 5 , VREF_INTERNALVDD_3div2 = 6 , VREF_INTERNALVDD_3div4 = 7 ,
  VREF_INTERNALVDD_1div2 = 8 , VREF_EXTERNAL1_3div1 = 9 , VREF_EXTERNAL1_3div2 = 10 , VREF_EXTERNAL1 = 11 ,
  VREF_EXTERNAL2_3div1 = 12 , VREF_EXTERNAL2_3div2 = 13 , VREF_EXTERNAL2 = 14 , VREF_DEFAULT = 2 ,
  VREF_INTERNAL = 2
}
 ADC (analogRead()) 기준 전압 More...
 

Public Member Functions

 McuNRF52 (uint32_t clockHz, int adcRef)
 
int32_t getSupplyVoltage ()
 MCU에 공급되는 전압을 구합니다. (단위: mV)
 
uint32_t getResetReason ()
 마지막으로 리셋된 원인을 가져옵니다. More...
 
- Public Member Functions inherited from McuNRF51
 McuNRF51 (uint32_t clockHz, int adcRef)
 
void feedWatchdog () override
 Watchdog reset을 방지하기 위하여 watchdog에 신호를 줍니다. More...
 
virtual void sleep ()
 
uint32_t getSystickCount ()
 Get system tick count.
 
void waitSystick (uint32_t startTick, uint32_t numTicks)
 Wait numTicks from startTick.
 
uint32_t MicrosToSystick (uint32_t usec) override
 
uint32_t SystickToMicros (uint32_t ticks) override
 
uint32_t getResetReason ()
 마지막으로 리셋된 원인을 가져옵니다. More...
 
void getTimeSinceBoot (struct timeval *tv) override
 보드 부팅 이후부터 현재까지의 경과 시간을 구합니다. More...
 
- Public Member Functions inherited from McuARMCortexM
 McuARMCortexM (uint32_t clockHz, uint32_t systickHz, uint32_t maxSystickCount)
 
const CoreRegisterDumpgetLastCoreRegisterDump ()
 
void saveCoreRegisterValues (uint32_t r0, uint32_t r1, uint32_t r2, uint32_t r3, uint32_t r12, uint32_t lr, uint32_t pc, uint32_t psr)
 
- Public Member Functions inherited from McuGeneric
 McuGeneric (uint32_t clockHz, uint32_t systickHz, uint32_t maxSystickCount)
 
- Public Member Functions inherited from RTCCalendar
void getDateTime (struct tm &t)
 현재 로컬 시간을 가져옵니다. More...
 
time_t getDateTime ()
 현재 로컬 시간을 가져옵니다. More...
 
void getUTC (struct tm &t)
 현재 UTC 시간을 가져옵니다. More...
 
time_t getUTC ()
 현재 UTC 시간을 가져옵니다. More...
 
void setDateTime (struct tm &t)
 현재 로컬 시간을 설정합니다. More...
 
void setDateTime (time_t t)
 현재 로컬 시간을 설정합니다. More...
 
void setUTC (struct tm &t)
 현재 UTC 시간을 설정합니다. More...
 
void setUTC (time_t t)
 현재 UTC 시간을 설정합니다. More...
 
void setDateTimeAlarm (struct tm &t)
 현재 로컬 시간을 기준으로 알람을 설정합니다. More...
 
void setDateTimeAlarm (time_t t)
 현재 로컬 시간을 기준으로 알람을 설정합니다. More...
 
error_t setTimeAlarm (uint8_t hour, uint8_t min, uint8_t sec=0)
 현재 로컬 시간을 기준으로 알람을 설정합니다. More...
 
void onDateTimeAlarm (void(*func)())
 알람 발생시 호출될 콜백함수를 지정합니다. More...
 
void setTimeDiff (int16_t diffMinutes)
 UTC와 로컬 시간과의 차이를 분 단위로 지정합니다. More...
 
int16_t getTimeDiff ()
 UTC와 로컬 시간과의 차이를 반환합니다. More...
 
virtual void signalAlarm ()
 

Protected Member Functions

int32_t analogRead (int8_t pin)
 
uint16_t readSAADC (uint8_t pSelP, uint8_t pSelN, uint32_t conf)
 
- Protected Member Functions inherited from McuNRF51
void initialize () override
 
void analogWrite (int pin, int32_t val)
 
void tone (int pin, uint32_t frequency)
 
void noTone (int pin)
 
int32_t analogRead (int8_t pin)
 
void getUTCFromHardware (uint16_t *year, uint8_t *month, uint8_t *day, uint8_t *hour, uint8_t *min, uint8_t *sec, uint32_t *subsec=NULL) override
 
void setUTCToHardware (uint16_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, int32_t subsec=-1) override
 
void setUTCAlarmToHardware (uint8_t hour, uint8_t min, uint8_t sec) override
 
- Protected Member Functions inherited from McuGeneric
virtual void wakeup ()
 

Additional Inherited Members

- Public Attributes inherited from McuGeneric
const uint32_t CLOCK_HZ
 CPU clock frequency in unit of Hz.
 
const uint32_t SYSTICK_HZ
 System tick frequency in unit of Hz.
 
const uint32_t MAX_SYSTICK_COUNT
 Maximum value of systick counter.
 
bool useSleep = true
 true 이면 MCU가 유휴(idle) 상태일 때 저전력을 위하여 sleep 합니다. More...
 
- Protected Attributes inherited from McuNRF51
uint32_t resetReason
 
uint8_t adcResolutionBits = 12
 
int adcReference
 
uint64_t nextAlarm = 0
 
uint64_t countSeconds = 0
 
HardwareTimerTick_t countAtLastSec = 0
 
struct timeval bootTime
 
- Protected Attributes inherited from RTCCalendar
void(* handlerAlarm )()
 

Detailed Description

Nordic Semiconductor nRF52 MCU.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
RESET_REASON_NFC 

Reset due to wake up from System OFF mode by NFC field

67  { RESET_REASON_NFC = (1ul << 19),
68  };
@ RESET_REASON_NFC
Definition: McuNRF52.hpp:67

◆ AdcReference_t

ADC (analogRead()) 기준 전압

Enumerator
VREF_INTERNAL3V6 

Internal static 3.6V (Reference: 0.6V, Gain: 1/6)

VREF_INTERNAL3V 

Internal static 3.0V (Reference: 0.6V, Gain: 1/5)

VREF_INTERNAL2V4 

Internal static 2.4V (Reference: 0.6V, Gain: 1/4)

VREF_INTERNAL1V8 

Internal static 1.8V (Reference: 0.6V, Gain: 1/3)

VREF_INTERNAL1V2 

Internal static 1.2V (Reference: 0.6V, Gain: 1/2)

VREF_INTERNAL0V6 

Internal static 0.6V (Reference: 0.6V, Gain: 1)

VREF_INTERNAL0V3 

Internal static 0.3V (Reference: 0.6V, Gain: 2)

VREF_INTERNAL0V15 

Internal static 0.15V (Reference: 0.6V, Gain: 4)

VREF_INTERNALVDD_6div4 

Internal VDD * 1.5 (Reference: VDD/4, Gain: 1/6)

VREF_INTERNALVDD_5div4 

Internal VDD * 1.25 (Reference: VDD/4, Gain: 1/5)

VREF_INTERNALVDD 

Internal VDD / 4 * 4 (Reference: VDD/4, Gain: 1/4)

VREF_INTERNALVDD_3div4 

Internal VDD / 4 * 3 (Reference: VDD/4, Gain: 1/3)

VREF_INTERNALVDD_2div4 

Internal VDD / 4 * 2 (Reference: VDD/4, Gain: 1/2)

VREF_INTERNALVDD_1div4 

Internal VDD / 4 / 1 (Reference: VDD/4, Gain: 1)

VREF_INTERNALVDD_1div8 

Internal VDD / 4 / 2 (Reference: VDD/4, Gain: 2)

VREF_INTERNALVDD_1div16 

Internal VDD / 4 / 4 (Reference: VDD/4, Gain: 4)

VREF_DEFAULT 

Default: VREF_INTERNALVDD

VREF_INTERNAL 

Internal default: VREF_INTERNALVDD

95  { VREF_INTERNAL3V6 = 0,
96  VREF_INTERNAL3V = 1,
97  VREF_INTERNAL2V4 = 2,
98  VREF_INTERNAL1V8 = 3,
99  VREF_INTERNAL1V2 = 4,
100  VREF_INTERNAL0V6 = 5,
101  VREF_INTERNAL0V3 = 6,
102  VREF_INTERNAL0V15 = 7,
105  VREF_INTERNALVDD = 10,
111  VREF_DEFAULT = 2,
112  VREF_INTERNAL = 2,
113  };
@ VREF_INTERNALVDD_6div4
Definition: McuNRF52.hpp:103
@ VREF_INTERNAL0V3
Definition: McuNRF52.hpp:101
@ VREF_INTERNALVDD
Definition: McuNRF52.hpp:105
@ VREF_INTERNAL3V6
Definition: McuNRF52.hpp:95
@ VREF_INTERNAL1V2
Definition: McuNRF52.hpp:99
@ VREF_INTERNALVDD_5div4
Definition: McuNRF52.hpp:104
@ VREF_INTERNALVDD_1div4
Definition: McuNRF52.hpp:108
@ VREF_INTERNAL1V8
Definition: McuNRF52.hpp:98
@ VREF_DEFAULT
Definition: McuNRF52.hpp:111
@ VREF_INTERNALVDD_1div8
Definition: McuNRF52.hpp:109
@ VREF_INTERNALVDD_1div16
Definition: McuNRF52.hpp:110
@ VREF_INTERNAL
Definition: McuNRF52.hpp:112
@ VREF_INTERNAL0V15
Definition: McuNRF52.hpp:102
@ VREF_INTERNAL3V
Definition: McuNRF52.hpp:96
@ VREF_INTERNAL0V6
Definition: McuNRF52.hpp:100
@ VREF_INTERNAL2V4
Definition: McuNRF52.hpp:97
@ VREF_INTERNALVDD_3div4
Definition: McuNRF52.hpp:106
@ VREF_INTERNALVDD_2div4
Definition: McuNRF52.hpp:107

Member Function Documentation

◆ getResetReason()

uint32_t McuNRF52::getResetReason ( )

마지막으로 리셋된 원인을 가져옵니다.

마지막으로 보드가 리셋된 원인을 반환합니다. 원인이 둘 이상인 경우, OR 된 값이 반환됩니다.

Returns

리셋 원인에 대한 자세한 정보는 nRF52 세부 파트넘버의 Product Specification 문서의 POWER 부분을 참고하시기 바랍니다.


The documentation for this class was generated from the following file: