hsk-libs-dev  270
High Speed Karlsruhe XC878 library collection
Data Structures | Macros | Functions | Variables
main.c File Reference

Simple test file that is not linked into the library. More...

#include <Infineon/XC878.h>
#include "config.h"
#include "hsk_boot/hsk_boot.h"
#include "hsk_timers/hsk_timer01.h"
#include "hsk_can/hsk_can.h"
#include "hsk_icm7228/hsk_icm7228.h"
#include "hsk_adc/hsk_adc.h"
#include "hsk_pwm/hsk_pwm.h"
#include "hsk_pwc/hsk_pwc.h"
#include "hsk_flash/hsk_flash.h"
#include "hsk_wdt/hsk_wdt.h"
#include "hsk_io/hsk_io.h"
Include dependency graph for main.c:

Data Structures

struct  hsk_flash_struct
 This struct is a template for data that can be written to the D-Flash. More...
 

Macros

#define PERSIST_VERSION   1
 The version of the persist struct. More...
 

Functions

void p1_init (void)
 Set up buffer and ports for display driver at I/O port P1 . More...
 
void p1_refresh (void)
 Reflesh displays at I/O port P1 with the buffered data. More...
 
void p1_writeString (char const *const str, ubyte const pos, ubyte const len)
 Write an ASCII encoded string into p1_buffer. More...
 
void p1_writeDec (uword const value, char const power, ubyte const pos, ubyte const len)
 Write a decimal number into p1_buffer. More...
 
void p1_writeHex (uword const value, char const power, ubyte const pos, ubyte const len)
 Write a hexadecimal number into p1_buffer. More...
 
void p1_illuminate (ubyte const segments, ubyte const pos, ubyte const len)
 Illuminate a number of segments in p1_buffer. More...
 
void main (void)
 Call init functions and invoke the run routine. More...
 
void init (void)
 Initialize ports, timers and ISRs. More...
 
void run (void)
 The main test code body. More...
 
void tick0 (void)
 A ticking function called back by the timer T0 ISR. More...
 

Variables

ubyte p1_buffer [8]
 Buffer for display driver at I/O port P1 . More...
 
volatile struct hsk_flash_struct persist
 This structure is used to persist data between resets. More...
 
volatile uword tick0_count_250 = 0
 A counter used to detecting that 250ms have passed. More...
 
volatile ubyte tick0_count_20 = 10
 A counter used to detecting that 20ms have passed. More...
 
volatile uword adc7
 The storage variable for the potentiometer on the eval board. More...
 

Detailed Description

Simple test file that is not linked into the library.

This file is normally rigged to run on the XC800 Starter Kit eval board and used for testing whatever code is currently under development.

Author
kami

Macro Definition Documentation

§ PERSIST_VERSION

#define PERSIST_VERSION   1

The version of the persist struct.

Function Documentation

§ init()

void init ( void  )

Initialize ports, timers and ISRs.

Here is the call graph for this function:

§ main()

void main ( void  )

Call init functions and invoke the run routine.

Here is the call graph for this function:

§ p1_illuminate()

void p1_illuminate ( ubyte const  segments,
ubyte const  pos,
ubyte const  len 
)
inline

Illuminate a number of segments in p1_buffer.

Parameters
segmentsThe number of segments to illuminate
posThe target position in the buffer
lenThe number of digits available to encode the number
See also
ICM7228_FACTORY
hsk_icm7228_illuminate

§ p1_init()

void p1_init ( void  )

Set up buffer and ports for display driver at I/O port P1 .

See also
ICM7228_FACTORY

§ p1_refresh()

void p1_refresh ( void  )

Reflesh displays at I/O port P1 with the buffered data.

See also
ICM7228_FACTORY

§ p1_writeDec()

void p1_writeDec ( uword const  value,
char const  power,
ubyte const  pos,
ubyte const  len 
)
inline

Write a decimal number into p1_buffer.

Parameters
valueThe number to encode
powerThe 10 base power of the number to encode
posThe target position in the buffer
lenThe number of digits available to encode the number
See also
ICM7228_FACTORY
hsk_icm7228_writeDec

§ p1_writeHex()

void p1_writeHex ( uword const  value,
char const  power,
ubyte const  pos,
ubyte const  len 
)
inline

Write a hexadecimal number into p1_buffer.

Parameters
valueThe number to encode
powerThe 16 base power of the number to encode
posThe target position in the buffer
lenThe number of digits available to encode the number
See also
ICM7228_FACTORY
hsk_icm7228_writeHex

§ p1_writeString()

void p1_writeString ( char const *const  str,
ubyte const  pos,
ubyte const  len 
)
inline

Write an ASCII encoded string into p1_buffer.

Parameters
strThe buffer to read the ASCII string from
posThe position in the buffer to write the encoded string to
lenThe target length of the encoded string
See also
ICM7228_FACTORY
hsk_icm7228_writeString

§ run()

void run ( void  )

The main test code body.

Here is the call graph for this function:

§ tick0()

void tick0 ( void  )

A ticking function called back by the timer T0 ISR.

Variable Documentation

§ adc7

volatile uword adc7

The storage variable for the potentiometer on the eval board.

§ p1_buffer

ubyte p1_buffer[8]

Buffer for display driver at I/O port P1 .

See also
ICM7228_FACTORY

§ persist

persist

This structure is used to persist data between resets.

§ tick0_count_20

volatile ubyte tick0_count_20 = 10

A counter used to detecting that 20ms have passed.

§ tick0_count_250

volatile uword tick0_count_250 = 0

A counter used to detecting that 250ms have passed.