Nordic Semiconductor nRF5 AirFuel SDK  version 2.2.0
Printing library

Functions

void print_string (char *char_array)
 Decomposes char array and send chars through UART TX. More...
 
void print_hex (uint32_t number, uint8_t byte_size)
 Converts hex number into char and send it through UART TX. More...
 
void print_file_and_line (uint16_t line_num, const uint8_t *file_name)
 Function used to report event related to source code. More...
 

Detailed Description

Function Documentation

void print_string ( char *  char_array)

Decomposes char array and send chars through UART TX.

Parameters
[in]char_arrayMessage to sent through UART.

Definition at line 25 of file app_print.c.

26 {
27  int size = strlen(char_array);
28 
29  while (size > 0)
30  {
31  size--;
32  simple_uart_put(*char_array);
33  char_array++;
34  }
35 }
void simple_uart_put(uint8_t cr)
Function for sending a character to UART. Execution is blocked until UART peripheral reports characte...
Definition: simple_uart.c:62
void print_hex ( uint32_t  number,
uint8_t  byte_size 
)

Converts hex number into char and send it through UART TX.

Parameters
[in]numberNumber to send.
[in]byte_sizeByte size of number to send.

Definition at line 42 of file app_print.c.

43 {
44  int i;
45  char hex_to_char[] = { '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' };
46 
47  for (i = ((byte_size*8)-4); i >= 0; i=i-4)
48  {
49  simple_uart_put((uint8_t)hex_to_char[number >> i & 0x0F]);
50  }
51 }
void simple_uart_put(uint8_t cr)
Function for sending a character to UART. Execution is blocked until UART peripheral reports characte...
Definition: simple_uart.c:62
void print_file_and_line ( uint16_t  line_num,
const uint8_t *  file_name 
)

Function used to report event related to source code.

Function used to provide more information of occurred errors. Might point on a line and a file when specific action occurred.

Parameters
[in]line_numNumber of line in a source file.
[in]file_nameSource file file-name.

Definition at line 61 of file app_print.c.

62 {
63  char string[100];
64  (void)sprintf(string,"Line: %04d, File: %s",line_num, file_name);
65  print_string(string);
66 }
void print_string(char *char_array)
Decomposes char array and send chars through UART TX.
Definition: app_print.c:25