python-on-a-chip online compiler

Dependencies:   mbed TSI

Embed: (wiki syntax)

« Back to documentation index

pm.c File Reference

pm.c File Reference

PyMite User API. More...

Go to the source code of this file.

Functions

PmReturn_t pm_init (uint8_t *heap_base, uint32_t heap_size, PmMemSpace_t memspace, uint8_t const *const pusrimg)
 Initializes the PyMite virtual machine and indexes the user's application image.
PmReturn_t pm_run (uint8_t const *modstr)
 Executes the named module.
PmReturn_t pm_vmPeriodic (uint16_t usecsSinceLastCall)
 Needs to be called periodically by the host program.

Variables

volatile uint32_t pm_timerMsTicks = 0
 Stores the timer millisecond-ticks since system start.
volatile uint32_t pm_lastRescheduleTimestamp = 0
 Stores tick timestamp of last scheduler run.

Detailed Description

PyMite User API.

High-level functions to initialize and run PyMite

Definition in file pm.c.


Function Documentation

PmReturn_t pm_init ( uint8_t *  heap_base,
uint32_t  heap_size,
PmMemSpace_t  memspace,
uint8_t const *const   pusrimg 
)

Initializes the PyMite virtual machine and indexes the user's application image.

The VM heap and globals are reset. The argument, pusrimg, may be null for interactive sessions.

Parameters:
heap_baseThe address where the contiguous heap begins
heap_sizeThe size in bytes (octets) of the given heap. Must be a multiple of four.
memspaceMemory space in which the user image is located
pusrimgAddress of the user image in the memory space
Returns:
Return status

Definition at line 36 of file pm.c.

PmReturn_t pm_run ( uint8_t const *  modstr )

Executes the named module.

Parameters:
modstrName of module to run
Returns:
Return status

Definition at line 63 of file pm.c.

PmReturn_t pm_vmPeriodic ( uint16_t  usecsSinceLastCall )

Needs to be called periodically by the host program.

For the desktop target, it is periodically called using a signal. For embedded targets, it needs to be called periodically. It should be called from a timer interrupt.

Parameters:
usecsSinceLastCallMicroseconds (not less than those) that passed since last call. This must be <64535.
Returns:
Return status

Definition at line 102 of file pm.c.


Variable Documentation

volatile uint32_t pm_lastRescheduleTimestamp = 0

Stores tick timestamp of last scheduler run.

Definition at line 32 of file pm.c.

volatile uint32_t pm_timerMsTicks = 0

Stores the timer millisecond-ticks since system start.

Definition at line 29 of file pm.c.