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>
|
#define | CONSOLE_DEVICE_CONTEXT_NAME(port_no) uart##port_no##_context |
|
#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, ...) |
|
◆ 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) = { \
.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_initialize()
Console initialization entry point.
This method initializes the console device driver.
- Parameters
-
[in] | major | is the device driver major number. |
[in] | minor | is the device driver minor number. |
[in] | arg | is the parameters to this call. |
- Return values
-
RTEMS_SUCCESSFUL | The device driver is successfully initialized. |
◆ raspberrypi_uart_init()
Initialize gpio of UART and install UART to the dev directory.
- Parameters
-
uart_num | The optional devices are UART0, UART2, UART3, UART4, UART5. |
- Return values
-
RTEMS_SUCCESSFUL | Successful operation. |
RTEMS_INVALID_NUMBER | This status code indicates that a specified number was invalid. |
RTEMS_NO_MEMORY | Not enough memory to create a device node. |
RTEMS_UNSATISFIED | Creation of the device file failed. |
RTEMS_INCORRECT_STATE | Termios is not initialized. |