plat.c File Reference

PyMite platform-specific routines for a PIC24/dsPIC33 target. More...

#include <stdio.h>
#include <pic24_all.h>
#include "pm.h"

Go to the source code of this file.

Defines

#define __FILE_ID__   0x51
#define ISR_PERIOD   1

Functions

void _ISR _T2Interrupt (void)
void configTimer2 (void)
PmReturn_t plat_init (void)
PmReturn_t plat_deinit (void)
uint8_t plat_memGetByte (PmMemSpace_t memspace, uint8_t const **paddr)
PmReturn_t plat_getByte (uint8_t *b)
PmReturn_t plat_putByte (uint8_t b)
PmReturn_t plat_getMsTicks (uint32_t *r_ticks)
void plat_reportError (PmReturn_t result)

Variables

volatile uint32_t u32_ms = 0


Detailed Description

PyMite platform-specific routines for a PIC24/dsPIC33 target.

Definition in file plat.c.


Define Documentation

#define ISR_PERIOD   1

The number of milliseconds between timer interrupts.

Definition at line 35 of file plat.c.


Function Documentation

void _ISR _T2Interrupt ( void   ) 

Interrupt Service Routine for Timer2. Receives one interrupts per ISR_PERIOD milliseconds.

Definition at line 40 of file plat.c.

void configTimer2 ( void   ) 

Configure timer 2 to produce interrupts every ISR_PERIOD ms.

Definition at line 50 of file plat.c.

PmReturn_t plat_deinit ( void   ) 

De-initializes the platform after the VM is done running.

Definition at line 76 of file plat.c.

PmReturn_t plat_getByte ( uint8_t b  ) 

Receives one byte from the default connection, usually UART0 on a target device or stdio on the desktop

Definition at line 126 of file plat.c.

PmReturn_t plat_getMsTicks ( uint32_t r_ticks  ) 

Return the number of milliseconds since the system was initialized.

Definition at line 161 of file plat.c.

PmReturn_t plat_init ( void   ) 

Initializes the platform as needed by the routines in the platform implementation file.

PyMite platform-specific routines for MoSync target

Definition at line 66 of file plat.c.

uint8_t plat_memGetByte ( PmMemSpace_t  memspace,
uint8_t const **  paddr 
)

Returns the byte at the given address in memspace.

Increments the address (just like getc and read(1)) to make image loading work (recursively).

PORT: fill in getByte for each memspace in the system; call sys_error for invalid memspaces.

Parameters:
memspace memory space/type
paddr ptr to address
Returns:
byte from memory. paddr - points to the next byte

Definition at line 90 of file plat.c.

PmReturn_t plat_putByte ( uint8_t  b  ) 

Sends one byte out on the default connection, usually UART0 on a target device or stdio on the desktop

Definition at line 150 of file plat.c.

void plat_reportError ( PmReturn_t  result  ) 

Reports an exception or other error that caused the thread to quit

Definition at line 168 of file plat.c.


Variable Documentation

volatile uint32_t u32_ms = 0

Number of milliseconds since the system was initialized.

Definition at line 32 of file plat.c.


Generated on Mon Oct 18 07:40:48 2010 for Python-on-a-chip by  doxygen 1.5.9