Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
Basic

Basic Functions. More...

Classes

class  BootloaderSupportable
 Bootloader Interface for systems with bootloader. More...

Macros

#define htons(a)
 2-byte unsigned 정수 a 를 host byte order에서 network byte order로 변환합니다.
#define htonl(a)
 4-byte unsigned 정수 a 를 host byte order에서 network byte order로 변환합니다.
#define min(x, y)
 두 수 중 최소를 구합니다.
#define max(x, y)
 두 수 중 최대를 구합니다.
#define abs(x)
 수의 절대값을 구합니다.
#define constrain(x, a, b)
 수를 특정 범위로 제한시킵니다.
#define lowByte(w)
 변수의 낮은 (가장 오른쪽) 바이트를 구합니다.
#define highByte(w)
 변수의 높은 (가장 왼쪽) 바이트를 구합니다.
#define bit(n)
 특정 비트를 구합니다.
#define bitRead(v, n)
 수의 한 비트를 읽습니다.
#define bitSet(v, n)
 수의 한 비트를 1로 설정합니다.
#define bitClear(v, n)
 수의 한 비트를 0으로 설정합니다.
#define bitWrite(v, n, b)
 수의 한 비트를 특정 값으로 설정합니다.
#define isAscii(c)

Typedefs

typedef bool boolean
typedef uint8_t byte

Enumerations

enum  {
  SUCCESS_BYPASS = 4 , SUCCESS_OPERATION_RESERVED = 3 , SUCCESS_NOTHING_HAPPENED = 1 , ERROR_SUCCESS = 0 ,
  ERROR_FAIL = -1 , ERROR_NOT_ENOUGH_MEMORY = -2 , ERROR_INVALID_ARGS = -3 , ERROR_MORE_ARGS_REQUIRED = -4 ,
  ERROR_NOT_SUPPORTED = -5 , ERROR_NOT_FOUND = -6 , ERROR_BUSY = -7 , ERROR_TIMEOUT = -8 ,
  ERROR_802154_FRAME_TOO_BIG = -31 , ERROR_802154_SECURING_FAIL = -32 , ERROR_802154_UNSECURING_FAIL = -33 , ERROR_802154_INVALID_SEC_FRAME = -34 ,
  ERROR_6LOWPAN_COMPRESSION_FAIL = -43 , ERROR_6LOWPAN_DECOMPRESSION_FAIL = -44 , ERROR_6LOWPAN_INVALID_CONTEXT = -45 , ERROR_IP6_INVALID_PACKET = -54 ,
  ERROR_IP6_NOT_READY = -57 , ERROR_IP6_LINK_FAIL = -58 , ERROR_ICMP6_INVALID_MESSAGE = -61
}

Functions

uint16_t ntohs (uint16_t a)
 2-byte unsigned 정수 a 를 network byte order에서 host byte order로 변환합니다.
uint32_t ntohl (uint32_t a)
 4-byte unsigned 정수 a 를 network byte order에서 host byte order로 변환합니다.
uint32_t seconds ()
 보드 부팅 이후 현재까지의 경과 시간을 초 단위로 구합니다.
uint32_t millis ()
 보드 부팅 이후 현재까지의 경과 시간을 밀리초 단위로 구합니다.
uint32_t micros ()
 보드 부팅 이후부터 현재까지의 경과 시간을 마이크로초 단위로 구합니다.
void delay (uint16_t msec)
 msec 밀리초를 지연시킵니다.
void delayMicroseconds (uint16_t usec)
 usec 마이크로초를 지연시킵니다.
void reboot ()
 소프트웨어 리셋을 통하여 시스템을 재시작합니다.
long map (long x, long in_min, long in_max, long out_min, long out_max)
 수를 어떤 범위에서 다른 범위로 매핑시킵니다.

Detailed Description

Basic Functions.

Macro Definition Documentation

◆ abs

#define abs ( x)
Value:
(((x) < 0) ? (-(x)) : (x))

수의 절대값을 구합니다.

Warning
이 매크로는 newlib 3.4 보다 낮은 버전의 standard library를 위한 것입니다. newlib 3.4 이상의 최신의 GCC 툴체인을 사용하는 경우, 이 매크로 대신 std::abs() 를 사용하시기 바랍니다.

◆ bit

◆ bitClear

#define bitClear ( v,
n )
Value:
((v) &= ~bit(n))
#define bit(n)
특정 비트를 구합니다.
Definition nola-common.h:330

수의 한 비트를 0으로 설정합니다.

◆ bitRead

◆ bitSet

#define bitSet ( v,
n )
Value:
((v) |= bit(n))

수의 한 비트를 1로 설정합니다.

◆ bitWrite

#define bitWrite ( v,
n,
b )
Value:
((b) ? bitSet(v, n) : bitClear(v, n))
#define bitSet(v, n)
수의 한 비트를 1로 설정합니다.
Definition nola-common.h:348
#define bitClear(v, n)
수의 한 비트를 0으로 설정합니다.
Definition nola-common.h:357

