Before including the pp1000.h header file you must define some pre-processor macros describing the configuration of the card. These macros are described in full in the Software Reference Manual and are summarised in the table below.
Configuration items Macros to Define Clock division factor PP1000_DIVIDE1
PP1000_DIVIDE3
PP1000_DIVIDE4Clock source PP1000_CLOCK
External RAM width PP1000_8BIT_RAMS
PP1000_32BIT_RAMS
For example, to set the board up with a clock source of MCLK divided by 4 and with 32 bit access to the external memory banks, the following code should appear at the start of the Handel-C program.
#define PP1000_DIVIDE4
#define PP1000_CLOCK PP1000_MCLK
#define PP1000_32BIT_RAMS
#include “pp1000.h”
PP1000LEDOn(Index);
Arguments | |
Index | Index of LED to switch on. Should be between 0 and 7 inclusive. |
Return Values | |
None. | |
Execution Time | |
One clock cycle. | |
Description | |
|
PP1000LEDff(Index);
Arguments | |
Index | Index of LED to switch off. Should be between 0 and 7 inclusive. |
Return Values | |
None. | |
Execution Time | |
One clock cycle. | |
Description | |
|
PP1000ReadBank0(Reg,Addr);
PP1000ReadBank1(Reg,Addr);
PP1000ReadBank2(Reg,Addr);
PP1000ReadBank3(Reg,Addr);
Arguments | |
Reg | Register to read data into. Must be 8 or 32 bits wide. |
Addr | Address to read data from. Must be 19, 21 or 23 bits wide. |
Return Values | |
Reg is set to contents of memory bank. | |
Execution Time | |
One clock cycle. | |
Description | |
|
PP1000ReadControl(Reg);
Arguments | |
Reg | Register to receive the value from the control port. Must be 8 bits wide. |
Return Values | |
Reg is set to the value from the control port. | |
Execution Time | |
Waits until data is written by host program. | |
Description | |
|
PP1000ReadGPO();
Arguments | |
None | |
Return Values | |
Zero if GPO pin is low or one if GPO pin is high. Return value is one bit wide. | |
Execution Time | |
Zero clock cycles ( macro expression). | |
Description | |
|
PP1000ReleaseMemoryBank(Mask);
Arguments | |
Mask | Mask of banks to release. Must be 4 bits wide. |
Return Values | |
None. | |
Execution Time | |
One clock cycle. | |
Description | |
|
PP1000RequestMemoryBank(Mask);
Arguments | |
Mask | Mask of banks request. Must be 4 bits wide. |
Return Values | |
None. | |
Execution Time | |
Blocks until all banks are granted to the FPGA. | |
Description | |
|
PP1000SetGPI(Expr);
Arguments | |
Expr | Zero to clear GPI pin, non-zero to set GPI pin. |
Return Values | |
None. | |
Execution Time | |
One clock cycle. | |
Description | |
|
PP1000SetLEDs(Mask);
Arguments | |
Mask | Mask of LED states. Must be 8 bits wide. |
Return Values | |
None. | |
Execution Time | |
One clock cycle. | |
Description | |
|
PP1000WriteBank0(Addr,Expr);
PP1000WriteBank1(Addr,Expr);
PP1000WriteBank2(Addr,Expr);
PP1000WriteBank3(Addr,Expr);
Arguments | |
Addr | Address to write data to. Must be 19, 21 or 23 bits wide. |
Expr | Data to write to RAM. Must be 8 or 32 bits wide. |
Return Values | |
None. | |
Execution Time | |
One clock cycle. | |
Description | |
|
PP1000WriteStatus(Expr);
Arguments | |
Expr | Expression to write to the status port. Must be 8 bits wide. |
Return Values | |
None. | |
Execution Time | |
Waits till data is read by host program. | |
Description | |
|