RTEMS  5.0.0
Macros | Functions | Variables
tms570-sci.c File Reference

Serial communication interface (SCI) functions definitions. More...

#include <bspopts.h>
#include <termios.h>
#include <rtems/termiostypes.h>
#include <bsp/tms570-sci.h>
#include <bsp/tms570-sci-driver.h>
#include <rtems/console.h>
#include <bsp.h>
#include <bsp/fatal.h>
#include <bsp/irq.h>

Macros

#define TMS570_SCI_BUFFER_SIZE   1
 

Functions

void tms570_sci_initialize (tms570_sci_context *ctx)
 
rtems_device_driver console_initialize (rtems_device_major_number major, rtems_device_minor_number minor, void *arg)
 Serial drivers init function. More...
 
bool tms570_sci_set_attributes (rtems_termios_device_context *base, const struct termios *t)
 Set attributes of the HW peripheral. More...
 

Variables

tms570_sci_context driver_context_table []
 Table including all serial drivers. More...
 
const rtems_termios_device_handler tms570_sci_handler_polled
 Struct containing definitions of polled driver functions. More...
 
const rtems_termios_device_handler tms570_sci_handler_interrupt
 Struct containing definitions of interrupt driven driver functions. More...
 

Detailed Description

Serial communication interface (SCI) functions definitions.

Function Documentation

◆ console_initialize()

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

Serial drivers init function.

Console initialization entry point.

Initialize all serial drivers specified in driver_context_table

Parameters
[in]major
[in]minor
[in]arg
Return values
RTEMS_SUCCESSFULInitialization completed

◆ tms570_sci_set_attributes()

bool tms570_sci_set_attributes ( rtems_termios_device_context base,
const struct termios *  t 
)

Set attributes of the HW peripheral.

Sets attributes of the HW peripheral (parity, baud rate, etc.)

Parameters
[in]basecontext of the driver
[in]ttermios driver
Return values
trueperipheral setting is changed

Variable Documentation

◆ driver_context_table

tms570_sci_context driver_context_table[]
Initial value:
= {
{
.device_name = "/dev/console",
.regs = (volatile tms570_sci_t *) &TMS570_LIN,
.irq = TMS570_IRQ_SCI_LEVEL_0,
},
{
.device_name = "/dev/ttyS1",
.regs = &TMS570_SCI,
.irq = TMS570_IRQ_SCI2_LEVEL_0,
}
}
#define RTEMS_TERMIOS_DEVICE_CONTEXT_INITIALIZER(name)
Initializer for static initialization of Termios device contexts.
Definition: termiostypes.h:129
Definition: reg_sci.h:44

Table including all serial drivers.

Definitions of all serial drivers

◆ tms570_sci_handler_interrupt

const rtems_termios_device_handler tms570_sci_handler_interrupt
Initial value:
= {
.first_open = tms570_sci_interrupt_first_open,
.last_close = tms570_sci_interrupt_last_close,
.poll_read = NULL,
.write = tms570_sci_interrupt_write,
.set_attributes = tms570_sci_set_attributes,
.mode = TERMIOS_IRQ_DRIVEN
}
bool tms570_sci_set_attributes(rtems_termios_device_context *base, const struct termios *t)
Set attributes of the HW peripheral.
Definition: tms570-sci.c:245
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77

Struct containing definitions of interrupt driven driver functions.

Encapsulates interrupt driven driver functions. Use of this table is determited by defining TMS570_USE_INTERRUPTS

◆ tms570_sci_handler_polled

const rtems_termios_device_handler tms570_sci_handler_polled
Initial value:
= {
.first_open = tms570_sci_poll_first_open,
.last_close = tms570_sci_poll_last_close,
.poll_read = tms570_sci_poll_read,
.write = tms570_sci_poll_write,
.set_attributes = tms570_sci_set_attributes,
.mode = TERMIOS_POLLED
}
bool tms570_sci_set_attributes(rtems_termios_device_context *base, const struct termios *t)
Set attributes of the HW peripheral.
Definition: tms570-sci.c:245

Struct containing definitions of polled driver functions.

Encapsulates polled driver functions. Use of this table is determited by not defining TMS570_USE_INTERRUPTS