Main Page   Modules   Data Structures   File List   Data Fields   Globals   Related Pages  

library.h

Go to the documentation of this file.
00001 
00414 // Some common shortcuts on access of PORT F & G
00415 //
00416 
00420 
00425 
00429 #define PPF_STC *pPORTF_PADCTL                  
00430 
00431 
00432 #define PPF_MUX *pPORTF_MUX                             
00433 
00434 #define PPF_FER *pPORTF_FER                             
00435 
00436 #define PPF_DIR *pPORTFIO_DIR                   
00437 
00438 #define PPF_INE *pPORTFIO_INEN                  
00439 
00440 #define PPF_POL *pPORTFIO_POLAR                 
00441 
00442 #define PPF_EDG *pPORTFIO_EDGE                  
00443 
00444 #define PPF_RSE *pPORTFIO_BOTH                  
00445 
00446 #define PPF_MKA *pPORTFIO_MASKA                 
00447 
00448 #define PPF_MKB *pPORTFIO_MASKB                 
00449 
00450 #define PPF_MSA *pPORTFIO_MASKA_SET             
00451 
00452 #define PPF_MSB *pPORTFIO_MASKB_SET             
00453 
00454 #define PPF_MCA *pPORTFIO_MASKA_CLEAR   
00455 
00456 #define PPF_MCB *pPORTFIO_MASKB_CLEAR   
00457 
00458 #define PPF_MTA *pPORTFIO_MASKA_TOGGLE  
00459 
00460 #define PPF_MTB *pPORTFIO_MASKB_TOGGLE  
00461 
00462 #define PPF_SET *pPORTFIO_SET                   
00463 #define PPF_CLR *pPORTFIO_CLEAR                 
00464 #define PPF_TGL *pPORTFIO_TOGGLE                
00465 #define PPF     *pPORTFIO                                       
00466 
00467 
00468 
00472 #define PPG_STC *pPORTG_PADCTL                  
00473 
00474 
00475 #define PPG_MUX *pPORTG_MUX                             
00476 
00477 #define PPG_FER *pPORTG_FER                             
00478 
00479 #define PPG_DIR *pPORTGIO_DIR                   
00480 
00481 #define PPG_INE *pPORTGIO_INEN                  
00482 
00483 #define PPG_POL *pPORTGIO_POLAR                 
00484 
00485 #define PPG_EDG *pPORTGIO_EDGE                  
00486 
00487 #define PPG_RSE *pPORTGIO_BOTH                  
00488 
00489 #define PPG_MKA *pPORTGIO_MASKA                 
00490 
00491 #define PPG_MKB *pPORTGIO_MASKB                 
00492 
00493 #define PPG_MSA *pPORTGIO_MASKA_SET             
00494 
00495 #define PPG_MSB *pPORTGIO_MASKB_SET             
00496 
00497 #define PPG_MCA *pPORTGIO_MASKA_CLEAR   
00498 
00499 #define PPG_MCB *pPORTGIO_MASKB_CLEAR   
00500 
00501 #define PPG_MTA *pPORTGIO_MASKA_TOGGLE  
00502 
00503 #define PPG_MTB *pPORTGIO_MASKB_TOGGLE  
00504 
00505 #define PPG_SET *pPORTGIO_SET                   
00506 #define PPG_CLR *pPORTGIO_CLEAR                 
00507 #define PPG_TGL *pPORTGIO_TOGGLE                
00508 #define PPG     *pPORTGIO                                       
00509 
00510 
00511 
00514 
00515 #ifndef EOF
00516         #define EOF -1                                  
00517 #endif
00518 
00519 #ifndef BOOL_TYPE
00520 #define BOOL_TYPE
00521 typedef unsigned char bool;                 
00522 #endif
00523 
00524 #define true 1                                          
00525 #define false 0                                         
00526 
00527 #define SSYNC   asm("ssync;")       
00528 #define NOP     asm("nop;")         
00529 
00530 
00531 
00544 
00545 #ifdef          __FLASH_LIBRARY__
00546         #ifndef __SPI_1__
00547                 #define __SPI_1__
00548         #endif
00549 #endif
00550 
00551 #ifdef          __PRINTF_EMBED__
00552         #ifndef __STRINGS_EMBED__
00553                 #define __STRINGS_EMBED__
00554         #endif
00555 #endif
00556 
00557 #ifdef          __SCANF_EMBED__
00558         #ifndef __STRINGS_EMBED__
00559                 #define __STRINGS_EMBED__
00560         #endif
00561 #endif
00562 
00563 #ifdef          __SD_CARD__
00564         #ifndef __SPI_1__
00565                 #define __SPI_1__
00566         #endif
00567 #endif
00568 
00569 #ifdef          __TFT_CONTROL__
00570         #ifndef __SPI_1__
00571                 #define __SPI_1__
00572         #endif
00573 #endif
00574 
00575 #ifdef          __GX_PRIMITIVE__
00576         #ifndef __SPI_1__
00577                 #define __SPI_1__
00578         #endif
00579         #ifndef __TFT_CONTROL__
00580                 #define __TFT_CONTROL__
00581         #endif
00582 #endif
00583 
00584 #ifdef          __TOUCH_SCREEN_LIBRARY__
00585         #ifndef __GX_PRIMITIVE__
00586                 #define __GX_PRIMITIVE__
00587         #endif
00588         #ifndef __SPI_1__
00589                 #define __SPI_1__
00590         #endif
00591         #ifndef __TFT_CONTROL__
00592                 #define __TFT_CONTROL__
00593         #endif
00594 #endif
00595 
00597 // End of library dependency ********************************************
00598 
00601 
00608 void Set_Port();
00609 
00649 void Set_PortFInterruptService(int bit, void (*pCallback)());
00650 
00690 void Set_PortGInterruptService(int bit, void (*pCallback)());
00691 
00698 void Set_PortFInterruptEnable(int bit, bool ena);
00699 
00706 void Set_PortGInterruptEnable(int bit, bool ena);
00707 
00712 void Clear_PortFInterrupt();
00713 
00718 void Clear_PortGInterrupt();
00719 
00721 
00722 // T I M E R  *****************************************************************
00723 // ****************************************************************************
00724 #ifdef          __TIMER__
00725 
00729 #define TIMER_0         0       
00730 #define TIMER_1         1       
00731 #define TIMER_2         2       
00732 
00733 
00734 
00749 
00779 void Set_TimerInterruptService(int timer, void (*pCallback)(), unsigned countValue);
00780 
00787 void Set_TimerEnable(int timer, bool ena);
00788 
00789 // Set a square-wave on specified timer, width specify the value  (us) of high square wave
00790 void Set_TimerSquareWave(int timer, unsigned width, unsigned period);
00791 
00797 void Set_TimerCounter(int timer);
00798 
00819 unsigned long Get_TimerCounter(int timer);
00820 
00821 // C O R E  T I M E R  ********************************************************
00822 // ****************************************************************************
00823 
00863 void Set_CoreTimerInterruptService(int prescaler, unsigned countValue, bool autoReload, void (*pCallback)());
00864 
00870 void Set_CoreTimerEnable(bool ena);
00871 
00872 // W A T C H D O G  ***********************************************************
00873 // ****************************************************************************
00874 
00917 void Set_WatchDogTimer(unsigned count);
00918 
00924 void Set_WatchDogTimerEnable(bool enable);
00925 
00927 
00928 #endif          // __TIMER__
00929 
00930 // S P I  *********************************************************************
00931 // ****************************************************************************
00932 #ifdef          __SPI_1__
00933 
00937 #define SPI_SD          0       
00938 #define SPI_TFT         1       
00939 #define SPI_MEM_1       2       
00940 #define SPI_MEM_2       3       
00941 #define SPI_TSC         4       
00942 #define SPI_DA          5       
00943 #define SPI_PP          6       
00944 #define SPI_AUX         7       
00945 #define SPI_AD          8       
00946 #define SPI_CC3000      9       
00947 #define SPI_SMP16C  10  
00948 
00949 
00950 
00953 
00959 inline void Set_SPICS(bool ena);
00960 
00966 void Set_SPI(int channel);
00967 
00974 unsigned char Write_SPI(unsigned char value);
00975 
00989 unsigned char Write_SPIx(unsigned char value);
00990 
00991 
01003 unsigned char Write_SPIn(const unsigned char * value, unsigned int num);
01004 
01005 
01017 unsigned char Read_SPIn(unsigned char * value, unsigned int num);
01018 
01030 unsigned char Write_SPInx(const unsigned char * value, unsigned int num);
01031 
01032 
01044 unsigned char Read_SPInx(unsigned char * value, unsigned int num);
01045 
01047 
01050 
01065 void Set_ExpansionPort(unsigned char portAdir);
01066 
01073 unsigned char Get_PortA();
01074 
01082 void Set_PortA(unsigned char value);
01083 
01084 
01090 void Set_Controls(unsigned char value);
01091 
01097 unsigned char Get_Controls();
01098 
01100 
01104 // PortB control bit
01105 #define SPI_LDAC        1               
01106 #define SPI_DETECT      2               
01107 #define SPI_WPRT        4               
01108 #define SPI_SDON        8               
01109 #define SPI_TFTON       16              
01110 
01111 
01112 
01115 
01155 unsigned int Get_AD(unsigned char singDiff, unsigned char channel);
01156 
01164 void Set_DA(unsigned char gain, unsigned char dac, unsigned int value);
01165 
01167 
01168 #endif          // __SPI_1__
01169 
01170 // I 2 C  *********************************************************************
01171 // ****************************************************************************
01172 #ifdef          __I2C__
01173 
01176 
01181 void Reset_I2C(void);
01182 
01207 void Set_I2C(unsigned short DeviceAddr, unsigned char * I2C_DataPointer, unsigned short Count, unsigned short I2C_Length);
01208 
01216 void Get_I2C(unsigned short DeviceAddr, unsigned char * I2C_DataPointer, unsigned short Count);
01217 
01219 
01220 #endif          // __I2C__
01221 
01222 // C L O C K ******************************************************************
01223 // ****************************************************************************
01224 
01227 
01238 void Set_PLL(int vcoMultiplier, int sclkDivider);
01239 
01244 void DelayUs(unsigned long dly);
01245 
01250 void DelayMs(unsigned long dlyMs);
01251 
01258 void Set_I2C_Rate(int rate, int dutyCyle);
01259 
01261 
01262 // S E R I A L  ***************************************************************
01263 // ****************************************************************************
01264 
01267 
01268 #define kbhit   GetChar_Uart0   
01269 
01270 
01278 void Set_Uart0(int baudrate);
01279 
01285 void SendChar_Uart0(unsigned char c);
01286 
01293 void SendChars_Uart0(unsigned char * buf, unsigned int size);
01294 
01301 void SendString_Uart0(const char * s);
01302 
01308 unsigned char GetChar_Uart0();
01309 
01315 unsigned char Signal_Uart0();
01316 
01318 
01319 // P R I N T F  ***************************************************************
01320 // ****************************************************************************
01321 
01324 #ifdef          __PRINTF_EMBED__
01325 
01365 int printf(const char * format, ...);
01366 
01379 int sprintf(char * out, const char * format, ...);
01380 
01381 #endif          // __PRINTF_EMBED__
01382 
01383 // S C A N F  *****************************************************************
01384 // ****************************************************************************
01385 #ifdef          __SCANF_EMBED__
01386 
01416 int _scanf(const char * format, ...);
01417 
01425 int consoleGetString(char * pString);
01426         
01427 #endif          // __SCANF_EMBED__
01428 
01430 
01431 #ifdef          __STRINGS_EMBED__
01432 
01435 
01436 #define __isalpha(c) (c >'9')   
01440                                                                 
01441 #define __isspace(c) ((c)==' ' || (c)=='\f' || (c)=='\n' || (c)=='\r' || (c)=='\t' || (c)=='\v')
01447 #define __isupper(c) !(c & 0x20)
01451 #define __ishex(c) (((c >= '0')&&(c <= '9'))||((c >= 'A')&&(c <= 'F')))
01454 #define __ascii2hex(c) ((c <= '9')? c-'0': c-'A'+10)
01455 
01456 #define __isdigit(c) ((c)>='0' && (c)<='9')
01459 #define __isblank(c) ((c)==' ' || (c)=='\t')
01463 #define __isprint(c) (((c)>=32 && (c)<=126) || ((c)>=161 && (c)<=254))
01468 
01469 
01483 int _tolower(int c);
01484 
01499 inline int _toupper(int c);
01500 
01509 unsigned int _strlen(char * str);
01510 
01518 unsigned dbl2stri(char * outbfr, double dbl, unsigned dec_digits);
01519 
01526 int _atoi(char * pString);
01527 
01533 int _htoi(const char * pString);
01534 
01535 #ifdef  __STRINGS_EMBED__EXT__
01536 
01541 void _strchop(char * s1);
01542 
01548 char _strlastchar(const char * str1);
01549 
01564 int _strcmp(const char * str1, const char * str2);
01565 
01581 int _strncmp(const char * str1, const char * str2, int num);
01582 
01589 const char * _strchr(const char * str, char character);
01590 
01602 char * _strcpy(char * destination, const char * source);
01603 
01618 char * _strncpy(char * destination, const char * source, int num);
01619 
01625 void _reverse(char * str);
01626 
01638 unsigned _str_split(char * string, char charSep, int maxArgs, char * argv);
01639 
01645 void _str_leftShift(char * string, int index);
01646 
01651 void _str_simplified(char * string);
01652 
01659 const char * _str_field(const char * string, int field);
01660 
01661 #endif  // __STRINGS_EMBED__EXT__
01662 
01664 #endif          // __STRINGS_EMBED__
01665 
01666 // M M C   C A R D  ***********************************************************
01667 // ****************************************************************************
01668 #ifdef          __MMC_CARD__
01669 
01673 
01674 #define INIT_CMD0_ERROR                 0xFF
01675 #define INIT_CMD1_ERROR                 0xFE
01676 #define WRITE_BLOCK_ERROR               0xFD
01677 #define READ_BLOCK_ERROR                0xFC
01678 #define MMC_RESET                               0x40 + 0
01679 #define MMC_INIT                                0x40 + 1
01680 #define MMC_READ_CSD                    0x40 + 9
01681 #define MMC_READ_CID                    0x40 + 10
01682 #define MMC_STOP_TRANSMISSION   0x40 + 12
01683 #define MMC_SEND_STATUS                 0x40 + 13
01684 #define MMC_SET_BLOCKLEN                0x40 + 16
01685 #define MMC_READ_BLOCK                  0x40 + 17
01686 #define MMC_READ_MULTI_BLOCK    0x40 + 18
01687 #define MMC_WRITE_BLOCK                 0x40 + 24
01688 #define MMC_WRITE_MULTI_BLOCK   0x40 + 25
01689 #define BYTE_PER_SEC                    512
01690 
01692 
01701 
01718 int MMC_Open();
01719 
01724 void MMC_Close();
01725 
01733 unsigned char MMC_WriteCommand(unsigned int cmd, unsigned int address);
01734 
01743 unsigned char MMC_WriteCommandCRC(unsigned int cmd, unsigned int address, unsigned char crc);
01744 
01752 unsigned char MMC_ReadSector(unsigned int sector, unsigned char * buf);
01753 
01761 unsigned char MMC_WriteSector(unsigned int sector, unsigned char * buf);
01762 
01764 #endif          // __MMC_CARD__
01765 
01766 // S D   C A R D  *************************************************************
01767 // ****************************************************************************
01768 #ifdef          __SD_CARD__
01769 
01770 #define SD_CS_OFF       1       // CS Off
01771 #define SD_CS_ON        0       // CS On
01772 
01773 // Library configuration ******************************************************
01774 // ****************************************************************************
01775 // Set to 1 to enable MMC/SD write support, set to 0 to disable it.
01776 #define SD_WRITE_SUPPORT        1
01777 // Set to 1 to buffer write accesses, set to 0 to disable it.
01778 #define SD_WRITE_BUFFERING      0
01779 // Set to 1 to save static RAM, but be aware that you will lose performance.
01780 #define SD_SAVE_RAM             0
01781 // Set to 1 to enable SDHC
01782 #define SD_SDHC                         1
01783 
01784 #ifndef OFFSET_T_TYPE
01785 #define OFFSET_T_TYPE
01786     #if SD_SDHC
01787         typedef unsigned long long offset_t;
01788     #else
01789         typedef unsigned long offset_t;
01790     #endif
01791 #endif
01792 
01793 #if SD_WRITE_SUPPORT
01794 #undef SD_SAVE_RAM
01795 #define SD_SAVE_RAM 0
01796 #else
01797 #undef SD_WRITE_BUFFERING
01798 #define SD_WRITE_BUFFERING 0
01799 #endif
01800 
01804 
01805 #define CMD_GO_IDLE_STATE                       0x00    
01806 #define CMD_SEND_OP_COND                        0x01    
01807 #define CMD_SEND_IF_COND                        0x08    
01808 #define CMD_SEND_CSD                            0x09    
01809 #define CMD_SEND_CID                            0x0a    
01810 #define CMD_STOP_TRANSMISSION           0x0c    
01811 #define CMD_SEND_STATUS                         0x0d    
01812 #define CMD_SET_BLOCKLEN                        0x10    
01813 #define CMD_READ_SINGLE_BLOCK           0x11    
01814 #define CMD_READ_MULTIPLE_BLOCK         0x12    
01815 #define CMD_WRITE_SINGLE_BLOCK          0x18    
01816 #define CMD_WRITE_MULTIPLE_BLOCK        0x19    
01817 #define CMD_PROGRAM_CSD                         0x1b    
01818 #define CMD_SET_WRITE_PROT                      0x1c    
01819 #define CMD_CLR_WRITE_PROT                      0x1d    
01820 #define CMD_SEND_WRITE_PROT             0x1e    
01821 #define CMD_TAG_SECTOR_START            0x20    
01822 #define CMD_TAG_SECTOR_END                      0x21    
01823 #define CMD_UNTAG_SECTOR                        0x22    
01824 #define CMD_TAG_ERASE_GROUP_START       0x23    
01825 #define CMD_TAG_ERASE_GROUP_END         0x24    
01826 #define CMD_UNTAG_ERASE_GROUP           0x25    
01827 #define CMD_ERASE                                       0x26    
01828 #define CMD_SD_SEND_OP_COND             0x29    
01829 #define CMD_LOCK_UNLOCK                         0x2a    
01830 #define CMD_APP                                         0x37    
01831 #define CMD_READ_OCR                            0x3a    
01832 #define CMD_CRC_ON_OFF                          0x3b    
01833 
01834 
01835 
01839 #define R1_IDLE_STATE                                   0
01840 #define R1_ERASE_RESET                                  1
01841 #define R1_ILL_COMMAND                                  2
01842 #define R1_COM_CRC_ERR                                  3
01843 #define R1_ERASE_SEQ_ERR                                4
01844 #define R1_ADDR_ERR                                             5
01845 #define R1_PARAM_ERR                                    6
01846 
01848 
01852 // R1b: equals R1, additional busy bytes
01853 // R2: size 2 bytes
01854 #define R2_CARD_LOCKED                                  0
01855 #define R2_WP_ERASE_SKIP                                1
01856 #define R2_ERR                                                  2
01857 #define R2_CARD_ERR                                             3
01858 #define R2_CARD_ECC_FAIL                                4
01859 #define R2_WP_VIOLATION                                 5
01860 #define R2_INVAL_ERASE                                  6
01861 #define R2_OUT_OF_RANGE                                 7
01862 #define R2_CSD_OVERWRITE                                7
01863 #define R2_IDLE_STATE                                   (R1_IDLE_STATE + 8)
01864 #define R2_ERASE_RESET                                  (R1_ERASE_RESET + 8)
01865 #define R2_ILL_COMMAND                                  (R1_ILL_COMMAND + 8)
01866 #define R2_COM_CRC_ERR                                  (R1_COM_CRC_ERR + 8)
01867 #define R2_ERASE_SEQ_ERR                                (R1_ERASE_SEQ_ERR + 8)
01868 #define R2_ADDR_ERR                                             (R1_ADDR_ERR + 8)
01869 #define R2_PARAM_ERR                                    (R1_PARAM_ERR + 8)
01870 
01872 
01876 // R3: size 5 bytes
01877 #define R3_OCR_MASK                                             (0xffffffffUL)
01878 #define R3_IDLE_STATE                                   (R1_IDLE_STATE + 32)
01879 #define R3_ERASE_RESET                                  (R1_ERASE_RESET + 32)
01880 #define R3_ILL_COMMAND                                  (R1_ILL_COMMAND + 32)
01881 #define R3_COM_CRC_ERR                                  (R1_COM_CRC_ERR + 32)
01882 #define R3_ERASE_SEQ_ERR                                (R1_ERASE_SEQ_ERR + 32)
01883 #define R3_ADDR_ERR                                             (R1_ADDR_ERR + 32)
01884 #define R3_PARAM_ERR                                    (R1_PARAM_ERR + 32)
01885 
01887 
01891 // Data Response: size 1 byte
01892 #define DR_STATUS_MASK                                  0x0e
01893 #define DR_STATUS_ACCEPTED                              0x05
01894 #define DR_STATUS_CRC_ERR                               0x0a
01895 #define DR_STATUS_WRITE_ERR                             0x0c
01896 
01898 
01902 #define SD_RAW_SPEC_1           0
01903 #define SD_RAW_SPEC_2           1
01904 #define SD_RAW_SPEC_SDHC        2
01905 
01907 
01908 
01912 #define SD_STS_OK               1
01913 #define SD_STS_NOCARD   2       
01914 #define SD_STS_RDERR    3       
01915 #define SD_STS_CMERR    4       
01916 #define SD_STS_WRGPT    5       
01917 #define SD_STS_WRGVT    6       
01918 #define SD_STS_RESER    7       
01919 
01920 
01921 
01922 #if             !SD_SAVE_RAM
01923 
01924 static unsigned char SD_Buffer[512];    
01925 static offset_t SD_BlockAddress;                
01926 
01927 #if         SD_WRITE_BUFFERING
01928 static unsigned char SD_BlockWritten;   
01929 
01930 #endif          // SD_WRITE_BUFFERING
01931 #endif          // SD_SAVE_RAM
01932 
01935 #ifndef SD_INFO_STRUCT
01936 #define SD_INFO_STRUCT
01937 struct SD_Info
01938 {
01939         unsigned char manufacturer;                             
01940         unsigned char oem[3];                                   
01941         unsigned char product[6];                               
01942         unsigned char revision;                                 
01943         unsigned long serial;                                   
01944         unsigned char manufacturing_year;               
01945         unsigned char manufacturing_month;              
01946         offset_t capacity;                                              
01947         unsigned char flag_copy;                                
01948         unsigned char flag_write_protect;               
01949         unsigned char flag_write_protect_temp;  
01950         unsigned char format;                                   
01951 };
01952 #endif
01953 
01954 extern unsigned char SD_CardType;
01955 
01963 
01970 void                    SD_Power(bool ena);
01971 
01977 unsigned char   SD_Init();
01978 
01984 void                    SD_Selection(int ena);
01985 
01991 int                             SD_CardWriteProtect();
01992 
01999 void                    SD_SetSpeed(int sx);
02000 
02006 bool                    SD_CardCheck();
02007 
02013 bool                    SD_Sync();
02014 
02022 unsigned char   SD_SendCommand(unsigned char command, unsigned long arg);
02023 
02032 unsigned char   SD_Read(offset_t offset, unsigned char * buffer, unsigned int length);
02033 
02042 unsigned char   SD_Write(offset_t offset, const unsigned char * buffer, unsigned int length);
02043 
02050 unsigned char   SD_GetInfo(struct SD_Info * info);
02051         
02053 
02054 #endif          // __SD_CARD__
02055 
02056 #ifdef          __TFT_CONTROL__
02057 
02062 #define   TFT_BLACK                     0x0000          
02063 #define   TFT_NAVY                      0x000F      
02064 #define   TFT_DARK_GREEN        0x03E0      
02065 #define   TFT_DARK_CYAN         0x03EF      
02066 #define   TFT_MAROON            0x7800      
02067 #define   TFT_PURPLE            0x780F      
02068 #define   TFT_OLIVE                     0x7BE0      
02069 #define   TFT_LIGHT_GRAY        0xC618      
02070 #define   TFT_DARK_GRAY         0x7BEF      
02071 #define   TFT_BLUE                      0x001F      
02072 #define   TFT_DARK_BLUE         0x0010      
02073 #define   TFT_GREEN                     0x07E0      
02074 #define   TFT_CYAN          0x07FF      
02075 #define   TFT_RED           0xF800      
02076 #define   TFT_MAGENTA           0xF81F      
02077 #define   TFT_YELLOW            0xFFE0      
02078 #define   TFT_WHITE                     0xFFFF      
02079 
02080 #define gxRGB(r, g, b) (((r) >> 3) << 11) | (((g) >> 2) << 5) | (((b) >> 3) & 0x1F)     
02081 
02082 
02083 
02087 
02088 #define SSD2119_DEVICE_CODE_READ_REG    0x00
02089 #define SSD2119_OSC_START_REG                   0x00
02090 #define SSD2119_OUTPUT_CTRL_REG                 0x01
02091 #define SSD2119_LCD_DRIVE_AC_CTRL_REG   0x02
02092 #define SSD2119_PWR_CTRL_1_REG                  0x03
02093 #define SSD2119_DISPLAY_CTRL_REG                0x07
02094 #define SSD2119_FRAME_CYCLE_CTRL_REG    0x0B
02095 #define SSD2119_PWR_CTRL_2_REG                  0x0C
02096 #define SSD2119_PWR_CTRL_3_REG                  0x0D
02097 #define SSD2119_PWR_CTRL_4_REG                  0x0E
02098 #define SSD2119_GATE_SCAN_START_REG             0x0F
02099 #define SSD2119_SLEEP_MODE_1_REG                0x10
02100 #define SSD2119_ENTRY_MODE_REG                  0x11
02101 #define SSD2119_GEN_IF_CTRL_REG                 0x15
02102 #define SSD2119_PWR_CTRL_5_REG                  0x1E
02103 #define SSD2119_RAM_DATA_REG                    0x22
02104 #define SSD2119_FRAME_FREQ_REG                  0x25
02105 #define SSD2119_VCOM_OTP_1_REG                  0x28
02106 #define SSD2119_VCOM_OTP_2_REG                  0x29
02107 #define SSD2119_GAMMA_CTRL_1_REG                0x30
02108 #define SSD2119_GAMMA_CTRL_2_REG                0x31
02109 #define SSD2119_GAMMA_CTRL_3_REG                0x32
02110 #define SSD2119_GAMMA_CTRL_4_REG                0x33
02111 #define SSD2119_GAMMA_CTRL_5_REG                0x34
02112 #define SSD2119_GAMMA_CTRL_6_REG                0x35
02113 #define SSD2119_GAMMA_CTRL_7_REG                0x36
02114 #define SSD2119_GAMMA_CTRL_8_REG                0x37
02115 #define SSD2119_GAMMA_CTRL_9_REG                0x3A
02116 #define SSD2119_GAMMA_CTRL_10_REG               0x3B
02117 #define SSD2119_V_SCROLL_CTRL_1_REG             0x41
02118 #define SSD2119_V_SCROLL_CTRL_2_REG             0x42
02119 #define SSD2119_V_RAM_POS_REG                   0x44
02120 #define SSD2119_H_RAM_START_REG                 0x45
02121 #define SSD2119_H_RAM_END_REG                   0x46
02122 #define SSD2119_SCREEN_1_START_POS_REG  0x48
02123 #define SSD2119_SCREEN_1_END_POS_REG    0x49  
02124 #define SSD2119_SCREEN_2_START_POS_REG  0x4A
02125 #define SSD2119_SCREEN_2_END_POS_REG    0x4B                                         
02126 #define SSD2119_X_RAM_ADDR_REG                  0x4E
02127 #define SSD2119_Y_RAM_ADDR_REG                  0x4F
02128 
02130 
02143 
02149 void Set_TFTlight(unsigned char value);
02150 
02156 void Set_TFTlightPower(bool ena);
02157 
02163 void Set_TFTdata(unsigned char value);
02164 
02170 void Set_TFTdata16(unsigned short value);
02171 
02177 void Set_TFTcommand(unsigned char value);
02178 
02183 void Set_TFTinit();
02184 
02189 void Set_TFThome();
02190 
02192 
02193 #endif          // __TFT_CONTROL__
02194 
02195 #ifdef          __GX_PRIMITIVE__
02200 
02201 #define QVGA_DISPLAY_WIDTH  320 
02202 #define QVGA_DISPLAY_HEIGHT 240 
02203 
02204 // LANDSCAPE and VERT_DIRECTION is OK
02205 #define LANDSCAPE
02206 
02207 #ifdef PORTRAIT
02208         #define HORIZ_DIRECTION         0x28
02209         #define VERT_DIRECTION          0x20
02210         #define MAPPED_X(x, y)          (319 - (y))
02211         #define MAPPED_Y(x, y)          (x)
02212 #endif
02213 //                   
02214 #ifdef LANDSCAPE
02215         #define HORIZ_DIRECTION         0x00
02216         #define VERT_DIRECTION          0x08
02217         #define MAPPED_X(x, y)          (319 - (x))
02218         #define MAPPED_Y(x, y)          (239 - (y))
02219 #endif
02220 //
02221 #ifdef PORTRAIT_FLIP
02222         #define HORIZ_DIRECTION         0x18
02223         #define VERT_DIRECTION          0x10
02224         #define MAPPED_X(x, y)          (y)
02225         #define MAPPED_Y(x, y)          (239 - (x))
02226 #endif
02227 //
02228 #ifdef LANDSCAPE_FLIP
02229         #define HORIZ_DIRECTION         0x30
02230         #define VERT_DIRECTION          0x38
02231         #define MAPPED_X(x, y)          (x)
02232         #define MAPPED_Y(x, y)          (y)
02233 #endif
02234 
02235 #define SSD2119_ENTRY_MODE_DEFAULT      0x6830
02236 #define SSD2119_ENTRY_MODE_SET(x)       ((SSD2119_ENTRY_MODE_DEFAULT & 0xFF00) | (x))
02237 
02238 typedef unsigned short gCOL;    
02239 typedef unsigned short gInt;    
02240 
02246 void gxMovePen(gInt x, gInt y);
02247 
02254 void gxSetPixel(gInt x, gInt y, gCOL color);
02255 
02260 void gxClear(gCOL color);
02261 
02271 void gxRect(gInt x0, gInt y0, gInt x1, gInt y1, gCOL color);
02272 
02282 void gxRectDashed(gInt x0, gInt y0, gInt x1, gInt y1, gInt modulo, gCOL color);
02283 
02292 void gxRectFilled(gInt sX, gInt sY, gInt dX, gInt dY, gCOL color);
02293 
02302 void gxLine(gInt x0, gInt y0, gInt x1, gInt y1, gCOL color);
02303 
02313 void gxLineDashed(gInt x0, gInt y0, gInt x1, gInt y1, gInt modulo, gCOL color);
02314 
02322 void gxCircle(gInt x0, gInt y0, gInt r, gCOL color);
02323 
02332 void gxCircleDashed(gInt x0, gInt y0, gInt r, gInt modulo, gCOL color);
02333 
02343 void gxPicture(gInt sX, gInt sY, gInt sizeX, gInt sizeY, gCOL * bitMap);
02344 
02345 #ifdef          __GX_PRIMITIVE__FONT__
02346 
02347 #define ________        0x00    
02348 #define _______X        0x01
02349 #define ______X_        0x02
02350 #define ______XX        0x03
02351 #define _____X__        0x04
02352 #define _____X_X        0x05
02353 #define _____XX_        0x06
02354 #define _____XXX        0x07
02355 #define ____X___        0x08
02356 #define ____X__X        0x09
02357 #define ____X_X_        0x0a
02358 #define ____X_XX        0x0b
02359 #define ____XX__        0x0c
02360 #define ____XX_X        0x0d
02361 #define ____XXX_        0x0e
02362 #define ____XXXX        0x0f
02363 #define ___X____        0x10
02364 #define ___X___X        0x11
02365 #define ___X__X_        0x12
02366 #define ___X__XX        0x13
02367 #define ___X_X__        0x14
02368 #define ___X_X_X        0x15
02369 #define ___X_XX_        0x16
02370 #define ___X_XXX        0x17
02371 #define ___XX___        0x18
02372 #define ___XX__X        0x19
02373 #define ___XX_X_        0x1a
02374 #define ___XX_XX        0x1b
02375 #define ___XXX__        0x1c
02376 #define ___XXX_X        0x1d
02377 #define ___XXXX_        0x1e
02378 #define ___XXXXX        0x1f
02379 #define __X_____        0x20
02380 #define __X____X        0x21
02381 #define __X___X_        0x22
02382 #define __X___XX        0x23
02383 #define __X__X__        0x24
02384 #define __X__X_X        0x25
02385 #define __X__XX_        0x26
02386 #define __X__XXX        0x27
02387 #define __X_X___        0x28
02388 #define __X_X__X        0x29
02389 #define __X_X_X_        0x2a
02390 #define __X_X_XX        0x2b
02391 #define __X_XX__        0x2c
02392 #define __X_XX_X        0x2d
02393 #define __X_XXX_        0x2e
02394 #define __X_XXXX        0x2f
02395 #define __XX____        0x30
02396 #define __XX___X        0x31
02397 #define __XX__X_        0x32
02398 #define __XX__XX        0x33
02399 #define __XX_X__        0x34
02400 #define __XX_X_X        0x35
02401 #define __XX_XX_        0x36
02402 #define __XX_XXX        0x37
02403 #define __XXX___        0x38
02404 #define __XXX__X        0x39
02405 #define __XXX_X_        0x3a
02406 #define __XXX_XX        0x3b
02407 #define __XXXX__        0x3c
02408 #define __XXXX_X        0x3d
02409 #define __XXXXX_        0x3e
02410 #define __XXXXXX        0x3f
02411 #define _X______        0x40
02412 #define _X_____X        0x41
02413 #define _X____X_        0x42
02414 #define _X____XX        0x43
02415 #define _X___X__        0x44
02416 #define _X___X_X        0x45
02417 #define _X___XX_        0x46
02418 #define _X___XXX        0x47
02419 #define _X__X___        0x48
02420 #define _X__X__X        0x49
02421 #define _X__X_X_        0x4a
02422 #define _X__X_XX        0x4b
02423 #define _X__XX__        0x4c
02424 #define _X__XX_X        0x4d
02425 #define _X__XXX_        0x4e
02426 #define _X__XXXX        0x4f
02427 #define _X_X____        0x50
02428 #define _X_X___X        0x51
02429 #define _X_X__X_        0x52
02430 #define _X_X__XX        0x53
02431 #define _X_X_X__        0x54
02432 #define _X_X_X_X        0x55
02433 #define _X_X_XX_        0x56
02434 #define _X_X_XXX        0x57
02435 #define _X_XX___        0x58
02436 #define _X_XX__X        0x59
02437 #define _X_XX_X_        0x5a
02438 #define _X_XX_XX        0x5b
02439 #define _X_XXX__        0x5c
02440 #define _X_XXX_X        0x5d
02441 #define _X_XXXX_        0x5e
02442 #define _X_XXXXX        0x5f
02443 #define _XX_____        0x60
02444 #define _XX____X        0x61
02445 #define _XX___X_        0x62
02446 #define _XX___XX        0x63
02447 #define _XX__X__        0x64
02448 #define _XX__X_X        0x65
02449 #define _XX__XX_        0x66
02450 #define _XX__XXX        0x67
02451 #define _XX_X___        0x68
02452 #define _XX_X__X        0x69
02453 #define _XX_X_X_        0x6a
02454 #define _XX_X_XX        0x6b
02455 #define _XX_XX__        0x6c
02456 #define _XX_XX_X        0x6d
02457 #define _XX_XXX_        0x6e
02458 #define _XX_XXXX        0x6f
02459 #define _XXX____        0x70
02460 #define _XXX___X        0x71
02461 #define _XXX__X_        0x72
02462 #define _XXX__XX        0x73
02463 #define _XXX_X__        0x74
02464 #define _XXX_X_X        0x75
02465 #define _XXX_XX_        0x76
02466 #define _XXX_XXX        0x77
02467 #define _XXXX___        0x78
02468 #define _XXXX__X        0x79
02469 #define _XXXX_X_        0x7a
02470 #define _XXXX_XX        0x7b
02471 #define _XXXXX__        0x7c
02472 #define _XXXXX_X        0x7d
02473 #define _XXXXXX_        0x7e
02474 #define _XXXXXXX        0x7f
02475 #define X_______        0x80
02476 #define X______X        0x81
02477 #define X_____X_        0x82
02478 #define X_____XX        0x83
02479 #define X____X__        0x84
02480 #define X____X_X        0x85
02481 #define X____XX_        0x86
02482 #define X____XXX        0x87
02483 #define X___X___        0x88
02484 #define X___X__X        0x89
02485 #define X___X_X_        0x8a
02486 #define X___X_XX        0x8b
02487 #define X___XX__        0x8c
02488 #define X___XX_X        0x8d
02489 #define X___XXX_        0x8e
02490 #define X___XXXX        0x8f
02491 #define X__X____        0x90
02492 #define X__X___X        0x91
02493 #define X__X__X_        0x92
02494 #define X__X__XX        0x93
02495 #define X__X_X__        0x94
02496 #define X__X_X_X        0x95
02497 #define X__X_XX_        0x96
02498 #define X__X_XXX        0x97
02499 #define X__XX___        0x98
02500 #define X__XX__X        0x99
02501 #define X__XX_X_        0x9a
02502 #define X__XX_XX        0x9b
02503 #define X__XXX__        0x9c
02504 #define X__XXX_X        0x9d
02505 #define X__XXXX_        0x9e
02506 #define X__XXXXX        0x9f
02507 #define X_X_____        0xa0
02508 #define X_X____X        0xa1
02509 #define X_X___X_        0xa2
02510 #define X_X___XX        0xa3
02511 #define X_X__X__        0xa4
02512 #define X_X__X_X        0xa5
02513 #define X_X__XX_        0xa6
02514 #define X_X__XXX        0xa7
02515 #define X_X_X___        0xa8
02516 #define X_X_X__X        0xa9
02517 #define X_X_X_X_        0xaa
02518 #define X_X_X_XX        0xab
02519 #define X_X_XX__        0xac
02520 #define X_X_XX_X        0xad
02521 #define X_X_XXX_        0xae
02522 #define X_X_XXXX        0xaf
02523 #define X_XX____        0xb0
02524 #define X_XX___X        0xb1
02525 #define X_XX__X_        0xb2
02526 #define X_XX__XX        0xb3
02527 #define X_XX_X__        0xb4
02528 #define X_XX_X_X        0xb5
02529 #define X_XX_XX_        0xb6
02530 #define X_XX_XXX        0xb7
02531 #define X_XXX___        0xb8
02532 #define X_XXX__X        0xb9
02533 #define X_XXX_X_        0xba
02534 #define X_XXX_XX        0xbb
02535 #define X_XXXX__        0xbc
02536 #define X_XXXX_X        0xbd
02537 #define X_XXXXX_        0xbe
02538 #define X_XXXXXX        0xbf
02539 #define XX______        0xc0
02540 #define XX_____X        0xc1
02541 #define XX____X_        0xc2
02542 #define XX____XX        0xc3
02543 #define XX___X__        0xc4
02544 #define XX___X_X        0xc5
02545 #define XX___XX_        0xc6
02546 #define XX___XXX        0xc7
02547 #define XX__X___        0xc8
02548 #define XX__X__X        0xc9
02549 #define XX__X_X_        0xca
02550 #define XX__X_XX        0xcb
02551 #define XX__XX__        0xcc
02552 #define XX__XX_X        0xcd
02553 #define XX__XXX_        0xce
02554 #define XX__XXXX        0xcf
02555 #define XX_X____        0xd0
02556 #define XX_X___X        0xd1
02557 #define XX_X__X_        0xd2
02558 #define XX_X__XX        0xd3
02559 #define XX_X_X__        0xd4
02560 #define XX_X_X_X        0xd5
02561 #define XX_X_XX_        0xd6
02562 #define XX_X_XXX        0xd7
02563 #define XX_XX___        0xd8
02564 #define XX_XX__X        0xd9
02565 #define XX_XX_X_        0xda
02566 #define XX_XX_XX        0xdb
02567 #define XX_XXX__        0xdc
02568 #define XX_XXX_X        0xdd
02569 #define XX_XXXX_        0xde
02570 #define XX_XXXXX        0xdf
02571 #define XXX_____        0xe0
02572 #define XXX____X        0xe1
02573 #define XXX___X_        0xe2
02574 #define XXX___XX        0xe3
02575 #define XXX__X__        0xe4
02576 #define XXX__X_X        0xe5
02577 #define XXX__XX_        0xe6
02578 #define XXX__XXX        0xe7
02579 #define XXX_X___        0xe8
02580 #define XXX_X__X        0xe9
02581 #define XXX_X_X_        0xea
02582 #define XXX_X_XX        0xeb
02583 #define XXX_XX__        0xec
02584 #define XXX_XX_X        0xed
02585 #define XXX_XXX_        0xee
02586 #define XXX_XXXX        0xef
02587 #define XXXX____        0xf0
02588 #define XXXX___X        0xf1
02589 #define XXXX__X_        0xf2
02590 #define XXXX__XX        0xf3
02591 #define XXXX_X__        0xf4
02592 #define XXXX_X_X        0xf5
02593 #define XXXX_XX_        0xf6
02594 #define XXXX_XXX        0xf7
02595 #define XXXXX___        0xf8
02596 #define XXXXX__X        0xf9
02597 #define XXXXX_X_        0xfa
02598 #define XXXXX_XX        0xfb
02599 #define XXXXXX__        0xfc
02600 #define XXXXXX_X        0xfd
02601 #define XXXXXXX_        0xfe
02602 #define XXXXXXXX        0xff
02603 
02611 void gxPutChar(gInt x, gInt y, unsigned char ch);
02612 
02621 void gxFontColorSize(gCOL foreground, gCOL background, gInt xs, gInt ys);
02622 
02634 void gxPutString(gInt x, gInt y, const char * pStr);
02635 
02643 void gxStringSize(const char * txt, int * xsize, int * ysize);
02644 
02646 
02647 #endif          // __GX_PRIMITIVE__FONT__
02648 #endif          // __GX_PRIMITIVE__
02649 
02650 // F L A S H  M E M O R Y *****************************************************
02651 // ****************************************************************************
02652 #ifdef          __FLASH_LIBRARY__
02653 
02656 // FLASH definitions
02657 #define FLSH_NUM_SECTORS        64              
02658 #define FLSH_SECTOR_SIZE        0x10000 
02659 
02660 //Flash commands
02661 #define FLSH_WREN               (0x06)                  
02662 #define FLSH_WRDI               (0x04)                  
02663 #define FLSH_RDSR               (0x05)                  
02664 #define FLSH_WRSR               (0x01)                  
02665 #define FLSH_READ               (0x03)                  
02666 #define FLSH_FAST_READ  (0x0B)                  
02667 #define FLSH_PP                 (0x02)                  
02668 #define FLSH_SE                 (0xD8)                  
02669 #define FLSH_BE                 (0xC7)                  
02670 #define FLSH_WIP                (0x1)                   
02671 #define FLSH_WEL                (0x2)                   
02672 
02673 #define FLSH_TIMEOUT 350000000                  
02674 
02675 typedef enum 
02676 {
02677         FLSH_NO_ERR,                            
02678         FLSH_POLL_TIMEOUT,                      
02679         FLSH_INVALID_SECTOR,            
02680         FLSH_INVALID_BLOCK,                     
02681 }FLSH_ERROR_CODE;                               
02682 
02683 
02693 FLSH_ERROR_CODE FLSH_WriteData(unsigned long address, long nBytes, unsigned char * dataBuffer);
02694 
02704 FLSH_ERROR_CODE FLSH_ReadData(unsigned long address, long nBytes, unsigned char * dataBuffer);
02705 
02712 FLSH_ERROR_CODE FLSH_GetSectorNumber(unsigned long address, int * pnSector);
02713 
02719 FLSH_ERROR_CODE FLSH_EraseBlock(int nSector);
02720 
02722 
02723 #endif          // __FLASH_LIBRRY__
02724 
02725 #ifdef          __TOUCH_SCREEN_LIBRARY__
02726 
02746 
02747 typedef enum 
02748 {
02756         TS_TouchThreshold               = 2,
02757         
02764         TS_SensitivityFilter    = 3,
02765         
02775         TS_SamplingFast                 = 4,
02776         
02783         TS_SpeedThreshold               = 8,
02784         
02793         TS_SleepDelay                   = 10,
02794         
02805         TS_PenUpDelay                   = 11
02806 }AR1021_Commands; 
02807 
02815 int TS_SendCommand(unsigned char * value, int len, unsigned char * extend);
02816 
02821 unsigned char TS_StartAddress();
02822 
02828 int TS_Enable(bool enable);
02829 
02835 void TS_Set(int reg, int val);
02836 
02840 void TS_Open();
02841 
02845 void TS_Clear();
02846 
02850 void TS_Close();
02851 
02856 bool TS_Check();
02857 
02864 bool TS_ReadCursor(int * sx, int * sy);
02865 
02870 bool TS_WaitTouch();
02871 
02878 bool TS_GetCursorCoords(int * x, int * y);
02879 
02883 void TS_Calibrate();
02884 
02886 
02887 #endif          // __TOUCH_SCREEN_LIBRARY__
02888 
02889 #ifdef          __MATH_FUNCTIONS__
02890 
02891 // Trigonometric function and related with integer math
02892 // Not tested and documented! Don't use.
02893 int sin(int ix);
02894 int cos(int ix);
02895 int tan(int ix);
02896 int asin(int y, int hyp);
02897 int acos(int x, int hyp);
02898 int atan(int y, int x);
02899 unsigned int isqrt(unsigned int val);
02900 
02901 #endif          // __MATH_FUNCTIONS__
02902 
02903 #ifdef          __FAST_MATH_LIBRARY__
02907 
02908 #define FLT_RADIX               2                                                       
02909 #define DBL_MAX_EXP             +1024                                           
02910 #define DBL_MIN_EXP             -1021                                           
02911 #define DBL_MAX                 1.7976931348623157E+308         
02912 #define DBL_MIN                 2.2250738585072014E-308         
02913 #define DBL_MANT_DIG    53                                                      
02914 #define EDOM                    0x01                                            
02915 #define ERANGE                  0x03                                            
02916 #define DBL_EXP_BIAS    1023                                            
02917 #define DBL_EXP_INFNAN  2047
02918 # define HUGE_VAL \
02919         (__extension__                                                                                                                          \
02920         ((union { unsigned __l __attribute__((__mode__(__DI__))); double __d; })        \
02921         { __l: 0x7ff0000000000000ULL }).__d)
02922 
02924 #define M_PI            3.14159265358979323846264338327950288   
02925 #define M_2PI           6.28318530717958647692528676655900576   
02926 #define M_3PI_4         2.35619449019234492884698253745962716   
02927 #define M_PI_2          1.57079632679489661923132169163975144   
02928 #define M_3PI_8         1.17809724509617246442349126872981358   
02929 #define M_PI_4          0.78539816339744830961566084581987572   
02930 #define M_PI_8          0.39269908169872415480783042290993786   
02931 #define M_1_PI          0.31830988618379067153776752674502872   
02932 #define M_2_PI          0.63661977236758134307553505349005744   
02933 #define M_4_PI          1.27323954473516268615107010698011488   
02934 #define M_E             2.71828182845904523536028747135266250   
02935 #define M_LOG2E         1.44269504088896340735992468100189213   
02936 #define M_LOG10E        0.43429448190325182765112891891660508   
02937 #define M_LN2           0.69314718055994530941723212145817657   
02938 #define M_LN10          2.30258509299404568401799145468436421   
02939 #define M_SQRT2         1.41421356237309504880168872420969808   
02940 #define M_1_SQRT2       0.70710678118654752440084436210484904   
02941 #define M_EULER         0.57721566490153286060651209008240243   
02942  
02943 
02944 #define POLYNOM1(x, a)  ((a)[1]*(x)+(a)[0])
02945 #define POLYNOM2(x, a)  (POLYNOM1((x),(a)+1)*(x)+(a)[0])
02946 #define POLYNOM3(x, a)  (POLYNOM2((x),(a)+1)*(x)+(a)[0])
02947 #define POLYNOM4(x, a)  (POLYNOM3((x),(a)+1)*(x)+(a)[0])
02948 #define POLYNOM5(x, a)  (POLYNOM4((x),(a)+1)*(x)+(a)[0])
02949 #define POLYNOM6(x, a)  (POLYNOM5((x),(a)+1)*(x)+(a)[0])
02950 #define POLYNOM7(x, a)  (POLYNOM6((x),(a)+1)*(x)+(a)[0])
02951 #define POLYNOM8(x, a)  (POLYNOM7((x),(a)+1)*(x)+(a)[0])
02952 #define POLYNOM9(x, a)  (POLYNOM8((x),(a)+1)*(x)+(a)[0])
02953 #define POLYNOM10(x, a) (POLYNOM9((x),(a)+1)*(x)+(a)[0])
02954 #define POLYNOM11(x, a) (POLYNOM10((x),(a)+1)*(x)+(a)[0])
02955 #define POLYNOM12(x, a) (POLYNOM11((x),(a)+1)*(x)+(a)[0])
02956 #define POLYNOM13(x, a) (POLYNOM12((x),(a)+1)*(x)+(a)[0])
02957   
02958 #define M_LN_MAX_D      (M_LN2 * DBL_MAX_EXP)
02959 #define M_LN_MIN_D      (M_LN2 * (DBL_MIN_EXP - 1))
02960  
02961 #define DEG_TO_RAD(x) ((x) * 0.017453292519943295769236907684886)       
02962 #define RAD_TO_DEG(x) ((x) * 57.295779513082320876798154814105) 
02963  
02964 #define errno (*__errno())              
02965 
02966 
02973 int __IsNan(double d);
02974 
02984 double modf(double x, double * ip);
02985 
02991 double sign(double x);
02992 
02998 double fabs(double x);
02999 
03012 double frexp(double x, int * exp);
03013 
03022 double ldexp(double x, int exp);
03023 
03029 double sqrt(double x);
03030 
03037 double asin(double x);
03038 
03046 double acos(double x);
03047 
03057 double atan(double x);
03058 
03068 double atan2(double y, double x);
03069 
03076 double ceil(double x);
03077 
03084 double exp(double x);
03085 
03092 double floor(double x);
03093 
03103 double fmod(double numer, double denom);
03104 
03111 int signbit(double x);
03112 
03120 int isfinite(double x);
03121 
03129 int isnan(double x);
03130 
03137 int isinf(double x);
03138 
03149 double remainder(double x, double y);
03150 
03158 double log(double x);
03159 
03166 double log10(double x);
03167 
03180 double pow(double base, double exponent);
03181 
03188 double sin(double x);
03189 
03196 double cos(double x);
03197 
03204 double sinh(double x);
03205 
03212 double cosh(double x);
03213 
03220 double tan(double x);
03221 
03228 double tanh(double x);
03229 
03230 #endif          // __FAST_MATH_LIBRARY__
03231 
03232 #ifdef          __CRC7__
03233 
03241 unsigned char crc7(unsigned char crc, const unsigned char * buffer, unsigned len);
03242 
03243 #endif          // __CRC7__
03244 
03245 #ifdef      __INT_MATH_FUNCTIONS__
03246 
03252 int isin(int ix);
03253 
03259 int icos(int ix);
03260 
03266 int itan(int ix);
03267 
03274 int iasin(int y, int hyp);
03275 
03282 int iacos(int x, int hyp);
03283 
03290 int iatan(int y, int x);
03291 
03297 unsigned int isqrt(unsigned int val);
03298 
03299 
03300 #endif      // __INT_MATH_FUNCTIONS__
03301 
03302 #ifdef __MEMORY_FUNCTIONS__
03303 
03310 void memcpy(char * dst, char * src, int count);
03311 
03318 void memset(char * dst, char ch, int count);
03319 
03326 void * memmove (void * dst, void * src, int count);
03327 
03328 #endif // __MEMORY_FUNCTIONS__

Generated on Tue Apr 7 20:07:43 2015 for BF592A Library by doxygen 1.3.1