1 /******************************************************************************
2 * Copyright (c) 2013 IBM Corporation
4 * This program and the accompanying materials
5 * are made available under the terms of the BSD License
6 * which accompanies this distribution, and is available at
7 * http://www.opensource.org/licenses/bsd-license.php
10 * IBM Corporation - initial implementation
11 *****************************************************************************/
14 * libbcm Forth wrapper
19 // : bcm57xx-open ( -- false | [ driver true ] )
20 PRIM(BCM57XX_X2d_OPEN)
22 net_driver_t *net_driver = bcm57xx_open();
25 TOS.u = (unsigned long)net_driver; PUSH;
34 // : bcm57xx-close ( driver -- )
35 PRIM(BCM57XX_X2d_CLOSE)
37 net_driver_t *driver = TOS.a; POP;
38 bcm57xx_close(driver);
43 // : bcm57xx-read ( addr len -- actual )
44 PRIM(BCM57XX_X2d_READ)
47 TOS.n = bcm57xx_read(TOS.a, len);
51 // : bcm57xx-write ( addr len -- actual )
52 PRIM(BCM57XX_X2d_WRITE)
55 TOS.n = bcm57xx_write(TOS.a, len);