ubinos
Functions
dtty.h File Reference

BSP debug terminal API. More...

#include <ubinos_config.h>
#include <ubinos/type.h>

Go to the source code of this file.

Functions

int dtty_init (void)
 
int dtty_enable (void)
 
int dtty_disable (void)
 
int dtty_geterror (void)
 
int dtty_getc (char *ch_p)
 
int dtty_putc (int ch)
 
int dtty_putn (const char *str, int len)
 
int dtty_kbhit (void)
 
int dtty_puts (const char *str, int max)
 
int dtty_gets (char *str, int max)
 
int dtty_setecho (int echo)
 

Detailed Description

BSP debug terminal API.

BSP 디버그 터미널 API를 정의합니다.

Function Documentation

◆ dtty_disable()

int dtty_disable ( void  )

디버깅 터미널을 비활성화하는 함수

Returns
0: 성공

-1 : 오류 -10: 시스템이 이 함수를 지원하지 않음

◆ dtty_enable()

int dtty_enable ( void  )

디버깅 터미널을 활성화하는 함수

이 함수는 dtty_init 함수에서 자동적으로 호출됩니다.

Returns
0: 성공

-1 : 오류 -10: 시스템이 이 함수를 지원하지 않음

◆ dtty_getc()

int dtty_getc ( char *  ch_p)

디버깅 터미널에서 문자를 입력받는 함수

Parameters
ch_p입력받은 문자를 저장할 변수의 주소
Returns
0: 성공

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ dtty_geterror()

int dtty_geterror ( void  )

디버깅 터미널 오류가 있는지를 검사하는 함수

Returns
0: 없음
other: 오류 번호

◆ dtty_gets()

int dtty_gets ( char *  str,
int  max 
)

디버깅 터미널에서 문자열을 입력받는 함수

"\n", "\r", 또는 "\0" 이 입력되거나 최대 크기보다 작을 때까지 입력받는다. 입력받은 "\n", "\r"은 퍼버에 저장되지 않는다.

Parameters
str입력받은 문자열을 저장할 버퍼
max입력받을 문자열의 최대 크기
Returns
입력받은 문자열의 크기
-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ dtty_init()

int dtty_init ( void  )

디버깅 터미널을 초기화하는 함수

이 함수는 시스템 시작시 bsp_comp_init 함수에서 자동적으로 호출됩니다.

Returns
0: 성공

-1: 오류

◆ dtty_kbhit()

int dtty_kbhit ( void  )

디버깅 터미널 입력 버퍼에 입력받은 문자가 있는지를 검사하는 함수

Returns
1: 있음
0: 없음

◆ dtty_putc()

int dtty_putc ( int  ch)

디버깅 터미널에 문자를 출력하는 함수

Parameters
ch출력할 문자
Returns
0: 성공

-1: 오류

◆ dtty_putn()

int dtty_putn ( const char *  str,
int  len 
)

디버깅 터미널에 문자열을 출력하는 함수

Parameters
str출력할 문자열
max출력할 문자열의 크기
Returns
출력한 문자열의 크기
-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ dtty_puts()

int dtty_puts ( const char *  str,
int  max 
)

디버깅 터미널에 문자열을 출력하는 함수

Parameters
str출력할 문자열
max출력할 문자열의 최대 크기
Returns
출력한 문자열의 크기
-1: 오류
-n: n-1 번째 매개변수가 잘못되었음

◆ dtty_setecho()

int dtty_setecho ( int  echo)

디버깅 터미널 에코 설정 함수

Parameters
echo0: echo off
1: echo on
Returns
0: 성공

-1: 오류
-n: n-1 번째 매개변수가 잘못되었음