NetzerIO Project


Detailed Description

These modules handle serial communication with peripherals connected via UART or SPI.

Furthermore digital IOs are handled by the NetzerIO project.

netzerIO.jpg


Files

file  gpio.c
 Implementation of gpio access.
file  gpio.h
 API for GPIO (digital IO) access.
file  i2c.c
 Implementation of the I2C communication stuff.
file  i2c.h
 API for serial communication via I2C.
file  io.c
 Implementation of the common io application stuff.
file  projectdefs.h
 Some project related defines and typedefs for the NetzerIO project.
file  projectIRQ.inc
 This file extends the low priority interrupt hook to call some IO routines (for example filter timer and serial stubs).
file  projectIRQ.asm
 This file extends low and high priority interrupts in a very efficient and small footprint manner.
file  serial.c
 Implementation of the serial communication stuff.
file  serial.h
 API for serial communication via UART or SPI.
file  webio.c
 Implementation of the web io stuff.

Defines

#define GPIOWriteSPIChipSelect(Value)   LATFbits.LATF7 = Value
 In SPI mode the SPI_CS pin can be quickly written with this function.
#define GPIOWriteSPIInt(Value)   LATCbits.LATC2 = Value
 In SPI slave mode the int pin can be quickly written with this function.
#define GPIOWriteSPIBusy(Value)   LATAbits.LATA3 = Value
 In SPI slave mode the busy pin can be quickly written with this function.
#define GPIOReadSPIRegister()   PORTBbits.RB1
 In SPI slave mode the register pin can be quickly read with this function.
#define GPIOWriteSPINetzerDataValid(Value)   LATAbits.LATA2 = Value
 In SPI slave mode the data valid pin can be quickly written with this function.
#define GPIOReadSPIMasterWrite()   PORTDbits.RD1
 In SPI slave mode the master data valid can be quickly read with this function.
#define GPIOReadSPIClock()   PORTCbits.RC3
 In SPI mode the SPI_INT pin can be quickly read with this function.

Enumerations

enum  PortType_t {
  PT_DIG_INPUT = 0, PT_DIG_OUTPUT, PT_ANALOG_INPUT, PT_PWM,
  PT_IMPULSE
}
 A GPIO channel can be configured as one of this types. More...
enum  TimerPrescaler_t { TMR_PRESCALER1 = 0, TMR_PRESCALER2, TMR_PRESCALER4, TMR_PRESCALER8 }
 Use this enumerator to configure prescaler values for impulse generation. More...
enum  PWMFrequencies_t { PF_2500_HZ = 0, PF_10000_HZ, PF_40000_HZ }
 Use this enumerator to configure prescaler values for PWM generation. More...
enum  ImpulseMode_t { IPM_SINGLE = 0, IPM_TRIGGERED, IPM_CONTINUOUS }
 Modes for impulse generation. More...
enum  GPIOServerConnection_t { GPIO_SERVER_NOT_RUNNING = 0, GPIO_SERVER_RUNNING, GPIO_SERVER_CONNECTED }
 This enumerator is used to express the GPIO server state. More...
enum  EdgeCounterMode_t { EC_DISABLED = 0, EC_DECREMENTS, EC_INCREMENTS }
 Modes of the edge trigger counter. More...
enum  EdgeTriggerMode_t { ET_DISABLED = 0, ET_FALLING, ET_RISING }
 Modes of the edge trigger interrupt. More...
enum  EdgeFilterMode_t {
  EF_DISABLED = 0, EF_1_MS, EF_10_MS, EF_100_MS,
  EF_250_MS
}
 Filter mode for the edge trigger interrupt. More...
enum  EventMode_t { EM_DISABLED = 0, EM_ON_FALLING_EDGES, EM_ON_RISING_EDGES, EM_ON_ALL_EDGES }
 Modes for the GPIO event service. More...
enum  GPIORadix_t { RADIX_IS_HEXADECIMAL = 0, RADIX_IS_DECIMAL }
 Display radix for numbers on webpages and GPIO server. More...

Functions

void GPIOInit (SerialMode_t Mode)
 Initializes the GPIO module in the requested mode.
