PropWare
3.0.0.229
C++ objects and CMake build system for Parallax Propeller
|
Provides Propeller specific functions to load COGs from EEPROM. More...
Go to the source code of this file.
Macros | |
#define | COG_IMAGE_EEPROM_OFFSET(a) ((uint32_t)(a) - 0xc0000000 + 0x8000) |
Functions | |
int | cognewFromBootEeprom (void *code, size_t codeSize, void *param) |
Start a new Propeller COG from a COG image in EEPROM. More... | |
int | coginitFromBootEeprom (int id, void *code, size_t codeSize, void *param) |
Start a specified Propeller COG from a COG image in EEPROM. More... | |
int | readFromBootEeprom (uint32_t offset, void *buf, size_t size) |
Read from the boot EEPROM. More... | |
int | writeToBootEeprom (uint32_t offset, void *buf, size_t size) |
Write to the boot EEPROM. More... | |
Provides Propeller specific functions to load COGs from EEPROM.
Copyright (c) 2011-2012 by Parallax, Inc. MIT Licensed
Definition in file cogload.h.
int coginitFromBootEeprom | ( | int | id, |
void * | code, | ||
size_t | codeSize, | ||
void * | param | ||
) |
Start a specified Propeller COG from a COG image in EEPROM.
This is used to start a COG with code compiled as PASM, AS, or COG-C when the COG image is in EEPROM. PASM can be any Spin/PASM code that is self-contained. That is, all data for initialization and mailbox use are passed via the par parameter. Changing PASM variables from SPIN code will not work with this method.
GAS and COG-C programs have similar restrictions. COG-C programs should not use any stack or variables in HUB memory that are not accessed via PAR mailbox or pointers.
This function requires the boot i2c COG driver so it must either already be loaded or the memory space used by it cannot have been overwritten by calling the i2cBootBuffer function.
id | COG id of to load |
code | Address of PASM to load |
size | of code in bytes |
param | Value of par parameter usually an address |
int cognewFromBootEeprom | ( | void * | code, |
size_t | codeSize, | ||
void * | param | ||
) |
Start a new Propeller COG from a COG image in EEPROM.
This is used to start a COG with code compiled as PASM, AS, or COG-C when the COG image is in EEPROM. PASM can be any Spin/PASM code that is self-contained. That is, all data for initialization and mailbox use are passed via the par parameter. Changing PASM variables from SPIN code will not work with this method.
GAS and COG-C programs have similar restrictions. COG-C programs should not use any stack or variables in HUB memory that are not accessed via PAR mailbox or pointers.
This function requires the boot i2c COG driver so it must either already be loaded or the memory space used by it cannot have been overwritten by calling the i2cBootBuffer function.
code | Address of PASM to load |
size | of code in bytes |
param | Value of par parameter usually an address |
int readFromBootEeprom | ( | uint32_t | offset, |
void * | buf, | ||
size_t | size | ||
) |
Read from the boot EEPROM.
Use this function to read from the boot EEPROM.
This function requires the boot i2c COG driver so it must either already be loaded or the memory space used by it cannot have been overwritten by calling the i2cBootBuffer function.
offset | Offset from the start of the boot EEPROM to start reading |
buf | Buffer address to receive the boot EEPROM data |
size | Number of bytes to read |
int writeToBootEeprom | ( | uint32_t | offset, |
void * | buf, | ||
size_t | size | ||
) |
Write to the boot EEPROM.
Use this function to write to the boot EEPROM.
This function requires the boot i2c COG driver so it must either already be loaded or the memory space used by it cannot have been overwritten by calling the i2cBootBuffer function.
offset | Offset from the start of the boot EEPROM to start writing |
buf | Buffer address containing the data to write |
size | Number of bytes to write |