분류 전체보기
-
파일 선택. File pickerC# 2021. 10. 2. 02:49
var fileContent = string.Empty; var filePath = string.Empty; using (OpenFileDialog openFileDialog = new OpenFileDialog()) { openFileDialog.InitialDirectory = "c:\\"; openFileDialog.Filter = "txt files (*.txt)|*.txt|All files (*.*)|*.*"; openFileDialog.FilterIndex = 2; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { //Get the path of specified file fi..
-
파일 읽기, StreamReaderC# 2021. 10. 2. 02:13
인스턴스를 사용하여 StreamReader 파일에서 텍스트를 읽기. using System; using System.IO; class Test { public static void Main() { try { // 인스턴스 생성 // using 을 사용함으로서, 사용후에 close 하게 된다. using (StreamReader sr = new StreamReader("TestFile.txt", Encoding.UTF8)) { string line; // 파일 끝까지 읽어서 출력. while ((line = sr.ReadLine()) != null) { Console.WriteLine(line); } } } catch (Exception e) { // 에러 처리. Console.WriteLine("The ..
-
USART 레지스터 ISRSTM32 2021. 9. 29. 04:34
Interrupt and status register (USART_ISR) Bit 19 RWU: Receiver wakeup from Mute mode Bit 18 SBKF: Send break flag Bit 17 CMF: Character match flag Bit 16 BUSY: Busy flag Bit 15 ABRF: Auto baud rate flag Bit 14 ABRE: Auto baud rate error Bit 11 RTOF: Receiver timeout Bit 10 CTS: CTS flag Bit 9 CTSIF: CTS interrupt flag Bit 7 TXE: Transmit data register empty Bit 6 TC: Transmission complete Bit 5 ..
-
USART 레지스터 CR3STM32 2021. 9. 29. 04:25
Control register 3 (USART_CR3) Bit 15 DEP: Driver enable polarity selection Bit 14 DEM: Driver enable mode Bit 13 DDRE: DMA Disable on Reception Error Bit 12 OVRDIS: Overrun Disable Bit 11 ONEBIT: One sample bit method enable 0: Three sample bit method 1: One sample bit method Bit 10 CTSIE: CTS interrupt enable Bit 9 CTSE: CTS enable Bit 8 RTSE: RTS enable Bit 7 DMAT: DMA enable transmitter Bit..
-
UASRT 레지스터 CR2STM32 2021. 9. 29. 04:20
Control register 2 (USART_CR2) Bits 31:28 ADD[7:4]: Address of the USART node Bits 27:24 ADD[3:0]: Address of the USART node Bit 23 RTOEN: Receiver timeout enable Bits 22:21 ABRMOD[1:0]: Auto baud rate mode 00: Measurement of the start bit is used to detect the baud rate. 01: Falling edge to falling edge measurement. 10: 0x7F frame detection. 11: 0x55 frame detection Bit 20 ABREN: Auto baud rate..
-
USART 레지스터 CR1STM32 2021. 9. 29. 04:13
Control register 1 (USART_CR1) Bits 31:29 Reserved, must be kept at reset value Bit 28 M1: Word length M[1:0] = 00: 1 Start bit, 8 data bits, n stop bits M[1:0] = 01: 1 Start bit, 9 data bits, n stop bits M[1:0] = 10: 1 Start bit, 7 data bits, n stop bits This bit can only be written when the USART is disabled (UE=0). Bit 27 Reserved, must be kept at reset value Bit 26 RTOIE: Receiver timeout in..
-