void GPIOResetToFactory (void)
 Resets the GPIO module EEPROM section to well known start parameters.
WORD GPIOGetTCPPort (BOOL bPersistent)
 Delivers the current configured TCP port of the GPIO server.
void GPIOSetTCPPortPersistent (WORD Port)
 Configures a new TCP port for the GPIO server.
BOOL GPIOInitTask (void)
 After initializing network and application stuff the application should call this function to prepare task members needed for proper GPIO task operation.
void GPIOTask (void)
 Call this function periodically from main application to execute GPIO module tasks.
void GPIOStopTask (void)
 On network errors or shut down events these function should be called by the main application to proper stop the GPIO tasks (i.e disconnecting a connected client).
BOOL bGPIOCheckForStoppedTask (void)
 Before shutting down the application should poll for valid GPIO task shutdown.
PortType_t GPIOGetPortType (BYTE GPIOChannel)
 Delivers the current port configuration of a GPIO pin.
BOOL GPIOIsPortOverwritten (BYTE GPIOChannel)
 Delivers if the port is currently overwritten by an alternative pin (i.e serial).
void GPIOSetPortValue (BYTE Channel, BOOL Value)
 This function sets the state for a single IO pin.
BOOL GPIOGetPinValue (BYTE GPIOChannel)
 This function reads the state from a single IO pin.
GPIOServerConnection_t GPIOGetServerState (void)
 This function delivers the current state of the GPIO server.
DWORD GPIOGetConnectedIP (void)
 Delivers the IP of a client who is connected to GPIO server.
void GPIOResetEdgeCounter (BYTE Channel)
 Thread safe reset the edge counter for the given channel.
BOOL GPIOServerIsActivated (void)
 Getter for activated GPIO server.
void GPIOActivateServerPersistent (BOOL Activate)
 Setter for GPIO server state.
ROM BYTE * GPIOGetPortName (BYTE Channel)
 Delivers the port alias name for the given channel.
EventMode_t GPIOGetEventMode (BYTE Channel)
 Delivers the GPIO server event mode of a GPIO channel.
void GPIOSetEventMode (BYTE Channel, EventMode_t Mode)
 Sets the GPIO server event mode of a GPIO channel.
void GPIOSetPortType (BYTE Channel, PortType_t PortType)
 Sets the port mode of a GPIO channel.
BOOL GPIOGetStartupValue (BYTE Channel)
 Delivers the startup value for a given channel.
void GPIOSetStartupValue (BYTE Channel, BOOL Value)
 Configures the startup value for binary output configured values.
void GPIOFlushToEEPROM (void)
 All prior changed values are persistently written to EEPROM.
void GPIOConfigurePort (BYTE Channel)
 Call this function for a given channel to reconfigure the port and all other peripherals associated with the new port function.
BOOL GPIOIsTypeSupportedByPort (BYTE Channel, PortType_t PortType)
 Determines programmatically if a given port supports a requested configuration.
BOOL GPIOGetImpulseLogic (BYTE Channel)
 Delivers the configured logic for an impulse channel.
TimerPrescaler_t GPIOGetImpulsePrescaler (void)
 Delivers the configured prescaler for all impulse channel.
WORD GPIOGetStartImpulseWidth (BYTE Channel)
 Delivers the configured startup value for an impulse channel.
WORD GPIOGetCurrentImpulseWidth (BYTE Channel)
 Delivers the current value for an impulse channel.
void GPIOSetImpulseLogic (BYTE Channel, BOOL Logic)
 Configures the logic for an impulse channel.
void GPIOSetImpulsePrescaler (TimerPrescaler_t Prescaler)
 Configures the prescaler for all impulse channel.
void GPIOSetStartupImpulseWidth (BYTE Channel, WORD ImpulseWidth)
 Configures the startup value for an impulse channel.
void GPIOSetCurrentImpulseWidth (BYTE Channel, WORD ImpulseWidth)
 Sets the value for an impulse or pwm channel.
EdgeTriggerMode_t GPIOGetEdgeTriggerMode (BYTE Channel)
 Delivers the current mode of the edge trigger for a given channel.
