Furthermore digital IOs are handled by the NetzerIO project.
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 GPIOReadSPIClock | ( | ) | PORTCbits.RC3 |
In SPI mode the SPI_INT pin can be quickly read with this function.
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.
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.
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.
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.
Value | TRUE means on, FALSE means off. |
enum EdgeCounterMode_t |
enum EdgeFilterMode_t |
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.
enum EdgeTriggerMode_t |
enum EventMode_t |
Modes for the GPIO event service.
On configured events a x=... message is sent to the client without request.
enum GPIORadix_t |
enum ImpulseMode_t |
enum PortType_t |
A GPIO channel can be configured as one of this types.
enum PWMFrequencies_t |
enum TimerPrescaler_t |
BOOL bGPIOCheckForStoppedTask | ( | void | ) |
Before shutting down the application should poll for valid GPIO task shutdown.
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.
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.
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.
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.
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.
WORD GPIOGetCurrentImpulseWidth | ( | BYTE | Channel | ) |
Delivers the current value for an impulse channel.
Channel | GPIO channel. GPIO_03_ID and GPIO_09_ID are supported. |
DWORD GPIOGetEdgeCounter | ( | BYTE | Channel | ) |
Delivers the current edge counter value.
Channel | GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported. |
EdgeCounterMode_t GPIOGetEdgeCounterMode | ( | BYTE | Channel | ) |
Delivers the current counter mode of the edge trigger for a given channel.
Channel | GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported. |
EdgeFilterMode_t GPIOGetEdgeFilterMode | ( | BYTE | Channel | ) |
Delivers the current filter mode of the edge trigger for a given channel.
Channel | GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported. |
EdgeTriggerMode_t GPIOGetEdgeTriggerMode | ( | BYTE | Channel | ) |
Delivers the current mode of the edge trigger for a given channel.
Channel | GPIO channel. Only GPIO_00_ID, GPIO_01_ID and GPIO_02_ID are supported. |
EventMode_t GPIOGetEventMode | ( | BYTE | Channel | ) |
Delivers the GPIO server event mode of a GPIO channel.
Channel | GPIO channel. All channels are supported. |
BOOL GPIOGetImpulseLogic | ( | BYTE | Channel | ) |
Delivers the configured logic for an impulse channel.
Channel | GPIO channel. GPIO_03_ID and GPIO_09_ID are supported. |
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.
TimerPrescaler_t GPIOGetImpulsePrescaler | ( | void | ) |
Delivers the configured prescaler for all impulse channel.
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.
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.
Channel | Channel of the requested name. |
PortType_t GPIOGetPortType | ( | BYTE | GPIOChannel | ) |
Delivers the current port configuration of a GPIO pin.
GPIOChannel | Channel to request. |
PWMFrequencies_t GPIOGetPWMFrequency | ( | void | ) |
Delivers the configured frequency for all pwm channel.
BOOL GPIOGetPWMLogic | ( | BYTE | Channel | ) |
Delivers the configured logic for a pwm channel.
Channel | GPIO channel. GPIO_03_ID and GPIO_09_ID are supported. |
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.
Channel | GPIO channel. GPIO_03_ID and GPIO_09_ID are supported. |
GPIORadix_t GPIOGetRadix | ( | void | ) |
Delivers the currently set 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.
GPIOServerConnection_t GPIOGetServerState | ( | void | ) |
This function delivers the current state of the GPIO server.
WORD GPIOGetStartImpulseWidth | ( | BYTE | Channel | ) |
Delivers the configured startup value for an impulse channel.
Channel | GPIO channel. GPIO_03_ID and GPIO_09_ID are supported. |
BOOL GPIOGetStartupValue | ( | BYTE | Channel | ) |
Delivers the startup value for a given channel.
This startup value is only valid for ports configured as digital output.
Channel | GPIO channel. All channels are supported. |
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.
bPersistent | If TRUE the return value is read from EEPROM. If FALSE the value is taken from the current state. |
void GPIOInit | ( | SerialMode_t | Mode | ) |
Initializes the GPIO module in the requested mode.
Should be called once at startup (very early).
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.
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.
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).
GPIOChannel | Channel to request. |
TRUE | Channel is overwritten. | |
FALSE | Channel is used as configured. |
BOOL GPIOIsScriptActive | ( | void | ) |
Delivers if javascript for the GPIO web interface is currently active.
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.
Channel | GPIO channel. All channels are supported. | |
PortType | Type which is requested for the given channel. |
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.