// gertboard gforth interface version 01.00 #include "ggb.h" int ggb_version( void) { return GGB_VERSION; } // functions to retrieve the base address of the various peripheral registers, // which are global variables in the gertboard library // volatile unsigned *ggb_gpio( void) { return gpio; } volatile unsigned *ggb_pwm( void) { return pwm; } volatile unsigned *ggb_clk( void) { return clk; } volatile unsigned *ggb_spi0( void) { return spi0; } volatile unsigned *ggb_uart( void) { return uart; } // functions which invoke macros from the gertboard library // void ggb_INP_GPIO( int g) { INP_GPIO(g); } void ggb_OUT_GPIO( int g) { OUT_GPIO(g); } void ggb_SET_GPIO_ALT( int g, int a) { SET_GPIO_ALT(g,a); }