RTEMS 6.3
Loading...
Searching...
No Matches
console.c File Reference

Console Configuration. More...

#include <rtems/bspIo.h>
#include <bsp.h>
#include <dev/serial/arm-pl011.h>
#include <bsp/irq.h>
#include <bsp/console.h>
#include <bsp/fatal.h>
#include <bsp/rpi-gpio.h>
#include <bspopts.h>
#include <rtems/console.h>
#include <rtems/rtems/status.h>
#include <rtems/termiosdevice.h>
#include <stdint.h>

Data Structures

struct  raspberrypi_console_device_gpio_config
struct  raspberrypi_console_device

Macros

#define CONSOLE_DEVICE_CONTEXT_NAME(port_no)
#define CONSOLE_DEVICE_CONTEXT(port_no, _file_name, regs_base, _size, clock_freq, irq_no, context_type, ...)
#define CONSOLE_DEVICE(port_no, file_name, _base, _size, _clock, _irq, _context_type, dev_handler, write_char_func, rx_pin, tx_pin, gpio_func, ...)

Functions

rtems_status_code raspberrypi_uart_init (raspberrypi_console_device_port uart_num)
 Initialize gpio of UART and install UART to the dev directory.
rtems_device_driver console_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Console initialization entry point.

Variables

BSP_output_char_function_type BSP_output_char = output_char
 This function pointer references the kernel character output implementation.
BSP_polling_getchar_function_type BSP_poll_char = poll_char

Detailed Description

Console Configuration.

Macro Definition Documentation

◆ CONSOLE_DEVICE

#define CONSOLE_DEVICE ( port_no,
file_name,
_base,
_size,
_clock,
_irq,
_context_type,
dev_handler,
write_char_func,
rx_pin,
tx_pin,
gpio_func,
... )
Value:
[CONSOLE_DEVICE_PORT2ENUM(port_no)] = { \
.file = file_name, \
.context = &CONSOLE_DEVICE_CONTEXT_NAME(port_no).base, \
.gpio = {.rx = rx_pin, .tx = tx_pin, .function = gpio_func}, \
.handler = dev_handler, \
.write_char_polled = write_char_func, \
},

◆ CONSOLE_DEVICE_CONTEXT

#define CONSOLE_DEVICE_CONTEXT ( port_no,
_file_name,
regs_base,
_size,
clock_freq,
irq_no,
context_type,
... )
Value:
static context_type CONSOLE_DEVICE_CONTEXT_NAME(port_no) = { \
.base = RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER("UART" #port_no), \
.regs = (volatile arm_pl011_uart *) regs_base, \
.clock = clock_freq, \
.initial_baud = 115200, \
.irq = irq_no, \
};
Definition arm-pl011.h:53
#define RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER(name)
Initializer for static initialization of Termios device contexts.
Definition termiosdevice.h:257

◆ CONSOLE_DEVICE_CONTEXT_NAME

#define CONSOLE_DEVICE_CONTEXT_NAME ( port_no)
Value:
uart##port_no##_context

Function Documentation

◆ console_initialize()

rtems_device_driver console_initialize ( rtems_device_major_number major,
rtems_device_minor_number minor,
void * arg )

Console initialization entry point.

This method initializes the console device driver.

Parameters
[in]majoris the device driver major number.
[in]minoris the device driver minor number.
[in]argis the parameters to this call.
Return values
RTEMS_SUCCESSFULThe device driver is successfully initialized.

◆ raspberrypi_uart_init()

rtems_status_code raspberrypi_uart_init ( raspberrypi_console_device_port uart_num)

Initialize gpio of UART and install UART to the dev directory.

Parameters
uart_numThe optional devices are UART0, UART2, UART3, UART4, UART5.
Return values
RTEMS_SUCCESSFULSuccessful operation.
RTEMS_INVALID_NUMBERThis status code indicates that a specified number was invalid.
RTEMS_NO_MEMORYNot enough memory to create a device node.
RTEMS_UNSATISFIEDCreation of the device file failed.
RTEMS_INCORRECT_STATETermios is not initialized.