All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vexdigital.c File Reference

Digital port driver. More...

#include "ch.h"
#include "hal.h"
#include "vex.h"

Functions

void vexDigitalModeSet (tVexDigitalPin pin, tVexDigitalMode mode)
 Set digital port mode. More...
 
tVexDigitalMode vexDigitalModeGet (tVexDigitalPin pin)
 Set digital port mode. More...
 
void vexDigitalPinSet (tVexDigitalPin pin, tVexDigitalState state)
 Set digital pin state. More...
 
tVexDigitalState vexDigitalPinGet (tVexDigitalPin pin)
 Get digital pin state. More...
 
void vexDigitalIntrSet (tVexDigitalPin pin)
 Set digital pin to cause interrupt. More...
 
void vexDigitalIntrRun ()
 Enable any digital pin interrupts. More...
 
int32_t vexDigitalIntrCountGet (tVexDigitalPin pin)
 Get the interrupt count for a given digital pin. More...
 

Variables

ioDef vexioDefinition [kVexDigital_Num]
 definition of a digital IO pin More...
 

Detailed Description

Digital port driver.

Function Documentation

void vexDigitalModeSet ( tVexDigitalPin  pin,
tVexDigitalMode  mode 
)

Set digital port mode.

Parameters
[in]pinThe pin to set the new mode on
[in]modekVexDigitalInput or kVexDigitalOutput

Change the type of a digital IO port All ports are initially initialized to be INPUTs unless the board.h file is changed (not recommended)

tVexDigitalMode vexDigitalModeGet ( tVexDigitalPin  pin)

Set digital port mode.

Parameters
[in]pinThe pin to get the mode for
Returns
the mode for the given pin
void vexDigitalPinSet ( tVexDigitalPin  pin,
tVexDigitalState  state 
)

Set digital pin state.

Parameters
[in]pinThe pin to set the new state on
[in]statekVexDigitalLow or kVexDigitalHigh

Set a digital pin to a value, high or low. If the pin is an input then this enables the pullup or pulldown resistor.

Examples:
vexuser.c.
tVexDigitalState vexDigitalPinGet ( tVexDigitalPin  pin)

Get digital pin state.

Parameters
[in]pinThe pin to get the state of

Read the value of a digital pin, if the pin is a digital output then the output value is returned.

Examples:
vexdefault.c.
void vexDigitalIntrSet ( tVexDigitalPin  pin)

Set digital pin to cause interrupt.

Parameters
[in]pinThe pin

This is used for testing at present, the interrupt just increments a counter

void vexDigitalIntrRun ( void  )

Enable any digital pin interrupts.

int32_t vexDigitalIntrCountGet ( tVexDigitalPin  pin)

Get the interrupt count for a given digital pin.

Parameters
[in]pinThe pin

This is used for testing at present, the interrupt just increments a counter

Variable Documentation