Subversion Repositories HomeAutomation

Rev

Rev 363 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1. /*********************************************************************
  2.  *
  3.  *                  Helper Function Defs for Microchip TCP/IP Stack
  4.  *
  5.  *********************************************************************
  6.  * FileName:        Helpers.h
  7.  * Dependencies:    stacktsk.h
  8.  * Processor:       PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F
  9.  * Complier:        Microchip C18 v3.02 or higher
  10.  *                  Microchip C30 v2.01 or higher
  11.  * Company:         Microchip Technology, Inc.
  12.  *
  13.  * Software License Agreement
  14.  *
  15.  * This software is owned by Microchip Technology Inc. ("Microchip")
  16.  * and is supplied to you for use exclusively as described in the
  17.  * associated software agreement.  This software is protected by
  18.  * software and other intellectual property laws.  Any use in
  19.  * violation of the software license may subject the user to criminal
  20.  * sanctions as well as civil liability.  Copyright 2006 Microchip
  21.  * Technology Inc.  All rights reserved.
  22.  *
  23.  * This software is provided "AS IS."  MICROCHIP DISCLAIMS ALL
  24.  * WARRANTIES, EXPRESS, IMPLIED, STATUTORY OR OTHERWISE, NOT LIMITED
  25.  * TO MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND
  26.  * INFRINGEMENT.  Microchip shall in no event be liable for special,
  27.  * incidental, or consequential damages.
  28.  *
  29.  *
  30.  * Author               Date    Comment
  31.  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  32.  * Nilesh Rajbharti     5/17/01 Original        (Rev 1.0)
  33.  * Nilesh Rajbharti     2/9/02  Cleanup
  34.  ********************************************************************/
  35.  
  36. #ifndef HELPERS_H
  37. #define HELPERS_H
  38.  
  39. #include "..\Include\Compiler.h"
  40. #include "..\Include\StackTsk.h"
  41. #include "..\Include\GenericTypeDefs.h"
  42.  
  43. BYTE    ReadStringUART(BYTE *Dest, BYTE BufferLen);
  44. BYTE    hexatob(WORD_VAL AsciiChars);
  45. BYTE    btohexa_high(BYTE b);
  46. BYTE    btohexa_low(BYTE b);
  47.  
  48. WORD    swaps(WORD v);
  49. DWORD   swapl(DWORD v);
  50.  
  51. WORD    CalcIPChecksum(BYTE *buffer, WORD len);
  52. WORD    CalcIPBufferChecksum(WORD len);
  53.  
  54. void dwordToHex(DWORD c,char *str);
  55.  
  56. void setVariable(BYTE var, DWORD val);
  57. DWORD getVariable(BYTE var);
  58. void getVariableName(BYTE var,char *str);
  59.  
  60. void timestampToString(DWORD t, char *str);
  61.  
  62. #endif
  63.