EdgeFilterMode_t GPIOGetEdgeFilterMode (BYTE Channel)
 Delivers the current filter mode of the edge trigger for a given channel.
EdgeCounterMode_t GPIOGetEdgeCounterMode (BYTE Channel)
 Delivers the current counter mode of the edge trigger for a given channel.
DWORD GPIOGetEdgeCounter (BYTE Channel)
 Delivers the current edge counter value.
void GPIOSetEdgeTriggerMode (BYTE Channel, EdgeTriggerMode_t Mode)
 Configures a new edge trigger mode for a given channel.
void GPIOSetEdgeFilterMode (BYTE Channel, EdgeFilterMode_t Mode)
 Configures a new edge filter mode for a given channel.
void GPIOSetEdgeCounterMode (BYTE Channel, EdgeCounterMode_t Mode)
 Configures a new edge counter mode for a given channel.
void GPIOSetAllPinValues (WORD NewValue)
 Use this function to write to all pins at once.
void GPIOSetPWMLogic (BYTE Channel, BOOL Value)
 Configures the logic for a pwm channel.
void GPIOSetPWMFrequency (PWMFrequencies_t Value)
 Configures the frequency for all pwm channel.
void GPIOSetPWMStartDuty (BYTE Channel, WORD Value)
 Configures the startup value of a pwm channel.
BOOL GPIOGetPWMLogic (BYTE Channel)
 Delivers the configured logic for a pwm channel.
PWMFrequencies_t GPIOGetPWMFrequency (void)
 Delivers the configured frequency for all pwm channel.
WORD GPIOGetPWMStartDuty (BYTE Channel)
 Delivers the configured startup value for a pwm channel.
ImpulseMode_t GPIOGetImpulseMode (void)
 Delivers the configured mode for all impulse channel.
void GPIOSetImpulseMode (ImpulseMode_t Mode)
 Sets a new mode for all impulse channel.
void GPIOReconfigurePeripherals (void)
 Call this function after reconfiguring a single or multiple ports with GPIOConfigurePort.
void GPIOInitPeripherals (void)
 Call this function before reconfiguring a single or multiple ports with GPIOConfigurePort.
GPIORadix_t GPIOGetRadix (void)
 Delivers the currently set radix for displaying values on the GPIO server and the web interface.
void GPIOSetRadix (GPIORadix_t NewRadix)
 Sets a new radix for displaying values on the GPIO server and the web interface.
BYTE GPIOGetRefresh (void)
 Delivers the currently set refresh rate for auto refreshing the GPIO web interface.
void GPIOSetRefresh (BYTE Refresh)
 Sets a new refresh rate for auto refreshing the GPIO web interface.
BOOL GPIOIsScriptActive (void)
 Delivers if javascript for the GPIO web interface is currently active.
void GPIOActivateScript (BOOL Active)
 Activates or deactivates javascript for the GPIO web interface.
BOOL GPIOIsAuthActive (void)
 Delivers if authentication for the GPIO server is currently active.
void GPIOActivateAuth (BOOL Active)
 Activates or deactivates authentication for the GPIO server.


Define Documentation

 
#define GPIOReadSPIClock (  )     PORTCbits.RC3

In SPI mode the SPI_INT pin can be quickly read with this function.

Return values:
TRUE The pin is high.
FALSE The pin is low.

#define GPIOWriteSPIBusy ( Value   )     LATAbits.LATA3 = Value

In SPI slave mode the busy pin can be quickly written with this function.

Parameters:
Value TRUE means on, FALSE means off.

#define GPIOWriteSPIChipSelect ( Value   )     LATFbits.LATF7 = Value

In SPI mode the SPI_CS pin can be quickly written with this function.

Parameters:
Value TRUE means on, FALSE means off.

#define GPIOWriteSPIInt ( Value   )     LATCbits.LATC2 = Value

In SPI slave mode the int pin can be quickly written with this function.

Parameters:
Value TRUE means on, FALSE means off.

#define GPIOWriteSPINetzerDataValid ( Value   )     LATAbits.LATA2 = Value

In SPI slave mode the data valid pin can be quickly written with this function.

