Elara Spacecraft
Source code & API documentation for Elara spacecraft system computers
Loading...
Searching...
No Matches
pl011.hpp File Reference
#include "mem_tools.hpp"
#include "types.hpp"
Include dependency graph for pl011.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  PL011_REGISTER {
  UART0_BASE = 0x4000C000 , UART0_DR = (UART0_BASE + 0x00) , UART0_RSRECR = (UART0_BASE + 0x04) , UART0_FR = (UART0_BASE + 0x18) ,
  UART0_ILPR = (UART0_BASE + 0x20) , UART0_IBRD = (UART0_BASE + 0x24) , UART0_FBRD = (UART0_BASE + 0x28) , UART0_LCRH = (UART0_BASE + 0x2C) ,
  UART0_CR = (UART0_BASE + 0x30) , UART0_IFLS = (UART0_BASE + 0x34) , UART0_IMSC = (UART0_BASE + 0x38) , UART0_RIS = (UART0_BASE + 0x3C) ,
  UART0_MIS = (UART0_BASE + 0x40) , UART0_ICR = (UART0_BASE + 0x44) , UART0_DMACR = (UART0_BASE + 0x48) , UART0_ITCR = (UART0_BASE + 0x80) ,
  UART0_ITIP = (UART0_BASE + 0x84) , UART0_ITOP = (UART0_BASE + 0x88) , UART0_TDR = (UART0_BASE + 0x8C)
}
 Register offsets for the PL011 Register. More...
 

Functions

void pl011_putc (unsigned char msg)
 Outputs a single character.
 
void pl011_puts (const char *msg)
 Outputs a \0 terminated string.
 
void print (const char *msg)
 Alias for pl011_puts(const char* msg)
 
void println (const char *msg)
 Outputs a \0 terminated string with a new line.
 
char pl011_getc ()
 Returns an inputted character.
 
void pl011_init ()
 Initializes PL011 functionality.
 
void hexstring (unsigned int num)
 Converts num into a hexadecimal string and outputs it.
 
void binary (unsigned long long num, unsigned int linebreak=8)
 Converts d into a binary string and outputs it.
 

Enumeration Type Documentation

◆ PL011_REGISTER

Register offsets for the PL011 Register.

Enumerator
UART0_BASE 
UART0_DR 
UART0_RSRECR 
UART0_FR 
UART0_ILPR 
UART0_IBRD 
UART0_FBRD 
UART0_LCRH 
UART0_CR 
UART0_IFLS 
UART0_IMSC 
UART0_RIS 
UART0_MIS 
UART0_ICR 
UART0_DMACR 
UART0_ITCR 
UART0_ITIP 
UART0_ITOP 
UART0_TDR 

Function Documentation

◆ binary()

void binary ( unsigned long long num,
unsigned int linebreak = 8 )

Converts d into a binary string and outputs it.

Parameters
num
linebreakDefaulted at 8, printing a new character for eveyr specified number of characters

◆ hexstring()

void hexstring ( unsigned int num)

Converts num into a hexadecimal string and outputs it.

Parameters
num

◆ pl011_getc()

char pl011_getc ( )

Returns an inputted character.

Returns
char

◆ pl011_init()

void pl011_init ( )

Initializes PL011 functionality.

◆ pl011_putc()

void pl011_putc ( unsigned char msg)

Outputs a single character.

Parameters
msg

◆ pl011_puts()

void pl011_puts ( const char * msg)

Outputs a \0 terminated string.

Parameters
msg

◆ print()

void print ( const char * msg)
inline

Alias for pl011_puts(const char* msg)

Parameters
msg

◆ println()

void println ( const char * msg)
inline

Outputs a \0 terminated string with a new line.

Parameters
msg