spinnaker_tools (BMP) latest
SpiNNaker BMP firmware
Loading...
Searching...
No Matches
Functions | Variables
bmp_io.c File Reference

Simple character I/O library for BMP. More...

#include <stdarg.h>
#include <string.h>
#include "lpc17xx.h"
#include "bmp.h"

Functions

void eth_putc (uint32_t c)
 Add character to ethernet-directed output stream.
 
static void std_putc (uint32_t c)
 Add character to standard output stream.
 
static void io_put_char (char *stream, uint32_t c)
 Add character to an output stream.
 
static void io_put_str (char *stream, char *s, int d)
 Add string to an output stream.
 
static void io_put_int (char *stream, int n, uint32_t d, uint32_t pad)
 Add signed integer to an output stream.
 
static void io_put_uint (char *stream, uint32_t n, uint32_t d, uint32_t pad)
 Add unsigned integer to an output stream.
 
static void io_put_zhex (char *stream, uint32_t n, uint32_t d)
 Add zero-padded hex integer to an output stream.
 
static void io_put_hex (char *stream, uint32_t n, uint32_t d, uint32_t pad)
 Add hex integer to an output stream.
 
static void io_put_mac (char *stream, uint8_t *s)
 Add MAC address to an output stream.
 
static void io_put_ip (char *stream, uint8_t *s)
 Add IP address to an output stream.
 
void io_printf (char *stream, char *f,...)
 Print to an output stream.
 

Variables

static const char hex [] = "0123456789abcdef"
 Hexadecimal characters.
 
static uint32_t sp_ptr
 Where in buffer to write, for 'sprintf'.
 
static uint32_t tube_ptr
 Point in tube_buf to write.
 
static uint8_t tube_buf [256]
 Accumulates chars to write to host.
 

Detailed Description

Simple character I/O library for BMP.

Author
Steve Temple, APT Group, School of Computer Science

Function Documentation

◆ eth_putc()

void eth_putc ( uint32_t  c)
extern

Add character to ethernet-directed output stream.

If the buffer is full or at end of line, push the buffer to the configured host machine.

Parameters
[in]cThe character to write

◆ std_putc()

static void std_putc ( uint32_t  c)
static

Add character to standard output stream.

If the buffer is full or at end of line, push the buffer to the configured host machine.

Parameters
[in]cThe character to write

◆ io_put_char()

static void io_put_char ( char *  stream,
uint32_t  c 
)
static

Add character to an output stream.

Parameters
[in]streamWhere to write to.
[in]cThe character to write

◆ io_put_str()

static void io_put_str ( char *  stream,
char *  s,
int  d 
)
static

Add string to an output stream.

Parameters
[in]streamWhere to write to.
[in]sThe string to write
[in]dField width

◆ io_put_int()

static void io_put_int ( char *  stream,
int  n,
uint32_t  d,
uint32_t  pad 
)
static

Add signed integer to an output stream.

Parameters
[in]streamWhere to write to.
[in]nThe number to write
[in]dField width
[in]padPadding character (unused!)

◆ io_put_uint()

static void io_put_uint ( char *  stream,
uint32_t  n,
uint32_t  d,
uint32_t  pad 
)
static

Add unsigned integer to an output stream.

Parameters
[in]streamWhere to write to.
[in]nThe number to write
[in]dField width
[in]padPadding character (unused!)

◆ io_put_zhex()

static void io_put_zhex ( char *  stream,
uint32_t  n,
uint32_t  d 
)
static

Add zero-padded hex integer to an output stream.

Parameters
[in]streamWhere to write to.
[in]nThe number to write
[in]dField width

◆ io_put_hex()

static void io_put_hex ( char *  stream,
uint32_t  n,
uint32_t  d,
uint32_t  pad 
)
static

Add hex integer to an output stream.

Parameters
[in]streamWhere to write to.
[in]nThe number to write
[in]dField width
[in]padPadding character

◆ io_put_mac()

static void io_put_mac ( char *  stream,
uint8_t *  s 
)
static

Add MAC address to an output stream.

Parameters
[in]streamWhere to write to.
[in]sThe MAC address to write

◆ io_put_ip()

static void io_put_ip ( char *  stream,
uint8_t *  s 
)
static

Add IP address to an output stream.

Parameters
[in]streamWhere to write to.
[in]sThe IP address to write

◆ io_printf()

void io_printf ( char *  stream,
char *  f,
  ... 
)

Print to an output stream.

Parameters
[in]streamWhere to write to.
[in]fThe format string
[in]...Values to fill into the format string