Parameters:
Value TRUE means on, FALSE means off.


Enumeration Type Documentation

Modes of the edge trigger counter.

Enumerator:
EC_DISABLED  Edge counter is disabled.
EC_DECREMENTS  Counter decrements on edges.
EC_INCREMENTS  Counter increments on edges.

Filter mode for the edge trigger interrupt.

All edges after a detected edge are filtered out up to a given time after. It is possible to debounce switches for example.

Enumerator:
EF_DISABLED  No filter is enabled.
EF_1_MS  Filter all edges up to a millisecond after.
EF_10_MS  Filter all edges up to 10 milliseconds after.
EF_100_MS  Filter all edges up to 100 milliseconds after.
EF_250_MS  Filter all edges up to 250 milliseconds after.

Modes of the edge trigger interrupt.

Enumerator:
ET_DISABLED  Edge trigger interrupt is disabled.
ET_FALLING  Edge trigger interrupt on falling edges.
ET_RISING  Edge trigger interrupt on rising edges.

Modes for the GPIO event service.

On configured events a x=... message is sent to the client without request.

Enumerator:
EM_DISABLED  Event service is disabled.
EM_ON_FALLING_EDGES  Events are sent on falling edges.
EM_ON_RISING_EDGES  Events are sent on rising edges.
EM_ON_ALL_EDGES  Events are sent on both edges.

Display radix for numbers on webpages and GPIO server.

Enumerator:
RADIX_IS_HEXADECIMAL  Radix is hexadecimal.
RADIX_IS_DECIMAL  Radix is decimal.

This enumerator is used to express the GPIO server state.

Enumerator:
GPIO_SERVER_NOT_RUNNING  Inactive server.
GPIO_SERVER_RUNNING  Running, waiting for client connect.
GPIO_SERVER_CONNECTED  Client connected, waiting for GPIO commands.

Modes for impulse generation.

Enumerator:
IPM_SINGLE  Single impulse generation on writing a new value.
IPM_TRIGGERED  Impulse generation on edge interrupt of IO0.
IPM_CONTINUOUS  Continuous impulse generation with 16 bit resolution.

enum PortType_t

A GPIO channel can be configured as one of this types.

Enumerator:
PT_DIG_INPUT  Configure pin as digital input.
PT_DIG_OUTPUT  Configure pin as digital output.
PT_ANALOG_INPUT  Pin is configured as analog input.
PT_PWM  Pin is configured as PWM output.
PT_IMPULSE  Pin is configured for impulse generation.

Use this enumerator to configure prescaler values for PWM generation.

Enumerator:
PF_2500_HZ  2500 Hertz.
PF_10000_HZ  10000 Hertz.
PF_40000_HZ  40000 Hertz.

Use this enumerator to configure prescaler values for impulse generation.

Enumerator:
TMR_PRESCALER1  Unit is 100 ns.
TMR_PRESCALER2  Unit is 200 ns.
TMR_PRESCALER4  Unit is 400 ns.
TMR_PRESCALER8  Unit is 800 ns.


Function Documentation

BOOL bGPIOCheckForStoppedTask ( void   ) 

Before shutting down the application should poll for valid GPIO task shutdown.

Return values:
TRUE The task has successfully stopped.
FALSE Stopping the GPIO task is pending.

void GPIOActivateAuth ( BOOL  Active  ) 

Activates or deactivates authentication for the GPIO server.

The new state is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Active TRUE enables authentication, FALSE disables it.

void GPIOActivateScript ( BOOL  Active  ) 

Activates or deactivates javascript for the GPIO web interface.

The new javascript state is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Active TRUE activates javascript. FALSE deactivates javascript.

void GPIOActivateServerPersistent ( BOOL  Activate  ) 

Setter for GPIO server state.

The server is deactivated or activated after restarting Netzer.

Parameters:
Activate If TRUE, server is activated after restart. If FALSE, server is deactivated after restart.

void GPIOConfigurePort ( BYTE  Channel  ) 

Call this function for a given channel to reconfigure the port and all other peripherals associated with the new port function.

Parameters:
Channel GPIO channel. All channels are supported.