수의 한 비트를 특정 값으로 설정합니다.

◆ constrain

#define constrain ( x,
a,
b )
Value:
(((x) >= (a) && (x) <= (b)) ? (x) : (((x) < (a)) ? (a) : (b)))

수를 특정 범위로 제한시킵니다.

292#define constrain(x, a, b) \
293 (((x) >= (a) && (x) <= (b)) ? (x) : (((x) < (a)) ? (a) : (b)))

◆ highByte

#define highByte ( w)

◆ htonl

#define htonl ( a)
Value:
uint32_t ntohl(uint32_t a)
4-byte unsigned 정수 a 를 network byte order에서 host byte order로 변환합니다.

4-byte unsigned 정수 a 를 host byte order에서 network byte order로 변환합니다.

◆ htons

#define htons ( a)
Value:
uint16_t ntohs(uint16_t a)
2-byte unsigned 정수 a 를 network byte order에서 host byte order로 변환합니다.

2-byte unsigned 정수 a 를 host byte order에서 network byte order로 변환합니다.

◆ isAscii

#define isAscii ( c)
Value:
((unsigned) (c) <= 0177)

◆ lowByte

#define lowByte ( w)

◆ max

#define max ( x,
y )
Value:
(((x) > (y)) ? (x) : (y))

두 수 중 최대를 구합니다.

Warning
이 매크로는 newlib 3.4 보다 낮은 버전의 standard library를 위한 것입니다. newlib 3.4 이상의 최신의 GCC 툴체인을 사용하는 경우, 이 매크로 대신 std::max() 를 사용하시기 바랍니다.

◆ min

#define min ( x,
y )
Value:
(((x) < (y)) ? (x) : (y))

두 수 중 최소를 구합니다.

Warning
이 매크로는 newlib 3.4 보다 낮은 버전의 standard library를 위한 것입니다. newlib 3.4 이상의 최신의 GCC 툴체인을 사용하는 경우, 이 매크로 대신 std::min() 을 사용하시기 바랍니다.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
ERROR_SUCCESS 

Success

ERROR_FAIL 

Fail

ERROR_NOT_ENOUGH_MEMORY 

Not enough memory

ERROR_INVALID_ARGS 

Invalid arguments

ERROR_MORE_ARGS_REQUIRED 

More arguements required

ERROR_NOT_SUPPORTED 

Not supported

ERROR_NOT_FOUND 

Not found

ERROR_BUSY 

Busy

ERROR_TIMEOUT 

Timeout

115 {
116 SUCCESS_BYPASS = 4,
117 SUCCESS_OPERATION_RESERVED = 3,
118 SUCCESS_NOTHING_HAPPENED = 1,
119 ERROR_SUCCESS = 0,
120 ERROR_FAIL = -1,
122 ERROR_INVALID_ARGS = -3,
125 ERROR_NOT_FOUND = -6,
126 ERROR_BUSY = -7,
127 ERROR_TIMEOUT = -8,
128 ERROR_802154_FRAME_TOO_BIG = -31,
129 ERROR_802154_SECURING_FAIL = -32,
130 ERROR_802154_UNSECURING_FAIL = -33,
131 ERROR_802154_INVALID_SEC_FRAME = -34,
132 ERROR_6LOWPAN_COMPRESSION_FAIL = -43,
133 ERROR_6LOWPAN_DECOMPRESSION_FAIL = -44,
134 ERROR_6LOWPAN_INVALID_CONTEXT = -45,
135 ERROR_IP6_INVALID_PACKET = -54,
136 ERROR_IP6_NOT_READY = -57,
137 ERROR_IP6_LINK_FAIL = -58,
138 ERROR_ICMP6_INVALID_MESSAGE = -61,
139};
@ ERROR_BUSY
Definition nola-common.h:126
@ ERROR_MORE_ARGS_REQUIRED
Definition nola-common.h:123
@ ERROR_NOT_FOUND
Definition nola-common.h:125
@ ERROR_TIMEOUT
Definition nola-common.h:127
@ ERROR_NOT_ENOUGH_MEMORY
Definition nola-common.h:121
@ ERROR_INVALID_ARGS
Definition nola-common.h:122
@ ERROR_FAIL
Definition nola-common.h:120
@ ERROR_SUCCESS
Definition nola-common.h:119
@ ERROR_NOT_SUPPORTED
Definition nola-common.h:124

Function Documentation

◆ micros()

uint32_t micros ( )

◆ millis()

uint32_t millis ( )

보드 부팅 이후 현재까지의 경과 시간을 밀리초 단위로 구합니다.

Note
이 함수는 Arduino와의 호환성을 위해 존재하며, 이 함수 대신 RTCCalendar::getTimeSinceBoot() 를 사용하는 것을 추천합니다.

◆ seconds()

uint32_t seconds ( )

보드 부팅 이후 현재까지의 경과 시간을 초 단위로 구합니다.

Note
이 함수 대신 RTCCalendar::getTimeSinceBoot() 를 사용하는 것을 추천합니다.