Revert "REVONANO - Workaround for the SBUS issue (use oversample 8 instead of 16...
[librepilot.git] / flight / libraries / PyMite / vm / plat_interface.h
blobd93e8ba9e48cd309d0ede84066d8b7a951faf1a5
1 /*
2 # This file is Copyright 2007, 2009, 2010 Dean Hall.
4 # This file is part of the PyMite VM.
5 # The PyMite VM is free software: you can redistribute it and/or modify
6 # it under the terms of the GNU GENERAL PUBLIC LICENSE Version 2.
8 # The PyMite VM is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11 # A copy of the GNU GENERAL PUBLIC LICENSE Version 2
12 # is seen in the file COPYING in this directory.
16 #ifndef __PLAT_H__
17 #define __PLAT_H__
20 /**
21 * \file
22 * \brief PyMite's Porting Interface
26 /**
27 * Initializes the platform as needed by the routines
28 * in the platform implementation file.
30 PmReturn_t plat_init(void);
32 /** De-initializes the platform after the VM is done running. */
33 PmReturn_t plat_deinit(void);
35 /**
36 * Returns the byte at the given address in memspace.
38 * Increments the address (just like getc and read(1))
39 * to make image loading work (recursively).
41 * PORT: fill in getByte for each memspace in the system;
42 * call sys_error for invalid memspaces.
44 * @param memspace memory space/type
45 * @param paddr ptr to address
46 * @return byte from memory.
47 * paddr - points to the next byte
49 uint8_t plat_memGetByte(PmMemSpace_t memspace, uint8_t const **paddr);
51 /**
52 * Receives one byte from the default connection,
53 * usually UART0 on a target device or stdio on the desktop
55 PmReturn_t plat_getByte(uint8_t *b);
58 /**
59 * Sends one byte out on the default connection,
60 * usually UART0 on a target device or stdio on the desktop
62 PmReturn_t plat_putByte(uint8_t b);
65 /**
66 * Gets the number of timer ticks that have passed since system start.
68 PmReturn_t plat_getMsTicks(uint32_t *r_ticks);
71 /**
72 * Reports an exception or other error that caused the thread to quit
74 void plat_reportError(PmReturn_t result);
76 #endif /* __PLAT_H__ */