void GPIOFlushToEEPROM ( void   ) 

All prior changed values are persistently written to EEPROM.

DWORD GPIOGetConnectedIP ( void   ) 

Delivers the IP of a client who is connected to GPIO server.

Returns:
The IP address as 32 bit value, 0 if no client is connected.

WORD GPIOGetCurrentImpulseWidth ( BYTE  Channel  ) 

Delivers the current value for an impulse channel.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
Returns:
The impulse value.

DWORD GPIOGetEdgeCounter ( BYTE  Channel  ) 

Delivers the current edge counter value.

Parameters:
Channel GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported.
Returns:
The current edge counter value. The low word contains the value. If the high word is not 0 than the counter is overrun or underrun. It depends on the counters configuration.

EdgeCounterMode_t GPIOGetEdgeCounterMode ( BYTE  Channel  ) 

Delivers the current counter mode of the edge trigger for a given channel.

Parameters:
Channel GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported.
Returns:
The configured edge counter mode.

EdgeFilterMode_t GPIOGetEdgeFilterMode ( BYTE  Channel  ) 

Delivers the current filter mode of the edge trigger for a given channel.

Parameters:
Channel GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported.
Returns:
The configured filter mode.

EdgeTriggerMode_t GPIOGetEdgeTriggerMode ( BYTE  Channel  ) 

Delivers the current mode of the edge trigger for a given channel.

Parameters:
Channel GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported.
Returns:
The configured mode.

EventMode_t GPIOGetEventMode ( BYTE  Channel  ) 

Delivers the GPIO server event mode of a GPIO channel.

Parameters:
Channel GPIO channel. All channels are supported.
Returns:
The mode of the requested channel.

BOOL GPIOGetImpulseLogic ( BYTE  Channel  ) 

Delivers the configured logic for an impulse channel.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
Return values:
TRUE The impulse logic is '1'. Means that on full level the output is constantly '1'.
FALSE The impulse logic is '0'. Means that on full level the output is constantly '0'.

ImpulseMode_t GPIOGetImpulseMode ( void   ) 

Delivers the configured mode for all impulse channel.

Returns:
The configured impulse mode.

TimerPrescaler_t GPIOGetImpulsePrescaler ( void   ) 

Delivers the configured prescaler for all impulse channel.

Returns:
The prescaler value.

BOOL GPIOGetPinValue ( BYTE  GPIOChannel  ) 

This function reads the state from a single IO pin.

This reading is indpendent from the configured direction of the pin.

Parameters:
GPIOChannel Use one of the GPIO_XX_ID defines to select the IO pin.

ROM BYTE* GPIOGetPortName ( BYTE  Channel  ) 

Delivers the port alias name for the given channel.

Parameters:
Channel Channel of the requested name.
Returns:
ROM pointer to the name.

PortType_t GPIOGetPortType ( BYTE  GPIOChannel  ) 

Delivers the current port configuration of a GPIO pin.

Parameters:
GPIOChannel Channel to request.
Returns:
Configured port type.

PWMFrequencies_t GPIOGetPWMFrequency ( void   ) 

Delivers the configured frequency for all pwm channel.

Returns:
The configured frequency.

BOOL GPIOGetPWMLogic ( BYTE  Channel  ) 

Delivers the configured logic for a pwm channel.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
Return values:
TRUE The pwm logic is '1'. Means that on full level the output is constantly '1'.
FALSE The pwm logic is '0'. Means that on full level the output is constantly '0'.

WORD GPIOGetPWMStartDuty ( BYTE  Channel  ) 

Delivers the configured startup value for a pwm channel.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
Returns:
The configured startup value.

GPIORadix_t GPIOGetRadix ( void   ) 

Delivers the currently set radix for displaying values on the GPIO server and the web interface.

Returns:
The configured radix.

BYTE GPIOGetRefresh ( void   ) 

Delivers the currently set refresh rate for auto refreshing the GPIO web interface.

Returns:
The currently configured refresh rate in seconds. 0 means off.

GPIOServerConnection_t GPIOGetServerState ( void   ) 

This function delivers the current state of the GPIO server.

