CHERIoT RTOS
A compartmentalised RTOS for CHERIoT hardware
Loading...
Searching...
No Matches
OpenTitanUart Struct Reference

OpenTitan UART. More...

#include <platform-uart.hh>

Inheritance diagram for OpenTitanUart:
Collaboration diagram for OpenTitanUart:

Classes

struct  Interrupts
struct  InterruptState
struct  Control
struct  Status
struct  FIFOControl
struct  FIFOStatus
 UART FIFO Status Register. More...

Public Member Functions

void parity (bool enableParity=true, bool oddParity=false) volatile
 Configure parity.
void loopback (bool systemLoopback=true, bool lineLoopback=false) volatile
 Configure loopback.
void fifos_clear () volatile
 Clears the contents of the receive and transmit FIFOs.
void transmit_watermark (FIFOControl::TransmitWatermark level) volatile
 Sets the level transmit watermark.
void receive_watermark (FIFOControl::ReceiveWatermark level) volatile
 Sets the level receive watermark.
template<typename Interrupt>
void interrupt_enable () volatile
 Enable the given interrupt by name.
template<typename Interrupt>
void interrupt_disable () volatile
 Disable the given interrupt by name.
void interrupt_enable (Interrupts interrupt) volatile
 Enable the given interrupt(s) by value.
void interrupt_disable (Interrupts interrupt) volatile
 Disable the given interrupt(s) by value.
void init (unsigned baudRate=DEFAULT_UART_BAUD_RATE) volatile
void disable () volatile
 Turn off the transceivers.
void reset () volatile
 Reset the control register to all zeros.
uint16_t transmit_fifo_level () volatile
uint16_t receive_fifo_level () volatile
bool can_write () volatile
bool can_read () volatile
void blocking_write (uint8_t byte) volatile
 Write one byte, blocking until the byte is written.
uint8_t blocking_read () volatile
 Read one byte, blocking until a byte is available.

Public Attributes

InterruptState interruptState
Interrupts interruptEnable
Interrupts interruptTest
uint32_t alertTest
 Alert Test Register (unused).
OpenTitanUart::Control control
OpenTitanUart::Status status
uint32_t readData
 UART Read Data.
uint32_t writeData
 UART Write Data.
OpenTitanUart::FIFOControl fifoControl
OpenTitanUart::FIFOStatus fifoStatus
uint32_t override
 Transmit Pin Override Control.
uint32_t values
 UART Oversampled Values.
uint32_t timeoutControl
 UART Receive Timeout Control.

Detailed Description

OpenTitan UART.

This peripheral's source and documentation can be found at: https://github.com/lowRISC/opentitan/tree/ab878b5d3578939a04db72d4ed966a56a869b2ed/hw/ip/uart

Rendered register documentation is served at: https://opentitan.org/book/hw/ip/uart/doc/registers.html

Definition at line 24 of file platform-uart.hh.

Member Function Documentation

◆ blocking_read()

uint8_t OpenTitanUart::blocking_read ( ) volatile
inline

Read one byte, blocking until a byte is available.

Definition at line 313 of file platform-uart.hh.

References readData.

◆ blocking_write()

void OpenTitanUart::blocking_write ( uint8_t byte) volatile
inline

Write one byte, blocking until the byte is written.

Definition at line 302 of file platform-uart.hh.

References writeData.

◆ can_read()

bool OpenTitanUart::can_read ( ) volatile
inline

Definition at line 293 of file platform-uart.hh.

◆ can_write()

bool OpenTitanUart::can_write ( ) volatile
inline

Definition at line 287 of file platform-uart.hh.

◆ disable()

void OpenTitanUart::disable ( ) volatile
inline

Turn off the transceivers.

Definition at line 259 of file platform-uart.hh.

References BITPACK_OPERATE_VALUE_DECLTYPE.

◆ fifos_clear()

void OpenTitanUart::fifos_clear ( ) volatile
inline

Clears the contents of the receive and transmit FIFOs.

Definition at line 183 of file platform-uart.hh.

References BITPACK_OPERATE_VALUE_DECLTYPE.

◆ init()

void OpenTitanUart::init ( unsigned baudRate = DEFAULT_UART_BAUD_RATE) volatile
inline

