RTEMS: bsps/arm/tms570/console/tms570-sci.c File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Macros | Functions | Variables
tms570-sci.c File Reference
Board Support Packages » ARM » TMS570

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.
bool | tms570_sci_set_attributes (rtems_termios_device_context *base, const struct termios *t)
| Set attributes of the HW peripheral.

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

## 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_SUCCESSFUL | Initialization 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] | base | context of the driver
  [in] | t | termios driver

Return values

  true | peripheral setting is changed

## Variable Documentation

## ◆ driver_context_table

tms570_sci_context driver_context_table[]

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

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
}
NULL
#define NULL
Requests a GPIO pin group configuration.
Definition: bestcomm_api.h:77
tms570_sci_set_attributes
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 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
}

Struct containing definitions of polled driver functions.

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