Returns:
The current state.

WORD GPIOGetStartImpulseWidth ( BYTE  Channel  ) 

Delivers the configured startup value for an impulse channel.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
Returns:
The impulse startup value.

BOOL GPIOGetStartupValue ( BYTE  Channel  ) 

Delivers the startup value for a given channel.

This startup value is only valid for ports configured as digital output.

Parameters:
Channel GPIO channel. All channels are supported.
Return values:
TRUE Output is '1' on startup.
FALSE Output is '0' on startup.

WORD GPIOGetTCPPort ( BOOL  bPersistent  ) 

Delivers the current configured TCP port of the GPIO server.

Parameters:
bPersistent If TRUE the return value is read from EEPROM. If FALSE the value is taken from the current state.
Returns:
The port of the listening GPIO server.

void GPIOInit ( SerialMode_t  Mode  ) 

Initializes the GPIO module in the requested mode.

Should be called once at startup (very early).

Parameters:
Mode Specifies the serial mode for NetzerIO. GPIO module must know this because it configures some port pins also for the serial modes.

void GPIOInitPeripherals ( void   ) 

Call this function before reconfiguring a single or multiple ports with GPIOConfigurePort.

The function disables timer and interrupts and initializes all periperals to a startup state.

BOOL GPIOInitTask ( void   ) 

After initializing network and application stuff the application should call this function to prepare task members needed for proper GPIO task operation.

Return values:
TRUE Initialization was successful.
FALSE Initialization failed, try again later.

BOOL GPIOIsAuthActive ( void   ) 

Delivers if authentication for the GPIO server is currently active.

If active a login prompt is printed on the server first and username and password must be entered before usage of the server.

Return values:
TRUE Authentication is enabled.
FALSE Authentication is disabled.

BOOL GPIOIsPortOverwritten ( BYTE  GPIOChannel  ) 

Delivers if the port is currently overwritten by an alternative pin (i.e serial).

Parameters:
GPIOChannel Channel to request.
Return values:
TRUE Channel is overwritten.
FALSE Channel is used as configured.

BOOL GPIOIsScriptActive ( void   ) 

Delivers if javascript for the GPIO web interface is currently active.

Return values:
TRUE Javascript is enabled.
FALSE Javascript is disabled.

BOOL GPIOIsTypeSupportedByPort ( BYTE  Channel,
PortType_t  PortType 
)

Determines programmatically if a given port supports a requested configuration.

Parameters:
Channel GPIO channel. All channels are supported.
PortType Type which is requested for the given channel.
Return values:
TRUE Channel supports port type.
FALSE Channel does not support port type.

void GPIOReconfigurePeripherals ( void   ) 

Call this function after reconfiguring a single or multiple ports with GPIOConfigurePort.

The function configures timer and enables interrupts as needed.

void GPIOResetEdgeCounter ( BYTE  Channel  ) 

Thread safe reset the edge counter for the given channel.

Parameters:
Channel Channel to reset. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID support the edge counter.

BOOL GPIOServerIsActivated ( void   ) 

Getter for activated GPIO server.

Return values:
TRUE The server is active in the current session.
FALSE The server is not active in the current session.

void GPIOSetAllPinValues ( WORD  NewValue  ) 

Use this function to write to all pins at once.

Only ports which are configured as digital outputs are affected.

Parameters:
NewValue All pin values in a port mask.

void GPIOSetCurrentImpulseWidth ( BYTE  Channel,
WORD  ImpulseWidth 
)

Sets the value for an impulse or pwm channel.

This value is not stored persistently. Use GPIOSetStartupImpulseWidth instead. For impulse channels the value must be at least 100. For pwm channels the maximum value is 1023. The function automatically adjust this values if exceeded.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
ImpulseWidth New value.

void GPIOSetEdgeCounterMode ( BYTE  Channel,
EdgeCounterMode_t  Mode 
)

Configures a new edge counter mode for a given channel.

The new mode is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported.
Mode The new counter mode.

void GPIOSetEdgeFilterMode ( BYTE  Channel,
EdgeFilterMode_t  Mode 
)

