Nol.A SDK Library 26.11.2
For IoT System Software Development
Loading...
Searching...
No Matches
Digital I/O

Digital I/O Functions. More...

Enumerations

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

bool pinMode (int8_t pin, enum ioDirection direction)
 pin 을 direction 방향을 갖는 디지털 핀으로 동작하도록 설정합니다.
bool digitalWrite (int8_t pin, int value)
 pin 를 HIGH 또는 LOW 로 설정합니다.
bool digitalToggle (int8_t pin)
 pin 을 토글합니다.
int digitalRead (int8_t pin)
 pin 의 논리 레벨을 읽습니다.

Detailed Description

Digital I/O Functions.

Enumeration Type Documentation

◆ io_const

enum io_const
392 {
393#ifndef LOW
394 LOW = 0,
395#endif
396
397#ifndef HIGH
398 HIGH = 1,
399#endif
400
401 CHANGE = 10,
402 RISING = 11,
403 FALLING = 12,
404
405 NONE = 255,
406};

◆ ioDirection

Enumerator
INPUT 

Input floating mode

OUTPUT 

Output (push-pull) mode

INPUT_PULLUP 

Input and internal pull-up resistor enabled mode

INPUT_PULLDOWN 

Input and internal pull-down resistor enabled mode

OUTPUT_OPENDRAIN 

Output (open-drain) mode

OUTPUT_OPENDRAIN_PULLUP 

Output (open-drain) with pull-up resistor enabled mode

OUTPUT_OPENDRAIN_PULLDOWN 

Output (open-drain) with pull-down resistor enabled mode

381 {
382 INPUT,
383 OUTPUT,
389 UNUSED,
390};
@ OUTPUT
Definition nola-common.h:383
@ OUTPUT_OPENDRAIN_PULLDOWN
Definition nola-common.h:388
@ INPUT_PULLDOWN
Definition nola-common.h:385
@ INPUT_PULLUP
Definition nola-common.h:384
@ OUTPUT_OPENDRAIN
Definition nola-common.h:386
@ INPUT
Definition nola-common.h:382
@ OUTPUT_OPENDRAIN_PULLUP
Definition nola-common.h:387

Function Documentation

◆ digitalRead()

int digitalRead ( int8_t pin)

pin 의 논리 레벨을 읽습니다.

사용 가능한 디지털 핀은 보드마다 다릅니다.

Returns
  • HIGH or LOW: pin 의 논리 레벨
  • -1: pin 이 지원하지 않는 핀인 경우

◆ digitalToggle()

bool digitalToggle ( int8_t pin)

pin 을 토글합니다.

Returns
성공시 true, 그렇지 않으면 false

사용 가능한 디지털 핀은 보드마다 다릅니다. 지원하지 않는 핀을 pin 에 사용한 경우, 아무런 일이 발생하지 않고, false를 반환합니다.

Examples
feather-m0/OLED-FeatherWing/main.cpp, plm100s/Basic/main.cpp, st-nucleo-f429zi/Basic/main.cpp, st-nucleo-f429zi/LoRaWAN/main.cpp, st-nucleo-l073rz/Basic/main.cpp, and st-nucleo-l152re/LoRaWAN-Class-A/main.cpp.

◆ digitalWrite()

◆ pinMode()