Main Page   Modules   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

/projects/cubeos/src_current/kernel/cubeos.h File Reference

#include <config.h>
#include <mc68332.h>
#include <sys_var.h>
#include <schedule.h>
#include <taskconst.h>
#include <seminl.h>

Include dependency graph for cubeos.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define readbyte(x)   (*(volatile unsigned char *)x)
 reads one byte from memory location x. More...

#define writebyte(x, y)   *(unsigned char *)(x) = y
 writes one byte y to memory location x. More...

#define readshort(x)   (*(unsigned short *)(void *)(x))
 reads one short from memory location x. More...

#define writeshort(x, y)   *(unsigned short *)(x) = y
 writes one short y to memory location x. More...

#define readint(x)   (*(unsigned int *)(void *)(x))
 reads one int from memory location x. More...

#define writeint(x, y)   *(unsigned int *)(x) = y
 writes one int y to memory location x. More...

#define writeshortpos(x, y, mask, pos)
 writes some bits of y to memory location x. More...

#define readshortpos(x, mask, pos)   ((readshort(x)>>(pos))&(mask))
 reads some bits of y to memory location x. More...


Functions

void disable ()
 disables interrupt processing. More...

void enable ()
 enable interrupt processing. More...

void init_LED ()
 init control of the CUBE-II onboard status LED. More...

void LED_ON ()
 switches the CUBE-II onboard LED on. More...

void LED_OFF ()
 switches the CUBE-II onboard LED off. More...


Detailed Description

Definition in file cubeos.h.


Define Documentation

#define readbyte      (*(volatile unsigned char *)x)
 

reads one byte from memory location x.

Definition at line 120 of file cubeos.h.

Referenced by DUART_duart, FBIN_make, FBIN_set, and QSM_init.

#define readint      (*(unsigned int *)(void *)(x))
 

reads one int from memory location x.

Definition at line 124 of file cubeos.h.

#define readshort      (*(unsigned short *)(void *)(x))
 

reads one short from memory location x.

Definition at line 122 of file cubeos.h.

Referenced by _QSM_sci_dis_rx, _QSM_sci_dis_tx, _QSM_sci_en_rx, _QSM_sci_en_tx, _QSM_sci_txbyte, FLASH_bcopy, FLASH_init, I2C_init, KERN_exphandler, KERN_panic, KERN_softreset, QSM_sci_int, QSM_sci_rxchar, RCJ_init, RG_init, and SPI_init.

#define readshortpos x,
mask,
pos       ((readshort(x)>>(pos))&(mask))
 

reads some bits of y to memory location x.

readshortpos(x,mask,pos) reads memoy location x, shifts it pos bits right and masks the remaining bits with mask. example: readshortshortpos(TPU_CFSR3,0xf,0x8) reads the function code (4 bits wide, so mask 0xf) out of the TPU channel function select register of TPU Channel 2 (bits 8-11)

Definition at line 149 of file cubeos.h.

Referenced by getRCD.

#define writebyte x,
     *(unsigned char *)(x) = y
 

writes one byte y to memory location x.

Definition at line 121 of file cubeos.h.

Referenced by clearRRXSEL, clearRTXSEL, DUART_duart, FBIN_make, FBIN_set, init_LED, LED_OFF, LED_ON, QSM_init, setRRXSEL, setRTXSEL, and SPI_newcommand.

#define writeint x,
     *(unsigned int *)(x) = y
 

writes one int y to memory location x.

Definition at line 125 of file cubeos.h.

Referenced by _KERN_initcontext.

#define writeshort x,
     *(unsigned short *)(x) = y
 

writes one short y to memory location x.

Definition at line 123 of file cubeos.h.

Referenced by _QSM_sci_dis_rx, _QSM_sci_dis_tx, _QSM_sci_en_rx, _QSM_sci_en_tx, _QSM_sci_setbps, _QSM_sci_txbyte, _settimeofday, FBIN_make, FBIN_set, FLASH_bcopy, FLASH_init, I2C_init, KERN_exphandler, KERN_init_ptimer, KERN_panic, KERN_softreset, QSM_init, QSM_sci_int, QSM_sciinit, RCJ_fast, RCJ_init, RCJ_slow, RG_init, settimeofday, SPI_init, SPI_resetcmd, and TPU_init.

#define writeshortpos x,
y,
mask,
pos   
 

Value:

writeshort(x,(readshort(x)\
                                      &(~((mask)<<(pos)))) \
                                      |(((mask)&y)<<(pos)))
writes some bits of y to memory location x.

writeshortpos(x,y,mask,pos) masks y with mask, shifts it pos bits left and masks the remaining bits into the memory location x. example: writeshortpos(TPU_CFSR3,0x9,0xf,0x8) writes function code 0x9 (4 bits wide, so mask 0xf) into TPU channel function select register for TPU Channel 2 (bits 8-11)

Definition at line 136 of file cubeos.h.

Referenced by KERN_init_ptimer.


Function Documentation

void init_LED   [inline, static]
 

init control of the CUBE-II onboard status LED.

This reconfigures the Port E of the mc68332 so that one bit is used for output.

Definition at line 156 of file cubeos.h.

References SIM_DDRE, SIM_PEPAR, SIM_PORTE, and writebyte.

void LED_OFF   [inline, static]
 

switches the CUBE-II onboard LED off.

Definition at line 169 of file cubeos.h.

References SIM_PORTE, and writebyte.

Referenced by FLASH_bcopy.

void LED_ON   [inline, static]
 

switches the CUBE-II onboard LED on.

Definition at line 163 of file cubeos.h.

References SIM_PORTE, and writebyte.

Referenced by FLASH_bcopy.


Generated on Thu Feb 20 15:38:52 2003 for cubeOS by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002