Configures a new edge filter mode for a given channel.

The new mode is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported.
Mode The new filter mode.

void GPIOSetEdgeTriggerMode ( BYTE  Channel,
EdgeTriggerMode_t  Mode 
)

Configures a new edge trigger mode for a given channel.

The new mode is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported.
Mode The new mode.

void GPIOSetEventMode ( BYTE  Channel,
EventMode_t  Mode 
)

Sets the GPIO server event mode of a GPIO channel.

The new mode is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. All channels are supported.
Mode The new mode of the requested channel.

void GPIOSetImpulseLogic ( BYTE  Channel,
BOOL  Logic 
)

Configures the logic for an impulse channel.

The new logic is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
Logic TRUE means on full level the output is constantly '1'. FALSE means on full level the output is constantly '0'.

void GPIOSetImpulseMode ( ImpulseMode_t  Mode  ) 

Sets a new mode for all impulse channel.

The new mode is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Mode The new impulse mode.

void GPIOSetImpulsePrescaler ( TimerPrescaler_t  Prescaler  ) 

Configures the prescaler for all impulse channel.

The new prescaler value is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Prescaler New prescaler value.

void GPIOSetPortType ( BYTE  Channel,
PortType_t  PortType 
)

Sets the port mode of a GPIO channel.

The new port mode is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. All channels are supported.
PortType The new type of the requested channel.

void GPIOSetPortValue ( BYTE  Channel,
BOOL  Value 
)

This function sets the state for a single IO pin.

That is only valid if the pin is not overwritten by another function of i.e the serial server. Also the pin must be configured as digital output.

Parameters:
Channel Use one of the GPIO_XX_ID defines to select the IO pin.
Value TRUE means on, FALSE means off.

void GPIOSetPWMFrequency ( PWMFrequencies_t  Value  ) 

Configures the frequency for all pwm channel.

The new frequency is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Value The new frequency.

void GPIOSetPWMLogic ( BYTE  Channel,
BOOL  Value 
)

Configures the logic for a pwm channel.

The new logic is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
Value TRUE means on full level the output is constantly '1'. FALSE means on full level the output is constantly '0'.

void GPIOSetPWMStartDuty ( BYTE  Channel,
WORD  Value 
)

Configures the startup value of a pwm channel.

The new value is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
Value The new startup value. Due the 10 bit width only values up to 1023 can be set. Higher values are automatically adjusted to 1023.

void GPIOSetRadix ( GPIORadix_t  NewRadix  ) 

Sets a new radix for displaying values on the GPIO server and the web interface.

The new radix is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
NewRadix The new radix.

void GPIOSetRefresh ( BYTE  Refresh  ) 

Sets a new refresh rate for auto refreshing the GPIO web interface.

The new rate is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Refresh The new refresh rate in seconds. 0 disables refreshing.

void GPIOSetStartupImpulseWidth ( BYTE  Channel,
WORD  ImpulseWidth 
)

Configures the startup value for an impulse channel.

The new startup value is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage. The value must be at least 100. Else the function adjusts it to 100.

Parameters:
Channel GPIO channel. GPIO_03_ID and GPIO_09_ID are supported.
ImpulseWidth Impulse value on startup.

void GPIOSetStartupValue ( BYTE  Channel,
BOOL  Value 
)

Configures the startup value for binary output configured values.

The new startup value is not automatically stored in EEPROM. Call the function GPIOFlushToEEPROM for persistent storage.

Parameters:
Channel GPIO channel. All channels are supported.
Value TRUE means output is '1' on startup. FALSE means output is '0' on startup.

void GPIOSetTCPPortPersistent ( WORD  Port  ) 

Configures a new TCP port for the GPIO server.

This value is stored persistent in EEPROM.

Parameters:
Port The new port value.

void GPIOStopTask ( void   ) 

On network errors or shut down events these function should be called by the main application to proper stop the GPIO tasks (i.e disconnecting a connected client).

void GPIOTask ( void   ) 

Call this function periodically from main application to execute GPIO module tasks.


Generated on Fri Mar 29 10:34:28 2013 for Netzer by  doxygen 1.5.5