python-on-a-chip online compiler

Dependencies:   mbed TSI

/media/uploads/va009039/p14p-f446re.png

more info: python-on-a-chip

Committer:
va009039
Date:
Thu Apr 14 22:32:57 2016 +0000
Revision:
15:94ca5c8003e5
Parent:
0:65f1469d6bfb
update Nucleo-F401RE.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
va009039 0:65f1469d6bfb 1 /*
va009039 0:65f1469d6bfb 2 # This file is Copyright 2010 Dean Hall.
va009039 0:65f1469d6bfb 3 # This file is part of the PyMite VM.
va009039 0:65f1469d6bfb 4 # This file is licensed under the MIT License.
va009039 0:65f1469d6bfb 5 # See the LICENSE file for details.
va009039 0:65f1469d6bfb 6 */
va009039 0:65f1469d6bfb 7
va009039 0:65f1469d6bfb 8
va009039 0:65f1469d6bfb 9 #ifndef __PLAT_H__
va009039 0:65f1469d6bfb 10 #define __PLAT_H__
va009039 0:65f1469d6bfb 11
va009039 0:65f1469d6bfb 12
va009039 0:65f1469d6bfb 13 /**
va009039 0:65f1469d6bfb 14 * \file
va009039 0:65f1469d6bfb 15 * \brief PyMite's Porting Interface
va009039 0:65f1469d6bfb 16 */
va009039 0:65f1469d6bfb 17
va009039 0:65f1469d6bfb 18
va009039 0:65f1469d6bfb 19 /**
va009039 0:65f1469d6bfb 20 * Initializes the platform as needed by the routines
va009039 0:65f1469d6bfb 21 * in the platform implementation file.
va009039 0:65f1469d6bfb 22 */
va009039 0:65f1469d6bfb 23 PmReturn_t plat_init(void);
va009039 0:65f1469d6bfb 24
va009039 0:65f1469d6bfb 25 /** De-initializes the platform after the VM is done running. */
va009039 0:65f1469d6bfb 26 PmReturn_t plat_deinit(void);
va009039 0:65f1469d6bfb 27
va009039 0:65f1469d6bfb 28 /**
va009039 0:65f1469d6bfb 29 * Returns the byte at the given address in memspace.
va009039 0:65f1469d6bfb 30 *
va009039 0:65f1469d6bfb 31 * Increments the address (just like getc and read(1))
va009039 0:65f1469d6bfb 32 * to make image loading work (recursively).
va009039 0:65f1469d6bfb 33 *
va009039 0:65f1469d6bfb 34 * PORT: fill in getByte for each memspace in the system;
va009039 0:65f1469d6bfb 35 * call sys_error for invalid memspaces.
va009039 0:65f1469d6bfb 36 *
va009039 0:65f1469d6bfb 37 * @param memspace memory space/type
va009039 0:65f1469d6bfb 38 * @param paddr ptr to address
va009039 0:65f1469d6bfb 39 * @return byte from memory.
va009039 0:65f1469d6bfb 40 * paddr - points to the next byte
va009039 0:65f1469d6bfb 41 */
va009039 0:65f1469d6bfb 42 uint8_t plat_memGetByte(PmMemSpace_t memspace, uint8_t const **paddr);
va009039 0:65f1469d6bfb 43
va009039 0:65f1469d6bfb 44 /**
va009039 0:65f1469d6bfb 45 * Receives one byte from the default connection,
va009039 0:65f1469d6bfb 46 * usually UART0 on a target device or stdio on the desktop
va009039 0:65f1469d6bfb 47 */
va009039 0:65f1469d6bfb 48 PmReturn_t plat_getByte(uint8_t *b);
va009039 0:65f1469d6bfb 49
va009039 0:65f1469d6bfb 50
va009039 0:65f1469d6bfb 51 /**
va009039 0:65f1469d6bfb 52 * Sends one byte out on the default connection,
va009039 0:65f1469d6bfb 53 * usually UART0 on a target device or stdio on the desktop
va009039 0:65f1469d6bfb 54 */
va009039 0:65f1469d6bfb 55 PmReturn_t plat_putByte(uint8_t b);
va009039 0:65f1469d6bfb 56
va009039 0:65f1469d6bfb 57
va009039 0:65f1469d6bfb 58 /**
va009039 0:65f1469d6bfb 59 * Gets the number of timer ticks that have passed since system start.
va009039 0:65f1469d6bfb 60 */
va009039 0:65f1469d6bfb 61 PmReturn_t plat_getMsTicks(uint32_t *r_ticks);
va009039 0:65f1469d6bfb 62
va009039 0:65f1469d6bfb 63
va009039 0:65f1469d6bfb 64 /**
va009039 0:65f1469d6bfb 65 * Reports an exception or other error that caused the thread to quit
va009039 0:65f1469d6bfb 66 */
va009039 0:65f1469d6bfb 67 void plat_reportError(PmReturn_t result);
va009039 0:65f1469d6bfb 68
va009039 0:65f1469d6bfb 69 #endif /* __PLAT_H__ */