Nut/OS  4.10.3
API Reference
portdio.c File Reference
#include <string.h>
#include <stdio.h>
#include <dev/board.h>
#include <dev/gpio.h>
#include <sys/heap.h>
#include <sys/thread.h>
#include <sys/timer.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <net/route.h>
#include <netdb.h>
#include <pro/dhcp.h>
Include dependency graph for portdio.c:

Go to the source code of this file.

Defines

#define MY_MAC   {0x00,0x06,0x98,0x20,0x00,0x00}
#define MY_IP   "192.168.192.100"
#define MY_MASK   "255.255.255.0"
#define MY_PORT   12345

Functions

void ProcessRequests (FILE *stream)
void init_dio (void)
void service (void)
void service_thread (void *arg)
int main (void)

Define Documentation

#define MY_MAC   {0x00,0x06,0x98,0x20,0x00,0x00}

Definition at line 61 of file portdio.c.

Referenced by main().

#define MY_IP   "192.168.192.100"

Definition at line 62 of file portdio.c.

Referenced by main().

#define MY_MASK   "255.255.255.0"

Definition at line 63 of file portdio.c.

Referenced by main().

#define MY_PORT   12345
Examples:
portdio/portdio.c.

Definition at line 64 of file portdio.c.

Referenced by service().


Function Documentation

void ProcessRequests ( FILE stream)
Examples:
portdio/portdio.c, and tcps/tcps.c.

Definition at line 184 of file portdio.c.

References fflush(), fgets(), fprintf(), fputs(), GpioPinSetHigh(), GpioPinSetLow(), NutHeapAvailable, NutThreadYield(), strchr(), strlen(), and strncmp().

Referenced by main(), and service().

Here is the call graph for this function:

void init_dio ( void  )
Examples:
portdio/portdio.c.

Definition at line 333 of file portdio.c.

References GPIO_CFG_OUTPUT, GPIO_CFG_PULLUP, GpioPinConfigSet(), and GpioPinSetLow().

Referenced by main().

Here is the call graph for this function:

void service ( void  )
Examples:
portdio/portdio.c.

Definition at line 374 of file portdio.c.

References _fdopen(), fclose(), MY_PORT, NutTcpAccept(), NutTcpCloseSocket(), NutTcpCreateSocket(), and ProcessRequests().

Referenced by main(), and service_thread().

Here is the call graph for this function:

void service_thread ( void *  arg)
Examples:
portdio/portdio.c.

Definition at line 415 of file portdio.c.

References service().

Referenced by main().

Here is the call graph for this function:

int main ( void  )

Definition at line 428 of file portdio.c.

References DEV_ETHER, DEV_ETHER_NAME, inet_addr(), init_dio(), MY_IP, MY_MAC, MY_MASK, NutDhcpIfConfig(), NutNetIfConfig(), NutRegisterDevice(), NutThreadCreate(), service(), and service_thread().

Here is the call graph for this function: