![]() |
PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Provides Propeller 1 specific functions. More...
Go to the source code of this file.
Macros | |
#define | coginit(id, code, param) |
Start a cog with a parameter. More... | |
#define | getcnt() _CNT |
CNT register accessor. More... | |
#define | shiftout(val, mask, port) |
shiftout send the low bit of a register to a pin or pins More... | |
#define | PAR _PAR |
Parameter register is used for sharing HUB RAM address info with the COG. | |
#define | CNT _CNT |
The system clock count. | |
#define | INA _INA |
Use to read the pins when corresponding DIRA bits are 0. | |
#define | INB _INB |
Unused in P8X32A. | |
#define | OUTA _OUTA |
Use to set output pin states when corresponding DIRA bits are 1. | |
#define | OUTB _OUTB |
Unused in P8X32A. | |
#define | DIRA _DIRA |
Use to set pins to input (0) or output (1). | |
#define | DIRB _DIRB |
Unused in P8X32A. | |
#define | CTRA _CTRA |
Counter A control register. | |
#define | CTRB _CTRB |
Counter B control register. | |
#define | FRQA _FRQA |
Counter A frequency register. | |
#define | FRQB _FRQB |
Counter B frequency register. | |
#define | PHSA _PHSA |
Counter A phase accumulation register. | |
#define | PHSB _PHSB |
Counter B phase accumulation register. | |
#define | VCFG _VCFG |
Video Configuration register can be used for other special output. | |
#define | VSCL _VSCL |
Video Scale register for setting pixel and frame clocks. | |
#define | RCFAST 0x00 |
Constants uses with clkset() | |
#define | RCSLOW 0x01 |
#define | XINPUT 0x22 |
#define | XTAL1 0x2a |
#define | XTAL2 0x32 |
#define | XTAL3 0x3a |
#define | PLL1X 0x41 |
#define | PLL2X 0x42 |
#define | PLL4X 0x43 |
#define | PLL8X 0x44 |
#define | PLL16X 0x45 |
Functions | |
static __inline__ int | getpin (int pin) |
getpin accessor used to read the state of a pin. More... | |
static __inline__ void | setpin (int pin, int value) |
setpin accessor used to write the state of a pin. More... | |
static __inline__ void | togglepin (int pin) |
togglepin accessor used to toggle the state of a pin. More... | |
Provides Propeller 1 specific functions.
Copyright (c) 2011-2013 by Parallax, Inc. MIT Licensed
Definition in file propeller1.h.
#define coginit | ( | id, | |
code, | |||
param | |||
) |
Start a cog with a parameter.
The fields in parameters are:
It is important to realize that a 14 bit address means that long aligned addresses or pointers should be use. That is if you pass a value to the PAR such as 3, the value will be truncated to 0. A value 5 will be interpreted as 4.
id | The COG id to initialize |
code | Start address of PASM code to load. |
param | PAR address |
Definition at line 39 of file propeller1.h.
#define getcnt | ( | ) | _CNT |
CNT register accessor.
P1 provides a COG accessible CNT register.
This macro is a convenience for portability between P1/P2 code.
Definition at line 53 of file propeller1.h.
#define shiftout | ( | val, | |
mask, | |||
port | |||
) |
shiftout send the low bit of a register to a pin or pins
This inline macro provides an efficient way to send the low bit of a value out a port.
val | Value to be shift right; (val&1) will be placed in port |
mask | Indicates which bits of port should receive the value of (val&1); wherever mask has a 1 bit this will be replaced with the low bit of val. Wherever mask has a 0 bit port will be left unchanged. |
port | Register to be modified according to val and mask; typically this will be _OUTA |
Definition at line 131 of file propeller1.h.
|
static |
getpin accessor used to read the state of a pin.
P1 provides pin access via registers only. This inline macro provides access to read a given pin.
This macro is a convenience for portability between P1/P2 code.
pin | Pin to read in the range 0:31. |
Definition at line 66 of file propeller1.h.
|
static |
setpin accessor used to write the state of a pin.
P1 provides pin access via registers only. This inline macro provides access to write the value to a given pin.
This macro is a convenience for portability between P1/P2 code.
pin | Pin to read in the range 0:31. |
value | The value to set to the pin 0:1 |
Definition at line 85 of file propeller1.h.
|
static |
togglepin accessor used to toggle the state of a pin.
P1 provides pin access via registers only. This inline macro provides access to toggle the value of a given pin. Toggle means to set the opposite of the existing state.
This macro is a convenience for portability between P1/P2 code.
pin | Pin to read in the range 0:31. |
Definition at line 107 of file propeller1.h.