pyFuncsInC.h File Reference

This file implements Python functions defined in main.py. More...

#include "pm.h"

Go to the source code of this file.

Functions

Read/write and high-level digital pin configuration functions
These functions set up the I/O system, read and write to a pin, and allow configuring an I/O pin using a single function call. They wrap a series of C functions from pic24_pyports.h into the pic24_dspic33::digital_io Python class.

PmReturn_t configDigitalPinPy (pPmFrame_t *ppframe)
PmReturn_t setDigitalPinPy (pPmFrame_t *ppframe)
PmReturn_t readDigitalValuePy (pPmFrame_t *ppframe)
PmReturn_t readDigitalPinPy (pPmFrame_t *ppframe)
PmReturn_t readDigitalLatchPy (pPmFrame_t *ppframe)
Analog pin configuration and ADC read routines.
PmReturn_t configAnalogPinPy (pPmFrame_t *ppframe)
PmReturn_t readAnalogCodePy (pPmFrame_t *ppframe)
PmReturn_t readAnalogFloatPy (pPmFrame_t *ppframe, float f_scale)
PWM configuration and use
PmReturn_t configPwmPy (pPmFrame_t *ppframe)
PmReturn_t configPwm (uint32_t u32_freq, bool_t b_isTimer2, uint16_t u16_oc, int16_t i16_ocPin)
PmReturn_t setPwmCountsPy (pPmFrame_t *ppframe)
PmReturn_t setPwmCounts (uint16_t u16_counts, uint16_t u16_oc)
PmReturn_t setPwmRatioPy (pPmFrame_t *ppframe)


Detailed Description

This file implements Python functions defined in main.py.

Definition in file pyFuncsInC.h.


Function Documentation

PmReturn_t configAnalogPinPy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::analog_input::__init__ function. The configAnalogPin function does the work.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 218 of file pyFuncsInC.c.

PmReturn_t configDigitalPinPy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::digital_io::__init__ function. The configDigitalPin function does the work.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 76 of file pyFuncsInC.c.

PmReturn_t configPwm ( uint32_t  u32_freq,
bool_t  b_isTimer2,
uint16_t  u16_oc,
int16_t  i16_ocPin 
)

Configure an output compare module for PWM operation.

Parameters:
u32_freq Frequency at which the PWM will operate, in Hz.
b_isTimer2 True to use timer2, false to use timer3 for PWM.
u16_oc Output compare module to use.
i16_ocPin For remappable devices, the port P pin on which to map the PWM output. For non-remappable devices, this value must be < 0.

Definition at line 321 of file pyFuncsInC.c.

PmReturn_t configPwmPy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::pwm::__init__ function. The configPwm function does the work.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 288 of file pyFuncsInC.c.

PmReturn_t readAnalogCodePy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::analog_input::getCode function.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 262 of file pyFuncsInC.c.

PmReturn_t readAnalogFloatPy ( pPmFrame_t ppframe,
float  f_scale 
)

Implements the Python pic24_dspic33::analog_input::getVoltage function.

Parameters:
ppframe Python stack frame containing arguments to the function.
f_scale Scale factor to multiply the code by before returning a value.

Definition at line 275 of file pyFuncsInC.c.

PmReturn_t readDigitalLatchPy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::digital_io::getLatch function. The readDigitalLatch function does the work.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 198 of file pyFuncsInC.c.

PmReturn_t readDigitalPinPy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::digital_io::getPin function. The readDigitalPin function does the work.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 151 of file pyFuncsInC.c.

PmReturn_t readDigitalValuePy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::digital_io::get function.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 171 of file pyFuncsInC.c.

PmReturn_t setDigitalPinPy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::digital_io::set function. The setDigitalPin function does the work.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 130 of file pyFuncsInC.c.

PmReturn_t setPwmCounts ( uint16_t  u16_counts,
uint16_t  u16_oc 
)

Set the duty cycle of the PWM peripheral.

Parameters:
u16_counts A number of PR2/3 counts which gives the on time of the PWM wave to generate. Must be less than the PR2/3 value.
u16_oc Output compare module to use.

Definition at line 446 of file pyFuncsInC.c.

PmReturn_t setPwmCountsPy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::pwm::setCounts function. The setPwmCounts function does the work.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 430 of file pyFuncsInC.c.

PmReturn_t setPwmRatioPy ( pPmFrame_t ppframe  ) 

Implements the Python pic24_dspic33::pwm::set function.

Parameters:
ppframe Python stack frame containing arguments to the function.

Definition at line 457 of file pyFuncsInC.c.


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