이란-이스라엘·미국 무력 충돌 격화… 요동치는 국제 유가와 향후 전망 (2026년 3월)
미국과 이스라엘의 대이란 공습으로 중동 지역의 긴장이 최고조에 달하고 있습니다. 실시간 전황과 호르무즈 해협 봉쇄 우려, 그리고 배럴당 100달러를 위협하는 국제 유가 전망을 심층 분석합니다.
gpio를 사용해서 무언가를 개발하다보면 특정 핀을 고정하고 싶은 경우가 나타납니다.
기능상의 이유로, 혹은 테스트를 위해 사용해야 합니다.
디바이스 트리를 수정해서 gpio를 고정하는 방법을 소개합니다.
고정하게 되면 sys 노드에서 해당 핀을 export 할 수 없게 됩니다.
[주의] wiringPi 패키지는 레지스터 주소에 직접 값을 read/write 하기 때문에 보호할 수 없습니다.
커널 문서에도 설명이 잘 되어 있습니다.
사실 대부분의 커널 내용은 Documentation 아래에 서술되어 있습니다.
gpio 문서를 확인합니다.
$ cd linux
$ cat Documentation/devicetree/bindings/gpio/gpio.txt
아래로 쭉 내리다 보면 해당 내용을 볼 수 있습니다.
The GPIO chip may contain GPIO hog definitions. GPIO hogging is a mechanism
providing automatic GPIO request and configuration as part of the
gpio-controller's driver probe function.
Each GPIO hog definition is represented as a child node of the GPIO controller.
Required properties:
- gpio-hog: A property specifying that this child node represents a GPIO hog.
- gpios: Store the GPIO information (id, flags, ...) for each GPIO to
affect. Shall contain an integer multiple of the number of cells
specified in its parent node (GPIO controller node).
Only one of the following properties scanned in the order shown below.
This means that when multiple properties are present they will be searched
in the order presented below and the first match is taken as the intended
configuration.
- input: A property specifying to set the GPIO direction as input.
- output-low A property specifying to set the GPIO direction as output with
the value low.
- output-high A property specifying to set the GPIO direction as output with
the value high.
Optional properties:
- line-name: The GPIO label name. If not present the node name is used.
Example of two SOC GPIO banks defined as gpio-controller nodes:
qe_pio_a: gpio-controller@1400 {
compatible = "fsl,qe-pario-bank-a", "fsl,qe-pario-bank";
reg = <0x1400 0x18>;
gpio-controller;
#gpio-cells = <2>;
line_b {
gpio-hog;
gpios = <6 0>;
output-low;
line-name = "foo-bar-gpio";
};
};
qe_pio_e: gpio-controller@1460 {
compatible = "fsl,qe-pario-bank-e", "fsl,qe-pario-bank";
reg = <0x1460 0x18>;
gpio-controller;
#gpio-cells = <2>;
};
내용을 요약하자면, gpio-controller 노드의 child 노드를 만들고 gpio-hog를 정의합니다.
gpios 로 gpio 핀을 지정해주고 모드와 값을 정해줍니다.
만약 내가 gpio3의 5번째 핀을 항상 low 값을 output 하겠다 하면 이렇게 작성합니다.
...
#include <dt-bindings/gpio/gpio.h>
...
gpio3: gpio3@xxxxxxxx {
compatible = "...";
gpio-controller;
...
always_low {
gpio-hog;
gpios = <5 GPIO_ACTIVE_HIGH>;
output-low;
};
};
위 코드에서 GPIO_ACTIVE_HIGH 를 GPIO_ACTIVE_LOW 로 바꿔주면 항상 high 값을 output 합니다.
미국과 이스라엘의 대이란 공습으로 중동 지역의 긴장이 최고조에 달하고 있습니다. 실시간 전황과 호르무즈 해협 봉쇄 우려, 그리고 배럴당 100달러를 위협하는 국제 유가 전망을 심층 분석합니다.
미 대법원이 트럼프 행정부의 IEEPA 기반 관세에 대해 위헌 판결을 내렸습니다. 이에 맞선 122조, 301조 등 통상법을 총동원한 새로운 관세 카드와 요동치는 시장 상황을 심층 분석합니다.
트럼프 대통령의 케빈 워시 신임 연준 의장 지명 소식에 국제 금, 은 가격이 급락했습니다. 시장의 충격과 향후 전망을 분석합니다.
CES 2026에서 선보인 인공지능, 모빌리티, 스마트 기술의 최신 트렌드를 확인하고, 이러한 기술들이 우리의 미래를 어떻게 바꾸게 될지 전망합니다.