librfn
An ad-hoc utility library
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
src
regdumpdemo.c
Go to the documentation of this file.
1
/*
2
* regdumpdemo.c
3
*
4
* Part of librfn (a general utility library from redfelineninja.org.uk)
5
*
6
* Copyright (C) 2014 Daniel Thompson <daniel@redfelineninja.org.uk>
7
*
8
* This program is free software; you can redistribute it and/or modify
9
* it under the terms of the GNU Lesser General Public License as published
10
* by the Free Software Foundation; either version 3 of the License, or
11
* (at your option) any later version.
12
*/
13
14
#include <assert.h>
15
#include <stdio.h>
16
#include <
string.h
>
17
18
#include "
librfn.h
"
19
20
static
const
regdump_desc_t
myreg[] = { {
"MYREG"
},
21
{
"AF"
, 0x000f },
22
{
"EN"
, 0x0010 },
23
{
"OVF"
, 0x0020 },
24
{
"RXI"
, 0x0040 },
25
{
"TXI"
, 0x0080 },
26
{
"CH"
, 0xff00 },
27
{ NULL } };
28
29
int
main
(
int
argc,
char
*argv[])
30
{
31
regdump
(0xffff, myreg);
32
regdump
(0x0000, myreg);
33
regdump
(0x2041, myreg);
34
35
return
0;
36
}
string.h
regdump_desc
Register description structure.
Definition:
regdump.h:55
regdump
void regdump(uintreg_t reg, const regdump_desc_t *desc)
Dump the current register status to stdout.
Definition:
regdump.c:50
main
int main(int argc, char *argv[])
Definition:
regdumpdemo.c:29
librfn.h
Generated on Sat Feb 6 2016 21:25:32 for librfn by
1.8.10