PropWare  3.0.0.229
C++ objects and CMake build system for Parallax Propeller
Macros | Functions | Variables
cog.h File Reference

Inludes common API definitions for COG programming. More...

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

Go to the source code of this file.

Macros

#define _COGMEM   __attribute__((cogmem))
 Can be used in per-variable declarations to tell compiler that a variable should go in COG memory.
 
#define _NATIVE   __attribute__((native))
 Can be used in per-function declarations to tell compiler that function will use cog "call/ret" calling (nonrecursive).
 
#define _NAKED   __attribute__((naked))
 Can be used in per-function declarations to tell compiler that function will not have an epilogue or prologue: these should never return.
 
#define _FCACHE   __attribute__((fcache))
 Can be used in per-function declarations to tell compiler that function should be compiled to load into fcache; useful for guaranteeing timing of small functions.
 
#define _CLKFREQ   _clkfreq
 This is an alias for the 32 bit clock frequency which is kept in address 0.
 
#define _CLKMODE   _clkmode
 This is an alias for the 8 bit clock mode which is kept in address 4. More...
 

Functions

_COGMEM volatile unsigned int _PAR __asm__ ("PAR")
 
_COGMEM volatile unsigned int _CNT __asm__ ("CNT")
 
_COGMEM volatile unsigned int _INA __asm__ ("INA")
 
_COGMEM volatile unsigned int _INB __asm__ ("INB")
 
_COGMEM volatile unsigned int _OUTA __asm__ ("OUTA")
 
_COGMEM volatile unsigned int _OUTB __asm__ ("OUTB")
 
_COGMEM volatile unsigned int _DIRA __asm__ ("DIRA")
 
_COGMEM volatile unsigned int _DIRB __asm__ ("DIRB")
 
_COGMEM volatile unsigned int _CTRA __asm__ ("CTRA")
 
_COGMEM volatile unsigned int _CTRB __asm__ ("CTRB")
 
_COGMEM volatile unsigned int _FRQA __asm__ ("FRQA")
 
_COGMEM volatile unsigned int _FRQB __asm__ ("FRQB")
 
_COGMEM volatile unsigned int _PHSA __asm__ ("PHSA")
 
_COGMEM volatile unsigned int _PHSB __asm__ ("PHSB")
 
_COGMEM volatile unsigned int _VCFG __asm__ ("VCFG")
 
_COGMEM volatile unsigned int _VSCL __asm__ ("VSCL")
 

Variables

unsigned int _clkfreq
 
unsigned char _clkmode
 

Detailed Description

Inludes common API definitions for COG programming.

Each COG includes 16 32 bit special purpose registers. The purposes of the registers are to provide control over user I/O input and output. Some registers like INB, OUTB, DIRB are not used with P8X32A.

The state of each physical input pin is available to any COG via INA. Output pin values are the bitwise "wire OR" of all the COGs at the physical output pins when the DIRA bits are set high (1).

OUTA bits control the state of the physical output pins. If one COG sets a pin to output high (1), and another COG sets the same pin to output low (0), the high (1) will be set.

The per COG special purpose register summary:

Register Description

PAR      Parameter register is used for sharing HUB RAM address info with the COG.
CNT      The system clock count
INA      Use to read the pins when corresponding DIRA bits are 0.
INB      Unused in P8X32A
OUTA     Use to set pin states when corresponding DIRA bits are 1.
OUTB     Unused in P8X32A
DIRA     Use to set pins to input (0) or output (1).
DIRB     Unused in P8X32A
CTRA     Counter A control register.
CTRB     Counter B control register.
FRQA     Counter A frequency register.
FRQB     Counter B frequency register.
PHSA     Counter A phase accumulation register.
PHSB     Counter B phase accumulation register.
VCFG     Video Configuration register can be used for other special output.
VSCL     Video Scale register for setting pixel and frame clocks.

Definition in file cog.h.

Macro Definition Documentation

◆ _CLKMODE

#define _CLKMODE   _clkmode

This is an alias for the 8 bit clock mode which is kept in address 4.

This is not automatically updated by the clkset macro.

Definition at line 111 of file cog.h.

Variable Documentation

◆ _clkfreq

unsigned int _clkfreq

32 bit system startup clock frequency variable

◆ _clkmode

unsigned char _clkmode

System startup clock mode