| enum | UARTBaudrates_t { BAUDRATE_0_3 = 0, BAUDRATE_1_2, BAUDRATE_2_4, BAUDRATE_9_6, BAUDRATE_19_2, BAUDRATE_57_6, BAUDRATE_115_2, BAUDRATE_4_8, BAUDRATE_38_4, BAUDRATE_COUNT } |
| The supported baudrates of the UART module. More... | |
| enum | SPIModes_t { SPIMODE_0 = 0, SPIMODE_1, SPIMODE_2, SPIMODE_3, SPIMODE_COUNT } |
| The typical SPI master clock modes. More... | |
| enum | SPIClockFrequencies_t { SPIFREQ_10M4 = 0, SPIFREQ_2M6, SPIFREQ_650K, SPIFREQ_COUNT, SPIFREQ_SLAVE } |
| The supported clock frequencies in SPI master mode. More... | |
| enum | SerialServerConnection_t { SERIAL_SERVER_NOT_RUNNING = 0, SERIAL_SERVER_IS_LISTENING, SERIAL_SERVER_CONNECTED } |
| The serial server states. More... | |
| void | SerialInit (SerialMode_t Mode) |
| Initializes the serial module in the requested mode. | |
| WORD | SerialGetTCPPort (BOOL bPersistent) |
| Delivers the current configured TCP port of the serial server. | |
| UARTBaudrates_t | SerialGetUARTBaudrate (void) |
| Delivers the currently used baudrate in the UART mode. | |
| SPIClockFrequencies_t | SerialGetSPIFrequency (void) |
| Delivers the currently used frequency of SPI master mode. | |
| SPIModes_t | SerialGetSPIMode (void) |
| Delivers the currently used clock mode in SPI master mode. | |
| BOOL | bSerialGetSPIMasterSample (void) |
| Delivers the sampling mode of the input signal in SPI master mode. | |
| void | SerialSetUARTBaudrate (UARTBaudrates_t eBaudrate) |
| Sets the UART baudrate in UART mode. | |
| void | SerialSetSPIMasterSample (BOOL bSample) |
| Sets the sampling mode of the input signal in SPI master mode. | |
| void | SerialSetSPIFrequency (SPIClockFrequencies_t Frequency) |
| Sets the clock frequency in SPI master mode. | |
| void | SerialSetSPIMode (SPIModes_t Mode) |
| Sets the SPI clock mode in SPI master mode. | |
| void | SerialSetTCPPort (WORD Port) |
| Configures a new TCP port for the serial server. | |
| void | SerialResetToFactory (void) |
| Resets the serial module EEPROM section to well known start parameters. | |
| BOOL | SerialInitTask (void) |
| After initializing network and application stuff the application should call this function to prepare task members needed for proper serial task operation. | |
| void | SerialStopTask (void) |
| On network errors or shut down events these function should be called by the main application to proper stop the serial tasks (i.e disconnecting a connected client). | |
| BOOL | bSerialCheckForStoppedTask (void) |
| Before shutting down the application should poll for valid serial task shutdown. | |
| void | SerialTask (void) |
| Call this function periodically from main application to execute serial module tasks. | |
| SerialServerConnection_t | SerialGetServerState (void) |
| This function delivers the current state of the serial server. | |
| DWORD | SerialGetConnectedIP (void) |
| Delivers the IP of a client who is connected to serial server. | |
| DWORD | SerialGetTXCounter (void) |
| Delivers the count of bytes the serial server has received from a client. | |
| DWORD | SerialGetRXCounter (void) |
| Delivers the count of bytes the serial server has sent to a client. | |
| void | SerialSendTCPData (void) |
| The given character is put into the TCP/IP transmit FIFO buffer. | |
| void | SerialRegisterHandling (void) |
| Call this function to serve the virtual register set accessed by the SPI master. | |
| void | SerialShutdown (void) |
| Call this function to process shutdown actions for serial server and serial connections. |
| enum SPIModes_t |
The typical SPI master clock modes.
| enum UARTBaudrates_t |
The supported baudrates of the UART module.
| BOOL bSerialCheckForStoppedTask | ( | void | ) |
Before shutting down the application should poll for valid serial task shutdown.
| TRUE | The task has successfully stopped. | |
| FALSE | Stopping the serial task is pending. |
| BOOL bSerialGetSPIMasterSample | ( | void | ) |
Delivers the sampling mode of the input signal in SPI master mode.
The mode can be read indepently from the current active NetzerIO mode.
| FALSE | Input data sampled at middle of data output time. | |
| TRUE | Input data sampled at end of data output time. |
| DWORD SerialGetConnectedIP | ( | void | ) |
Delivers the IP of a client who is connected to serial server.
| DWORD SerialGetRXCounter | ( | void | ) |
Delivers the count of bytes the serial server has sent to a client.
The counter is set to zero while a new session starts.
| SerialServerConnection_t SerialGetServerState | ( | void | ) |
This function delivers the current state of the serial server.
| SPIClockFrequencies_t SerialGetSPIFrequency | ( | void | ) |
Delivers the currently used frequency of SPI master mode.
The frequency can be read indepently from the current active NetzerIO mode.
| SPIModes_t SerialGetSPIMode | ( | void | ) |
Delivers the currently used clock mode in SPI master mode.
The mode can be read indepently from the current active NetzerIO mode.
| WORD SerialGetTCPPort | ( | BOOL | bPersistent | ) |
Delivers the current configured TCP port of the serial server.
| bPersistent | If TRUE the return value is read from EEPROM. If FALSE the value is taken from the current state. |
| DWORD SerialGetTXCounter | ( | void | ) |
Delivers the count of bytes the serial server has received from a client.
The counter is set to zero while a new session starts.
| UARTBaudrates_t SerialGetUARTBaudrate | ( | void | ) |
Delivers the currently used baudrate in the UART mode.
The baudrate can be read indepently from the current active NetzerIO mode.
| void SerialInit | ( | SerialMode_t | Mode | ) |
Initializes the serial module in the requested mode.
Should be called once at startup (very early).
| Mode | Specifies the mode for NetzerIO. GPIO module must know this because it configures some port pins also for the serial modes. |
| BOOL SerialInitTask | ( | void | ) |
After initializing network and application stuff the application should call this function to prepare task members needed for proper serial task operation.
| TRUE | Initialization was successful. | |
| FALSE | Initialization failed, try again later. |
| void SerialSendTCPData | ( | void | ) |
The given character is put into the TCP/IP transmit FIFO buffer.
The function is not thread safe and must only be called from interrupt context routines!
Communication takes place via the global variable SerialIsrCharacter.
| void SerialSetSPIFrequency | ( | SPIClockFrequencies_t | Frequency | ) |
Sets the clock frequency in SPI master mode.
If in SPI master mode the change takes effect directly. The new mode is stored persistent in EEPROM.
| Frequency | The frequency as enumerated value. |
| void SerialSetSPIMasterSample | ( | BOOL | bSample | ) |
Sets the sampling mode of the input signal in SPI master mode.
If in SPI master mode the change takes effect directly. The new mode is stored persistent in EEPROM.
| bSample | If FALSE, the input data is sampled at middle of data output time. If TRUE, the input data is sampled at end of data output time. |
| void SerialSetSPIMode | ( | SPIModes_t | Mode | ) |
Sets the SPI clock mode in SPI master mode.
If in SPI master mode the change takes effect directly. The new mode is stored persistent in EEPROM.
| Mode | The SPI clock mode as enumerated value. |
| void SerialSetTCPPort | ( | WORD | Port | ) |
Configures a new TCP port for the serial server.
This value is stored persistent in EEPROM.
| Port | The new port value. |
| void SerialSetUARTBaudrate | ( | UARTBaudrates_t | eBaudrate | ) |
Sets the UART baudrate in UART mode.
If in UART mode the change takes effect directly. The new mode is stored persistent in EEPROM.
| eBaudrate | The baudrate as enumerated value. |
| void SerialStopTask | ( | void | ) |
On network errors or shut down events these function should be called by the main application to proper stop the serial tasks (i.e disconnecting a connected client).
| void SerialTask | ( | void | ) |
Call this function periodically from main application to execute serial module tasks.
1.5.5