source: rtems/cpukit/include/rtems/bspIo.h

Last change on this file was c584d4e, checked in by Sebastian Huber <sebastian.huber@…>, on Mar 13, 2020 at 9:14:04 AM

rtems: Add rtems_put_char()

Update #3904.

  • Property mode set to 100644
File size: 3.6 KB
Line 
1/**
2 * @file
3 *
4 * @brief Interface to Kernel Print Methods
5 *
6 * This include file defines the interface to kernel print methods.
7 */
8
9/*
10 *  COPYRIGHT (c) 1998 valette@crf.canon.fr
11 *  COPYRIGHT (c) 2011 On-Line Applications Research Corporation.
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#ifndef _RTEMS_BSPIO_H
19#define _RTEMS_BSPIO_H
20
21#include <rtems/score/basedefs.h>
22
23#include <stdarg.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29/**
30 * @defgroup BSPIO Kernel Print Support
31 *
32 * @ingroup RTEMSAPIPrintSupport
33 *
34 * This module contains all methods and support related to providing
35 * kernel level print support.
36 *
37 * The following variables below are declared as extern and
38 * MUST be declared and initialized in each BSP. Using this indirect
39 * function, the functionality in this group is tailored for the BSP.
40 *
41 *  - BSP_output_char
42 *  - BSP_poll_char
43 */
44
45/**
46 * This type defines the prototype for the BSP provided method to
47 * print a single character. It is assumed to be polled.
48 */
49typedef void    (*BSP_output_char_function_type)        (char c);
50
51/**
52 * This type defines the prototype for the BSP provided method to
53 * input a single character. It is assumed to be polled.
54 */
55typedef int     (*BSP_polling_getchar_function_type)    (void);
56
57/**
58 * This variable points to the BSP provided method to output a
59 * character for the purposes of debug output.
60 *
61 * It must output only the specific character.  It must not perform character
62 * translations, e.g. "\n" to "\r\n".
63 */
64extern  BSP_output_char_function_type           BSP_output_char;
65
66/**
67 * This variable points to the BSP provided method to input a
68 * character for the purposes of debug input.
69 */
70extern  BSP_polling_getchar_function_type       BSP_poll_char;
71
72/**
73 * @brief Get Character (kernel I/O)
74 *
75 * This method polls for a key in the simplest possible fashion
76 * from whatever the debug console device is.
77 *
78 * @return If a character is available, it is returned.  Otherwise
79 *         this method returns -1.
80 *
81 * @note This method uses the BSP_poll_char pointer to a BSP
82 *       provided method.
83 */
84extern int getchark(void);
85
86/**
87 * @brief Variable Argument printk()
88 *
89 * This method allows the user to access printk() functionality
90 * with a va_list style argument.
91 *
92 * @param[in] fmt is a printf()-style format string
93 * @param[in] ap is a va_list pointer to arguments
94 *
95 * @return The number of characters output.
96 */
97extern int vprintk(const char *fmt, va_list ap);
98
99int rtems_printk_printer(
100  void *ignored,
101  const char *format,
102  va_list ap
103);
104
105/**
106 * @brief Kernel Print
107 *
108 * This method allows the user to perform a debug printk().  It performs a
109 * character translation from "\n" to "\r\n".
110 *
111 * @param[in] fmt is a printf()-style format string
112 *
113 * @return The number of characters output.
114 */
115extern int printk(const char *fmt, ...) RTEMS_PRINTFLIKE(1, 2);
116
117/**
118 * @brief Kernel Put String
119 *
120 * This method allows the user to perform a debug puts().
121 *
122 * @param[in] s is the string to print
123 *
124 * @return The number of characters output.
125 */
126extern int putk(const char *s);
127
128/**
129 * @brief Kernel Put Character
130 *
131 * This method allows the user to perform a debug putc().  It performs a
132 * character translation from "\n" to "\r\n".
133 *
134 * @param[in] c is the character to print
135 */
136extern void rtems_putc(char c);
137
138/**
139 * @brief Puts the character via rtems_putc().
140 *
141 * This is a compatibility function to support an internal API.
142 *
143 * @param c The character to put.
144 * @param arg Ignored.
145 */
146void rtems_put_char( int c, void *arg );
147
148/**@}*/
149
150#ifdef __cplusplus
151}
152#endif
153
154#endif
Note: See TracBrowser for help on using the repository browser.