Definition at line 244 of file platform-uart.hh.

◆ interrupt_disable() [1/2]

template<typename Interrupt>
void OpenTitanUart::interrupt_disable ( ) volatile
inline

Disable the given interrupt by name.

Definition at line 223 of file platform-uart.hh.

◆ interrupt_disable() [2/2]

void OpenTitanUart::interrupt_disable ( Interrupts interrupt) volatile
inline

Disable the given interrupt(s) by value.

Definition at line 237 of file platform-uart.hh.

◆ interrupt_enable() [1/2]

template<typename Interrupt>
void OpenTitanUart::interrupt_enable ( ) volatile
inline

Enable the given interrupt by name.

Definition at line 216 of file platform-uart.hh.

◆ interrupt_enable() [2/2]

void OpenTitanUart::interrupt_enable ( Interrupts interrupt) volatile
inline

Enable the given interrupt(s) by value.

Definition at line 229 of file platform-uart.hh.

References Bitpack< StorageParam >::raw().

◆ loopback()

void OpenTitanUart::loopback ( bool systemLoopback = true,
bool lineLoopback = false ) volatile
inline

Configure loopback.

When systemLoopback is set, outgoing transmitted bits are routed back the receiving line. When lineLoopback is set, incoming received bits are forwarded to the transmit line.

Definition at line 171 of file platform-uart.hh.

References BITPACK_OPERATE_VALUE_DEPENDENT.

◆ parity()

void OpenTitanUart::parity ( bool enableParity = true,
bool oddParity = false ) volatile
inline

Configure parity.

When enableParity is set, parity will be enabled. When oddParity is set, the odd parity will be used.

Definition at line 158 of file platform-uart.hh.

◆ receive_fifo_level()

uint16_t OpenTitanUart::receive_fifo_level ( ) volatile
inline

Definition at line 282 of file platform-uart.hh.

◆ receive_watermark()

void OpenTitanUart::receive_watermark ( FIFOControl::ReceiveWatermark level) volatile
inline

Sets the level receive watermark.

When the number of bytes in the receive FIFO reach this level, the receive watermark interrupt will fire.

Definition at line 209 of file platform-uart.hh.

◆ reset()

void OpenTitanUart::reset ( ) volatile
inline

Reset the control register to all zeros.

That disables the transceivers, clears any loopbacks, disables parity, and so on.

Definition at line 272 of file platform-uart.hh.

◆ transmit_fifo_level()

uint16_t OpenTitanUart::transmit_fifo_level ( ) volatile
inline

Definition at line 277 of file platform-uart.hh.

◆ transmit_watermark()

void OpenTitanUart::transmit_watermark ( FIFOControl::TransmitWatermark level) volatile
inline

Sets the level transmit watermark.

When the number of bytes in the transmit FIFO reach this level, the transmit watermark interrupt will fire.

Definition at line 198 of file platform-uart.hh.

Member Data Documentation

◆ alertTest

uint32_t OpenTitanUart::alertTest

Alert Test Register (unused).

Definition at line 61 of file platform-uart.hh.

◆ interruptEnable

Interrupts OpenTitanUart::interruptEnable

Definition at line 55 of file platform-uart.hh.

◆ interruptState

InterruptState OpenTitanUart::interruptState

Definition at line 54 of file platform-uart.hh.

◆ interruptTest

Interrupts OpenTitanUart::interruptTest

Definition at line 56 of file platform-uart.hh.

◆ override

uint32_t OpenTitanUart::override

Transmit Pin Override Control.

Gives direct software control over the transmit pin state.

Definition at line 142 of file platform-uart.hh.

◆ readData

uint32_t OpenTitanUart::readData

UART Read Data.

Definition at line 95 of file platform-uart.hh.

Referenced by blocking_read().

◆ timeoutControl

uint32_t OpenTitanUart::timeoutControl

UART Receive Timeout Control.

Definition at line 150 of file platform-uart.hh.

◆ values

uint32_t OpenTitanUart::values

UART Oversampled Values.

Definition at line 146 of file platform-uart.hh.

◆ writeData

uint32_t OpenTitanUart::writeData

UART Write Data.

Definition at line 99 of file platform-uart.hh.

Referenced by blocking_write().


The documentation for this struct was generated from the following file: