You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
530 B
32 lines
530 B
#ifndef DIPSWITCH_H
|
|
#define DIPSWITCH_H
|
|
|
|
#include "r_cg_macrodriver.h"
|
|
#include "r_cg_port.h" // P8, PM8 사용
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/**
|
|
* DIP Switch 초기화 (입력 설정)
|
|
*/
|
|
void DipSwitch_Init(void);
|
|
|
|
/**
|
|
* DIP Switch(5bit)를 읽어 주소(1~32)로 변환해 반환
|
|
* - 회로: Pull-up, DIP ON -> GND (Active-Low)
|
|
* - 핀: P8.1~P8.5 (ADD_1~ADD_5)
|
|
*/
|
|
|
|
/**
|
|
* (옵션) 디버그용: DIP 5bit(0~31) 그대로 반환
|
|
* - ADD_1이 LSB
|
|
*/
|
|
uint8_t DipSwitch_ReadAddr_0to31(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* DIPSWITCH_H */
|
|
|