|
Nol.A SDK Library
25.8.1
For IoT System Software Development
|
System and user common types and functions. More...
#include <typedef.h>#include <stdio.h>#include <stdarg.h>#include <stdint.h>#include <stdlib.h>#include <string.h>#include <math.h>#include <time.h>#include <sys/time.h>Classes | |
| struct | GPIOInterruptInfo_t |
| GPIO 인터럽트에 관한 상세정보 More... | |
Macros | |
| #define | timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec) |
| #define | timerclear(tvp) ((tvp)->tv_sec = (tvp)->tv_usec = 0) |
| #define | timercmp(a, b, CMP) |
| #define | timeradd(a, b, result) |
| #define | timersub(a, b, result) |
| #define | htons(a) ntohs(a) |
2-byte unsigned 정수 a 를 host byte order에서 network byte order로 변환합니다. | |
| #define | htonl(a) ntohl(a) |
4-byte unsigned 정수 a 를 host byte order에서 network byte order로 변환합니다. | |
| #define | min(x, y) (((x) < (y)) ? (x) : (y)) |
| 두 수 중 최소를 구합니다. More... | |
| #define | max(x, y) (((x) > (y)) ? (x) : (y)) |
| 두 수 중 최대를 구합니다. More... | |
| #define | abs(x) (((x) < 0) ? (-(x)) : (x)) |
| 수의 절대값을 구합니다. More... | |
| #define | constrain(x, a, b) (((x) >= (a) && (x) <= (b)) ? (x) : (((x) < (a)) ? (a) : (b))) |
| 수를 특정 범위로 제한시킵니다. | |
| #define | lowByte(w) ((uint8_t) ((w) & 0xff)) |
| 변수의 낮은 (가장 오른쪽) 바이트를 구합니다. | |
| #define | highByte(w) ((uint8_t) ((w) >> 8)) |
| 변수의 높은 (가장 왼쪽) 바이트를 구합니다. | |
| #define | bit(n) (1ul << (n)) |
| 특정 비트를 구합니다. | |
| #define | bitRead(v, n) (((v) >> (n)) & 1) |
| 수의 한 비트를 읽습니다. | |
| #define | bitSet(v, n) ((v) |= bit(n)) |
| 수의 한 비트를 1로 설정합니다. | |
| #define | bitClear(v, n) ((v) &= ~bit(n)) |
| 수의 한 비트를 0으로 설정합니다. | |
| #define | bitWrite(v, n, b) ((b) ? bitSet(v, n) : bitClear(v, n)) |
| 수의 한 비트를 특정 값으로 설정합니다. | |
| #define | isAscii(c) ((unsigned) (c) <= 0177) |
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 } |
| enum | ioDirection { INPUT , OUTPUT , INPUT_PULLUP , INPUT_PULLDOWN , OUTPUT_OPENDRAIN , OUTPUT_OPENDRAIN_PULLUP , OUTPUT_OPENDRAIN_PULLDOWN , UNUSED } |
| enum | io_const { LOW = 0 , HIGH = 1 , CHANGE = 10 , RISING = 11 , FALLING = 12 , NONE = 255 } |
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 () |
| 보드 부팅 이후 현재까지의 경과 시간을 초 단위로 구합니다. More... | |
| uint32_t | millis () |
| 보드 부팅 이후 현재까지의 경과 시간을 밀리초 단위로 구합니다. More... | |
| uint32_t | micros () |
| 보드 부팅 이후부터 현재까지의 경과 시간을 마이크로초 단위로 구합니다. More... | |
| 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) |
| 수를 어떤 범위에서 다른 범위로 매핑시킵니다. | |
| bool | pinMode (int8_t pin, enum ioDirection direction) |
pin 을 direction 방향을 갖는 디지털 핀으로 동작하도록 설정합니다. More... | |
| bool | digitalWrite (int8_t pin, int value) |
pin 를 HIGH 또는 LOW 로 설정합니다. More... | |
| bool | digitalToggle (int8_t pin) |
pin 을 토글합니다. More... | |
| int | digitalRead (int8_t pin) |
pin 의 논리 레벨을 읽습니다. More... | |
| bool | postTask (void(*func)(void *), void *args) |
| void | interrupts () |
| noInterrupts()로 비활성화된 인터럽트를 다시 활성화합니다. | |
| uint32_t | interrupts2 () |
| void | noInterrupts () |
| interrupts() 가 호출될 때까지 인터럽트를 비활성화합니다. 부득이 원자적(atomic) 실행을 요구하는 곳에서 가능한 짧게 사용합니다. | |
| void | noInterrupts2 (uint32_t) |
System and user common types and functions.
| #define timeradd | ( | a, | |
| b, | |||
| result | |||
| ) |
| #define timercmp | ( | a, | |
| b, | |||
| CMP | |||
| ) |
| #define timersub | ( | a, | |
| b, | |||
| result | |||
| ) |