Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
plat.h
00001 /* 00002 # This file is Copyright 2007, 2009 Dean Hall. 00003 # 00004 # This file is part of the PyMite VM. 00005 # The PyMite VM is free software: you can redistribute it and/or modify 00006 # it under the terms of the GNU GENERAL PUBLIC LICENSE Version 2. 00007 # 00008 # The PyMite VM is distributed in the hope that it will be useful, 00009 # but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00011 # A copy of the GNU GENERAL PUBLIC LICENSE Version 2 00012 # is seen in the file COPYING in this directory. 00013 */ 00014 00015 00016 #ifndef __PLAT_H__ 00017 #define __PLAT_H__ 00018 00019 00020 /** 00021 * \file 00022 * \brief PyMite's Porting Interface 00023 */ 00024 00025 00026 /** 00027 * Initializes the platform as needed by the routines 00028 * in the platform implementation file. 00029 */ 00030 PmReturn_t plat_init(void); 00031 00032 /** De-initializes the platform after the VM is done running. */ 00033 PmReturn_t plat_deinit(void); 00034 00035 /** 00036 * Returns the byte at the given address in memspace. 00037 * 00038 * Increments the address (just like getc and read(1)) 00039 * to make image loading work (recursively). 00040 * 00041 * PORT: fill in getByte for each memspace in the system; 00042 * call sys_error for invalid memspaces. 00043 * 00044 * @param memspace memory space/type 00045 * @param paddr ptr to address 00046 * @return byte from memory. 00047 * paddr - points to the next byte 00048 */ 00049 uint8_t plat_memGetByte(PmMemSpace_t memspace, uint8_t const **paddr); 00050 00051 /** 00052 * Receives one byte from the default connection, 00053 * usually UART0 on a target device or stdio on the desktop 00054 */ 00055 PmReturn_t plat_getByte(uint8_t *b); 00056 00057 00058 /** 00059 * Sends one byte out on the default connection, 00060 * usually UART0 on a target device or stdio on the desktop 00061 */ 00062 PmReturn_t plat_putByte(uint8_t b); 00063 00064 00065 /** 00066 * Gets the number of timer ticks that have passed since system start. 00067 */ 00068 PmReturn_t plat_getMsTicks(uint32_t *r_ticks); 00069 00070 00071 /** 00072 * Reports an exception or other error that caused the thread to quit 00073 */ 00074 void plat_reportError(PmReturn_t result); 00075 00076 #endif /* __PLAT_H__ */
Generated on Tue Jul 12 2022 17:07:01 by
