├── .cproject ├── .gitignore ├── .project ├── .settings └── de.innot.avreclipse.core.prefs ├── GuideLines_to_Learn_Git.pdf ├── HAL ├── Documentations │ ├── Bluetooth_Documentation.pdf │ ├── ESP8266_Documentation.pdf │ ├── SkyLabGPS_Documentation.pdf │ ├── UltraSonic_design_document.pdf │ ├── nRF2401+_Documentation.pdf │ └── wavecom_Documentation.pdf ├── EF_7Segment.c ├── EF_7Segment.h ├── EF_Bluetooth.c ├── EF_Bluetooth.h ├── EF_Bluetooth_cfg.h ├── EF_DS1307.c ├── EF_DS1307.h ├── EF_E2PROM_24C16.c ├── EF_E2PROM_24C16.h ├── EF_ESP8266.c ├── EF_ESP8266.h ├── EF_ESP8266_cfg.h ├── EF_KeyPad.h ├── EF_Keypad.c ├── EF_LCD.c ├── EF_LCD.h ├── EF_SkyLabGPS.c ├── EF_SkyLabGPS.h ├── EF_UltraSonic.c ├── EF_UltraSonic.h ├── EF_Wavecom.c ├── EF_Wavecom.h ├── EF_nRF2401.c ├── EF_nRF2401.h ├── EF_nRF2401_cfg.h ├── LCD_needTest_Ibrahim.rar └── References │ ├── Bluetooth_VeryGoodTutorial.txt │ ├── EEPROM-24c16.pdf │ ├── ESP8266ATCommandsSet.pdf │ ├── ESP8266_WiFi_4A-AT-Espressif_AT_Instruction_Set_020.pdf │ ├── ESP8266_WiFi_4B-AT-Espressif_AT_Command_Examples_v0.3.pdf │ ├── ESP8266_WiFi_Module_Quick_Start_Guide_v_1.0.4.pdf │ ├── Embedded_Bluetooth_Serial_Communication_Module.pdf │ ├── GPS_NMEA Reference Manual-Rev2.1-Dec07.pdf │ ├── GPS_SKM53_Datasheet.pdf │ ├── GSM_SIM900_AT Command Manual_V1.03.pdf │ ├── GSM_fastrack_m1306b.pdf │ ├── GSM_gsm822w.pdf │ ├── HC-SR04Users_Manual.pdf │ ├── HC-SR04_Ultrasonic_Module_User_Guide[1].pdf │ ├── KIT_Features_and_Pin_Connections.pdf │ ├── RTC_DS1307.pdf │ ├── ReadMe.txt │ ├── nRF24L01P_Product_Specification_1_0.pdf │ └── nRF_Guide.pdf ├── MCAL ├── EF_ADC.c ├── EF_ADC.h ├── EF_DIO.c ├── EF_DIO.h ├── EF_EEPROM.c ├── EF_EEPROM.h ├── EF_I2C.c ├── EF_I2C.h ├── EF_InputCapture.c ├── EF_InputCapture.h ├── EF_PWM.c ├── EF_PWM.h ├── EF_PWM_cfg.h ├── EF_SPI.c ├── EF_SPI.h ├── EF_SPI_cfg.h ├── EF_SpechialTIMER.c ├── EF_SpechialTIMER.h ├── EF_SpechialTIMER_cfg.h ├── EF_Timer.c ├── EF_Timer.h ├── EF_Timer_cfg.h ├── EF_UART.c ├── EF_UART.h └── EF_UART_cfg.h ├── Readme.txt ├── Release ├── HAL │ ├── EF_7Segment.d │ ├── EF_7Segment.o │ ├── EF_Bluetooth.d │ ├── EF_DS1307.d │ ├── EF_DS1307.o │ ├── EF_E2PROM_24C16.d │ ├── EF_E2PROM_24C16.o │ ├── EF_ESP8266.d │ ├── EF_Keypad.d │ ├── EF_Keypad.o │ ├── EF_LCD.d │ ├── EF_LCD.o │ ├── EF_SkyLabGPS.d │ ├── EF_SkyLabGPS.o │ ├── EF_UltraSonic.d │ ├── EF_UltraSonic.o │ ├── EF_Wavecom.d │ ├── EF_Wavecom.o │ ├── EF_nRF2401.d │ └── subdir.mk ├── MCAL │ ├── EF_ADC.d │ ├── EF_ADC.o │ ├── EF_DIO.d │ ├── EF_DIO.o │ ├── EF_EEPROM.d │ ├── EF_EEPROM.o │ ├── EF_I2C.d │ ├── EF_I2C.o │ ├── EF_InputCapture.d │ ├── EF_InputCapture.o │ ├── EF_PWM.d │ ├── EF_PWM.o │ ├── EF_SPI.d │ ├── EF_SPI.o │ ├── EF_SpechialTIMER.d │ ├── EF_SpechialTIMER.o │ ├── EF_Timer.d │ ├── EF_Timer.o │ ├── EF_UART.d │ ├── EF_UART.o │ └── subdir.mk ├── RedKitDrivers.eep ├── RedKitDrivers.elf ├── RedKitDrivers.hex ├── RedKitDrivers.lss ├── RedKitDrivers.map ├── main.d ├── main.o ├── makefile ├── objects.mk ├── sources.mk └── subdir.mk ├── ServiceLayer └── std_types.h └── main.c /.cproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Object files 2 | *.o 3 | *.ko 4 | *.obj 5 | *.elf 6 | 7 | # Precompiled Headers 8 | *.gch 9 | *.pch 10 | 11 | # Libraries 12 | *.lib 13 | *.a 14 | *.la 15 | *.lo 16 | 17 | # Shared objects (inc. Windows DLLs) 18 | *.dll 19 | *.so 20 | *.so.* 21 | *.dylib 22 | 23 | # Executables 24 | *.exe 25 | *.out 26 | *.app 27 | *.i*86 28 | *.x86_64 29 | *.hex 30 | 31 | # Debug files 32 | *.dSYM/ 33 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | RedKitDrivers 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 25 | de.innot.avreclipse.core.avrnature 26 | 27 | 28 | -------------------------------------------------------------------------------- /.settings/de.innot.avreclipse.core.prefs: -------------------------------------------------------------------------------- 1 | avrtarget/ClockFrequency=8000000 2 | avrtarget/ExtRAMSize=0 3 | avrtarget/ExtendedRAM=false 4 | avrtarget/MCUType=atmega32 5 | avrtarget/UseEEPROM=false 6 | avrtarget/UseExtendedRAMforHeap=true 7 | avrtarget/avrdude/BitBangDelay= 8 | avrtarget/avrdude/Bitclock= 9 | avrtarget/avrdude/EEPROMFile= 10 | avrtarget/avrdude/EEPROMFromConfig=true 11 | avrtarget/avrdude/FlashFile= 12 | avrtarget/avrdude/FlashFromConfig=true 13 | avrtarget/avrdude/NoChipErase=false 14 | avrtarget/avrdude/NoSigCheck=false 15 | avrtarget/avrdude/NoVerify=false 16 | avrtarget/avrdude/NoWrite=false 17 | avrtarget/avrdude/OtherOptions= 18 | avrtarget/avrdude/ProgrammerID=programmerconfig.10 19 | avrtarget/avrdude/UseCounter=false 20 | avrtarget/avrdude/WriteEEPROM=false 21 | avrtarget/avrdude/WriteFlash=true 22 | avrtarget/perConfig=false 23 | eclipse.preferences.version=1 24 | -------------------------------------------------------------------------------- /GuideLines_to_Learn_Git.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/GuideLines_to_Learn_Git.pdf -------------------------------------------------------------------------------- /HAL/Documentations/Bluetooth_Documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/HAL/Documentations/Bluetooth_Documentation.pdf -------------------------------------------------------------------------------- /HAL/Documentations/ESP8266_Documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/HAL/Documentations/ESP8266_Documentation.pdf -------------------------------------------------------------------------------- /HAL/Documentations/SkyLabGPS_Documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/HAL/Documentations/SkyLabGPS_Documentation.pdf -------------------------------------------------------------------------------- /HAL/Documentations/UltraSonic_design_document.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/HAL/Documentations/UltraSonic_design_document.pdf -------------------------------------------------------------------------------- /HAL/Documentations/nRF2401+_Documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/HAL/Documentations/nRF2401+_Documentation.pdf -------------------------------------------------------------------------------- /HAL/Documentations/wavecom_Documentation.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/HAL/Documentations/wavecom_Documentation.pdf -------------------------------------------------------------------------------- /HAL/EF_7Segment.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_7Segment.c 3 | * 4 | * Description: This simple driver for 7-Segment 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #include "EF_7Segment.h" 29 | 30 | #include 31 | #include "../MCAL/EF_DIO.h" 32 | #include 33 | 34 | 35 | /********************************************************************* 36 | * Function : void Segment_Init (void); 37 | * 38 | * DESCRIPTION : This function used to Initialize 7-Segment 39 | * 40 | * PARAMETERS : void 41 | * 42 | * 43 | * Return Value: Void 44 | ***********************************************************************/ 45 | void EF_void_Segment_Init (void) 46 | { 47 | /* TODO : don't use this function as it effects on all pins */ 48 | 49 | /* used 4 bit for data instead of 7 */ 50 | EF_S8_DIO_InitPort (SEGMENT_DATA_PORT , 0x0F); 51 | /* used 4 bit for control the four 7Segemnts */ 52 | EF_S8_DIO_InitPort (SEGMENT_CONTROL_PORT, 0xF0); 53 | } 54 | 55 | 56 | /********************************************************************* 57 | * Function : Segment_Display(U8_t SegmentNumber); 58 | * 59 | * DESCRIPTION : This function used to display 7-Segment 60 | * 61 | * PARAMETERS : U8_t SegmentNumber : Number in range 0 to 9999 62 | * 63 | * 64 | * Return Value: Void 65 | ***********************************************************************/ 66 | void EF_void_Segment_Display(U16_t SegmentNumber) 67 | { 68 | U8_t UnitsDigit = 0; 69 | U8_t TensDigit = 0; 70 | U8_t hundreds = 0; 71 | U8_t Thousands = 0; 72 | U16_t temp; 73 | 74 | /* there are 4 7Segments used as: 75 | * [Thousands|hundreds|TensDigit|UnitsDigit] */ 76 | Thousands = (SegmentNumber / 1000); 77 | temp = (SegmentNumber % 1000); 78 | hundreds = (U8_t)(temp / 100); 79 | temp = (temp % 100); 80 | TensDigit = (U8_t)(temp / 10); 81 | UnitsDigit = (U8_t)(temp % 10); 82 | 83 | /* 7segemnts here are common cathode, to turn on any segment make it High 84 | * to economize using pins ,multiplexing is used by control pin to each 85 | * 7segment and BCD to 7Segment decoder is used to save 3 pins 86 | * So All used pins : 4 for Data and 4 for Multiplexing Control 87 | * * */ 88 | if(SegmentNumber >= 1000) 89 | { 90 | EF_S8_DIO_ClearPin (SEGMENT_CONTROL_PORT , FOURTH_SEGMENT_ENABLE); 91 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , THIRD_SEGMENT_ENABLE); 92 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , FIRST_SEGMENT_ENABLE); 93 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , SECOND_SEGMENT_ENABLE); 94 | 95 | EF_S8_DIO_WritePort(SEGMENT_DATA_PORT , Thousands); 96 | _delay_ms (5); 97 | } 98 | if(SegmentNumber >= 100) 99 | { 100 | EF_S8_DIO_ClearPin (SEGMENT_CONTROL_PORT , THIRD_SEGMENT_ENABLE); 101 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , FOURTH_SEGMENT_ENABLE); 102 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , FIRST_SEGMENT_ENABLE); 103 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , SECOND_SEGMENT_ENABLE); 104 | 105 | EF_S8_DIO_WritePort(SEGMENT_DATA_PORT , hundreds); 106 | _delay_ms (5); 107 | } 108 | if(SegmentNumber >= 10) 109 | { 110 | EF_S8_DIO_ClearPin (SEGMENT_CONTROL_PORT , SECOND_SEGMENT_ENABLE); 111 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , FIRST_SEGMENT_ENABLE); 112 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , FOURTH_SEGMENT_ENABLE); 113 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , THIRD_SEGMENT_ENABLE); 114 | 115 | EF_S8_DIO_WritePort(SEGMENT_DATA_PORT , TensDigit); 116 | _delay_ms (5); 117 | } 118 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , SECOND_SEGMENT_ENABLE); 119 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , THIRD_SEGMENT_ENABLE); 120 | EF_S8_DIO_SetPin (SEGMENT_CONTROL_PORT , FOURTH_SEGMENT_ENABLE); 121 | EF_S8_DIO_ClearPin (SEGMENT_CONTROL_PORT , FIRST_SEGMENT_ENABLE); 122 | 123 | EF_S8_DIO_WritePort(SEGMENT_DATA_PORT , UnitsDigit); 124 | _delay_ms (5); 125 | 126 | } 127 | -------------------------------------------------------------------------------- /HAL/EF_7Segment.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_7Segment.h 3 | * 4 | * Description: This simple driver for 7-Segment 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef _EF_7SEGMENT_H_ 29 | #define _EF_7SEGMENT_H_ 30 | 31 | #include "../ServiceLayer/std_types.h" 32 | 33 | /************************************************************* 34 | * Global Definitions 35 | **************************************************************/ 36 | #define SEGMENT_DATA_PORT 'B' 37 | 38 | #define SEGMENT_CONTROL_PORT 'C' 39 | #define FIRST_SEGMENT_ENABLE 4 40 | #define SECOND_SEGMENT_ENABLE 5 41 | #define THIRD_SEGMENT_ENABLE 6 42 | #define FOURTH_SEGMENT_ENABLE 7 43 | 44 | //#define MAX_DISPLAYED_NUMBER 9999 45 | 46 | /************************************************************* 47 | * API Functions 48 | **************************************************************/ 49 | 50 | /********************************************************************* 51 | * Function : void Segment_Init (void); 52 | * 53 | * DESCRIPTION : This function used to Initialize 7-Segment 54 | * 55 | * PARAMETERS : void 56 | * 57 | * 58 | * Return Value: Void 59 | ***********************************************************************/ 60 | void EF_void_Segment_Init (void); 61 | 62 | /********************************************************************* 63 | * Function : Segment_Display(U8_t SegmentNumber); 64 | * 65 | * DESCRIPTION : This function used to display 7-Segment 66 | * 67 | * PARAMETERS : U8_t SegmentNumber : Number in range 0 to 9999 68 | * 69 | * Return Value: Void 70 | ***********************************************************************/ 71 | void EF_void_Segment_Display(U16_t SegmentNumber); 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /HAL/EF_Bluetooth.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_Bluetooth.h 3 | * 4 | * Description: Bluetooth wifi driver 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef _EF_Bluetooth_H_ 28 | #define _EF_Bluetooth_H_ 29 | 30 | #include "../ServiceLayer/std_types.h" 31 | #include "EF_Bluetooth_cfg.h" 32 | #include "EF_LCD.h" 33 | 34 | /* ------------------------- API Functions ----------------------*/ 35 | 36 | /********************************************************************* 37 | * Function : EF_BOOLEAN_Bluetooth_ModuleInit ( BOOLEAN bMaster, U8_t* Password , 38 | * U8_t* ModuleName , U8_t ModuleName_Length); 39 | * 40 | * DESCRIPTION : This function used to initialise UART, Enable AT Command Pin (make it 3.3v to at command 41 | * and 0 for Communication Mode) , Timer and Send some Init Commands 42 | * 43 | * PARAMETERS : bMaster : 1 to make Bluetooth Module to master and 0 to be slave 44 | * Password : Set Bluetooth Module Password (4 Number characters (ASCII) like: "1234" ) 45 | * ModuleName: Set Bluetooth Module Name 46 | * 47 | * Return Value: BOOLEAN to check for Errors 48 | **********************************************************************/ 49 | BOOLEAN EF_BOOLEAN_Bluetooth_ModuleInit ( BOOLEAN bMaster, U8_t* Password , U8_t* ModuleName , U8_t ModuleName_Length); 50 | 51 | /********************************************************************* 52 | * Function : EF_BOOLEAN_Bluetooth_MasterScan (U8_t ScanDevicesNumber , 53 | * U8_t TimeOut, U8_t* ReturnedAddresses ); 54 | * 55 | * DESCRIPTION : This function used to query/search for the nearby discoverable devices, print and 56 | * return the MAC Add. which is found. 57 | * 58 | * PARAMETERS : ScanDevicesNumber: max number of devices to stop searching when reaching it. 59 | * TimeOut : max time to stop searching when reaching it. 60 | * ReturnedAddresses: MAC Add. of existing devices, (you should give it pointer to 61 | * Large array Like 50 character) 62 | * 63 | * Return Value: BOOLEAN to check for Errors 64 | **********************************************************************/ 65 | BOOLEAN EF_BOOLEAN_Bluetooth_MasterScan (U8_t ScanDevicesNumber , U8_t TimeOut, U8_t* ReturnedAddresses ); 66 | 67 | /********************************************************************* 68 | * Function : EF_BOOLEAN_Bluetooth_MasterConnect (U8_t SlaveMAC_Add , 69 | * U8_t TimeOut, 70 | * U8_t* ReturnSlaveName ); 71 | * 72 | * DESCRIPTION : This function used to pair , connect to definied slave device with 73 | * it's MAC ADD , print and return Slave Device name. 74 | * 75 | * PARAMETERS : SlaveMAC_Add : 14 characters (12 of them is the MAC ADD of the wanted Slave 76 | * device. give it as : 4char,2char,6char == "1CAF,05,D69CE9" ) 77 | * TimeOut : max time to enable Slave to enter Password and pairing 78 | * ReturnSlaveName: return Slave Device name. 79 | * 80 | * Return Value: BOOLEAN to check for Errors 81 | **********************************************************************/ 82 | BOOLEAN EF_BOOLEAN_Bluetooth_MasterConnect (U8_t * SlaveMAC_Add, U8_t TimeOut, U8_t* ReturnSlaveName ); 83 | 84 | /********************************************************************* 85 | * Function : EF_BOOLEAN_Bluetooth_DisConnect (); 86 | * 87 | * DESCRIPTION : This function used to disconnect Connection whether Module was Master or Slave 88 | * 89 | * PARAMETERS : None. 90 | * 91 | * Return Value: BOOLEAN to check for Errors 92 | **********************************************************************/ 93 | BOOLEAN EF_BOOLEAN_Bluetooth_DisConnect (); 94 | 95 | /********************************************************************* 96 | * Function : EF_BOOLEAN_Bluetooth_GetModuleStatus ( U8_t* Status ); 97 | * 98 | * DESCRIPTION : This function used to print and return the Module Status 99 | * returned +STATE:\r\nOK\r\n , are 9 status 100 | * 101 | * PARAMETERS : Status: pointer to the returned status 102 | * 103 | * Return Value: return 1 if INITIALIZED : Slave or Master after power up 104 | * return 2 if READY 105 | * return 3 if PAIRABLE : Slave after AT+INIT 106 | * return 4 if PAIRED : Master after pairing or binding 107 | * return 5 if INQUIRING : Master after quering 108 | * return 6 if CONNECTING : Master after pairing when Communication Enable (0 v to pin) 109 | * return 7 if CONNECTED : Slave or Master after linking 110 | * return 8 if DISCONNECTED: Master or Slave 111 | * return 9 if UNKNOWN 112 | * return 0 if error 113 | **********************************************************************/ 114 | U8_t EF_u8_Bluetooth_GetModuleStatus ( U8_t* Status ); 115 | 116 | 117 | /********************************************************************* 118 | * Function : EF_BOOLEAN_Bluetooth_SendData (U8_t* Data, U8_t DataLength ); 119 | * 120 | * DESCRIPTION : This function used to send data 121 | * 122 | * PARAMETERS : Data : pointer to send data 123 | * DataLength : number of characters 124 | * 125 | * Return Value: return FALSE if the status is not connected 126 | * return TRUE if ok 127 | **********************************************************************/ 128 | BOOLEAN EF_BOOLEAN_Bluetooth_SendData (U8_t* Data, U8_t DataLength ); 129 | 130 | /********************************************************************* 131 | * Function : EF_BOOLEAN_Bluetooth_GetDataIfExist ( U8_t* RxData_ptr ); 132 | * 133 | * DESCRIPTION : This function used to receive data if exist 134 | * 135 | * PARAMETERS : RxData_ptr: pointer to returned data. 136 | * 137 | * Return Value: return FALSE if the status is not connected 138 | * return TRUE if ok 139 | **********************************************************************/ 140 | BOOLEAN EF_BOOLEAN_Bluetooth_GetDataIfExist ( U8_t* RxData_ptr ); 141 | 142 | 143 | 144 | #endif 145 | -------------------------------------------------------------------------------- /HAL/EF_Bluetooth_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_ESP8266_cfg.h 3 | * 4 | * Description: ESP8266 wifi driver 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef _EF_BLUETOOTH_CFG_H_ 28 | #define _EF_BLUETOOTH_CFG_H_ 29 | 30 | /* ------------------------- Definitions ----------------------*/ 31 | /* connect pin 34 in module to 3.3v to Enable all AT Command 32 | * if Connection is Success , then connect it to zero to Communication mode */ 33 | #define BLUETOOTH_UART_NUMBER UART7 34 | #define ENABLE_AT_COMMAND_PORT 'f' 35 | #define ENABLE_AT_COMMAND_PIN 3 36 | 37 | #define MAX_DIGIT_FOR_ITOA 4 /* to define the max. number of Digit using in itoa function, until now using in SMS read and BaudRate */ 38 | #define SIZE_OF_RETURNED_ARRAY 100 /* Max size of returned Array (RX UART Buffer) */ 39 | #define CONNECTED_STATUS 7 40 | 41 | #define MASTER_MODE 1 42 | #define SLAVE_MODE 0 43 | 44 | 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /HAL/EF_DS1307.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_DS1307.h 3 | * 4 | * Description: This simple driver for RTC DS1307 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef EF_DS1307_H_ 29 | #define EF_DS1307_H_ 30 | 31 | 32 | #include 33 | #include 34 | #include "../MCAL/EF_I2C.h" 35 | #include "../ServiceLayer/std_types.h" 36 | 37 | /************************************************************** 38 | * Definitions 39 | **************************************************************/ 40 | /* Below values are fixed and should not be changed. 41 | Refer Ds1307 DataSheet for more info*/ 42 | 43 | #define DS1307_ID 0xD0 /* DS1307 ID */ 44 | #define SEC_ADDRESS 0x00 /* Address to access Ds1307 SEC register */ 45 | #define DATE_ADDRESS 0x04 /* Address to access Ds1307 DATE register */ 46 | #define CONTROL 0x07 /* Address to access Ds1307 CONTROL register */ 47 | 48 | 49 | /********************************************************************* 50 | * Function : void EF_void_DS1307_Init(void); 51 | * 52 | * DESCRIPTION : This function is used to initialize the Ds1307 RTC. 53 | * 54 | * PARAMETERS : Void 55 | * 56 | * Return Value: Void 57 | * 58 | * Notes: 59 | ***********************************************************************/ 60 | extern void EF_void_DS1307_Init(void); 61 | 62 | /********************************************************************* 63 | * Function : void EF_void_DS1307_SetTime(U8_t hh, U8_t mm, U8_t ss); 64 | * 65 | * DESCRIPTION : This function is used to set Time(hh,mm,ss) into the Ds1307 RTC. 66 | * 67 | * PARAMETERS : U8_t hh : hour 68 | * U8_t mm : minutes 69 | * U8_t ss : second 70 | * 71 | * Return Value: Void 72 | ***********************************************************************/ 73 | extern void EF_void_DS1307_SetTime(U8_t hh, U8_t mm, U8_t ss); 74 | 75 | 76 | /********************************************************************* 77 | * Function : void EF_void_DS1307_SetDate(U8_t dd, U8_t mm, U8_t yy); 78 | * 79 | * DESCRIPTION : This function is used to set Date(dd,mm,yy) into the Ds1307 RTC. 80 | * 81 | * PARAMETERS : U8_t dd : day 82 | * U8_t mm : month 83 | * U8_t yy : year 84 | * 85 | * Return Value: Void 86 | * 87 | * Notes: 88 | ***********************************************************************/ 89 | extern void EF_void_DS1307_SetDate(U8_t dd, U8_t mm, U8_t yy); 90 | 91 | /********************************************************************************* 92 | * Function : void EF_void_DS1307_GetTime(U8_t *h_ptr,U8_t *m_ptr,U8_t *s_ptr); 93 | * 94 | * DESCRIPTION : This function is used to get the Time(hh,mm,ss) from Ds1307 RTC. 95 | * 96 | * PARAMETERS : U8_t *h_ptr: pointer to returned hour 97 | * U8_t *m_ptr: pointer to returned minute 98 | * U8_t *s_ptr: pointer to returned seconds 99 | * 100 | * Return Value: Void 101 | * 102 | * Notes: 103 | *********************************************************************************/ 104 | extern void EF_void_DS1307_GetTime(U8_t *h_ptr,U8_t *m_ptr,U8_t *s_ptr); 105 | 106 | 107 | /********************************************************************* 108 | * Function : void EF_void_DS1307_GetDate(U8_t *d_ptr,U8_t *m_ptr,U8_t *y_ptr); 109 | * 110 | * DESCRIPTION : This function is used to get the Date(y,m,d) from Ds1307 RTC. 111 | * 112 | * PARAMETERS : U8_t *d_ptr: pointer to returned day 113 | * U8_t *m_ptr: pointer to returned month 114 | * U8_t *y_ptr: pointer to returned year 115 | * 116 | * Return Value: Void 117 | * 118 | * Notes: 119 | ***********************************************************************/ 120 | extern void EF_void_DS1307_GetDate(U8_t *d_ptr,U8_t *m_ptr,U8_t *y_ptr); 121 | 122 | #endif /* EF_DS1307_H_ */ 123 | -------------------------------------------------------------------------------- /HAL/EF_E2PROM_24C16.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_E2PROM_24C16.c 3 | * 4 | * Description: This simple driver for E2PROM_24C16 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #include "EF_E2PROM_24C16.h" 29 | 30 | /********************************************************************* 31 | * Function : EF_void_EEPROM24C16_Init 32 | * 33 | * DESCRIPTION : This function used to initalize the I2C Module 34 | * 35 | * PARAMETERS : None 36 | * 37 | * Return Value: Void 38 | ***********************************************************************/ 39 | void EF_void_EEPROM24C16_Init () 40 | { 41 | EF_void_I2C_Init(); 42 | } 43 | /********************************************************************* 44 | * Function : void EF_void_EEPROM24C16_Write_Byte (U8_t memory_location, 45 | * U8_t slave_address, 46 | * U8_t data); 47 | * 48 | * DESCRIPTION : This function used to Write One byte 49 | * 50 | * PARAMETERS : U8_t memory_location, 51 | * U8_t slave_address, 52 | * U8_t data 53 | * 54 | * Return Value: Void 55 | * 56 | * Notes: 57 | * slave address: [1|A2|A1|A0|B2|B1|B0|R/W'] 58 | * A : represent the Device Add., set them as the pin connection except A1 59 | * (the A1 bit must be the compliment of the A1 input pin signal) 60 | * B : represent the block address, select one of the eight 256 x 8 memory block 61 | * R/W': put 0 when writing and put 1 when reading 62 | ***********************************************************************/ 63 | void EF_void_EEPROM24C16_Write_Byte (U8_t memory_location, U8_t slave_address, U8_t data) 64 | { 65 | EF_void_I2C_Start(); /* Send Start Bit */ 66 | EF_void_I2C_Write(slave_address); /* Send Slave address with Operation Write */ 67 | EF_void_I2C_Write(memory_location); /* Send Memory Location Address */ 68 | EF_void_I2C_Write(data); /* Send Data One byte */ 69 | EF_void_I2C_Stop(); 70 | _delay_ms(15); 71 | } 72 | 73 | /********************************************************************* 74 | * Function : void EF_void_EEPROM24C16_Read_Byte (U8_t memory_location, 75 | * U8_t slave_address); 76 | * 77 | * DESCRIPTION : This function used to Write One byte 78 | * 79 | * PARAMETERS : U8_t memory_location: 80 | * U8_t slave_address: 81 | * 82 | * Return Value: Void 83 | * 84 | * Notes: 85 | * slave address: [1|A2|A1|A0|B2|B1|B0|R/W'] 86 | * A : represent the Device Add., set them as the pin connection except A1 87 | * (the A1 bit must be the compliment of the A1 input pin signal) 88 | * B : represent the block address, select one of the eight 256 x 8 memory block 89 | * R/W': put 0 when writing and put 1 when reading 90 | ***********************************************************************/ 91 | U8_t EF_void_EEPROM24C16_Read_Byte (U8_t memory_location, U8_t slave_address) 92 | { 93 | U8_t data; 94 | 95 | 96 | EF_void_I2C_Start(); /* Send Start Bit */ 97 | EF_void_I2C_Write(slave_address); /* Send Slave address with Operation Write */ 98 | EF_void_I2C_Write(memory_location); /* Send Memory Location Address */ 99 | 100 | EF_void_I2C_Start(); /* Send Restart Bit */ 101 | EF_void_I2C_Write(slave_address | 1); /* Send Slave address with Operation read */ 102 | data = EF_U8_I2C_Read_Byte(TRUE); 103 | EF_void_I2C_Stop(); 104 | 105 | return data; 106 | } 107 | -------------------------------------------------------------------------------- /HAL/EF_E2PROM_24C16.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_E2PROM_24C16.h 3 | * 4 | * Description: This simple driver for E2PROM_24C16 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef E2PROM_24C16_H_ 28 | #define E2PROM_24C16_H_ 29 | 30 | #include 31 | #include 32 | #include "../MCAL/EF_DIO.h" 33 | #include "../MCAL/EF_I2C.h" 34 | #include "../ServiceLayer/std_types.h" 35 | 36 | /********************************************************************* 37 | * Function : EF_void_EEPROM24C16_Init 38 | * 39 | * DESCRIPTION : This function used to initalize the I2C Module 40 | * 41 | * PARAMETERS : None 42 | * 43 | * Return Value: Void 44 | ***********************************************************************/ 45 | extern void EF_void_EEPROM24C16_Init (); 46 | 47 | 48 | /********************************************************************* 49 | * Function : void EF_void_EEPROM24C16_Write_Byte (U8_t memory_location, 50 | * U8_t slave_address, 51 | * U8_t data); 52 | * 53 | * DESCRIPTION : This function used to Write One byte 54 | * 55 | * PARAMETERS : U8_t memory_location, 56 | * U8_t slave_address, 57 | * U8_t data 58 | * 59 | * Return Value: Void 60 | * 61 | * Notes: 62 | * slave address: [1|A2|A1|A0|B2|B1|B0|R/W'] 63 | * A : represent the Device Add., set them as the pin connection except A1 64 | * (the A1 bit must be the compliment of the A1 input pin signal) 65 | * B : represent the block address, select one of the eight 256 x 8 memory block 66 | * R/W': put 0 when writing and put 1 when reading 67 | ***********************************************************************/ 68 | void EF_void_EEPROM24C16_Write_Byte (U8_t memory_location, U8_t slave_address, U8_t data); 69 | 70 | /********************************************************************* 71 | * Function : void EF_void_EEPROM_Read_Byte (U8_t memory_location, 72 | * U8_t slave_address); 73 | * 74 | * DESCRIPTION : This function used to Write One byte 75 | * 76 | * PARAMETERS : U8_t memory_location: 77 | * U8_t slave_address: 78 | * 79 | * Return Value: Void 80 | * 81 | * Notes: 82 | * slave address: [1|A2|A1|A0|B2|B1|B0|R/W'] 83 | * A : represent the Device Add., set them as the pin connection except A1 84 | * (the A1 bit must be the compliment of the A1 input pin signal) 85 | * B : represent the block address, select one of the eight 256 x 8 memory block 86 | * R/W': put 0 when writing and put 1 when reading 87 | ***********************************************************************/ 88 | U8_t EF_void_EEPROM24C16_Read_Byte (U8_t memory_location, U8_t slave_address); 89 | 90 | #endif /* E2PROM_24C16_H_ */ 91 | -------------------------------------------------------------------------------- /HAL/EF_ESP8266.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_ESP8266.h 3 | * 4 | * Description: ESP8266 wifi driver 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef _EF_ESP8266_H_ 28 | #define _EF_ESP8266_H_ 29 | 30 | #include "../ServiceLayer/std_types.h" 31 | #include "EF_LCD.h" 32 | #include "EF_ESP8266_cfg.h" 33 | 34 | 35 | /* ------------------------- API Functions ----------------------*/ 36 | 37 | /********************************************************************* 38 | * Function : EF_BOOLEAN_ESP8266_InitModule (void); 39 | * 40 | * DESCRIPTION : This function used to initialise ESP8266 Wifi, init UART 41 | * and Timer , Send some Init Commands 42 | * 43 | * PARAMETERS : none. 44 | * 45 | * Return Value: BOOLEAN to check for Errors 46 | **********************************************************************/ 47 | BOOLEAN EF_BOOLEAN_ESP8266_InitModule (void); 48 | 49 | 50 | /********************************************************************* 51 | * Function : EF_BOOLEAN_ESP8266_JoinAP 52 | * 53 | * DESCRIPTION : This function used to connect to Given Access Point 54 | * 55 | * PARAMETERS : AcessPoint: pointer to Acess Point name 56 | * AcessPoint_Length: length of AcessPoint array 57 | * Password: pointer to Password array 58 | * Password_Length: password array length 59 | * 60 | * Return Value: return TRUE if ok or FALSE if not Expected Answer 61 | **********************************************************************/ 62 | BOOLEAN EF_BOOLEAN_ESP8266_JoinAP (U8_t* AcessPoint, U8_t AcessPoint_Length, U8_t* Password, U8_t Password_Length); 63 | 64 | 65 | /********************************************************************* 66 | * Function : EF_void_ESP8266_SetIp 67 | * 68 | * DESCRIPTION : This function used to Set Ip for Wifi Module 69 | * 70 | * PARAMETERS : IP_ptr: pointer to IP 71 | * IP_Length: IP Length 72 | * 73 | * Return Value: BOOLEAN to check for Errors 74 | **********************************************************************/ 75 | BOOLEAN EF_BOOLEAN_ESP8266_SetIp (U8_t* IP_ptr, U8_t IP_Length); 76 | 77 | 78 | /********************************************************************* 79 | * Function : EF_BOOLEAN_ESP8266_OpenServer 80 | * 81 | * DESCRIPTION : This function used to make Wifi Module Opening Server 82 | * 83 | * PARAMETERS : none. 84 | * 85 | * Return Value: BOOLEAN to check for Errors 86 | **********************************************************************/ 87 | BOOLEAN EF_BOOLEAN_ESP8266_OpenServer (void ); 88 | 89 | /********************************************************************* 90 | * Function : EF_BOOLEAN_ESP8266_CreateAcessPoint 91 | * 92 | * DESCRIPTION : This function used to Set Ip for Wifi Module 93 | * 94 | * PARAMETERS : AP_ptr : pointer to AP name which is wanted to create 95 | * AP_Length : AP Length 96 | * 97 | * Return Value: BOOLEAN to check for Errors 98 | **********************************************************************/ 99 | BOOLEAN EF_BOOLEAN_ESP8266_CreateAcessPoint (U8_t* AP_ptr, U8_t AP_Length); 100 | 101 | /********************************************************************* 102 | * Function : EF_BOOLEAN_ESP8266_SendToServer 103 | * 104 | * DESCRIPTION : Send data to Server , (to Server Ip), and if errors repeat all 105 | * steps for number of attemps = MAX_ATTEMPS 106 | * 107 | * PARAMETERS : IP_ptr : Tx IP 108 | * IP_Length : length of Ip array 109 | * Data_ptr : pointer to Data wanted to send 110 | * DataLength : Data Length 111 | * 112 | * Return Value: BOOLEAN to check for Errors 113 | **********************************************************************/ 114 | BOOLEAN EF_BOOLEAN_ESP8266_SendToServer (U8_t* IP_ptr, U8_t IP_Length, U8_t* Data_ptr, U8_t DataLength ); 115 | 116 | 117 | /********************************************************************* 118 | * Function : EF_BOOLEAN_ESP8266_GetRxData 119 | * 120 | * DESCRIPTION : This function used to parcing to get the rx Data 121 | * and to print any data and to reinit if reset 122 | * 123 | * PARAMETERS : UartBase 124 | * RxData_ptr: pointer to received data 125 | * 126 | * Return Value: 0 if byte is not received 127 | * 1 if normal byte received 128 | * 2 if data completed 129 | * 3 if hardware reset occured 130 | **********************************************************************/ 131 | BOOLEAN EF_BOOLEAN_ESP8266_GetRxData (U32_t UartBase , U8_t* RxData_ptr); 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /HAL/EF_ESP8266_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_ESP8266_cfg.h 3 | * 4 | * Description: ESP8266 wifi driver 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef _EF_ESP8266_CFG_H_ 28 | #define _EF_ESP8266_CFG_H_ 29 | 30 | /* ------------------------- Definitions ----------------------*/ 31 | #define ESP8266_UART_NUMBER UART5 32 | #define ESP8266_UART_BASE UART5_BASE 33 | 34 | #define USING_ISR 0 /* Put 0 to work without ISR and put 1 if using ISR */ 35 | 36 | #define MAX_CMD_SIZE 35 /* to define the size of CommandArray */ 37 | #define MAX_PACKET_SIZE 200 /* to define the max size of Array RX Packet Buffer */ 38 | #define MAX_DIGIT_FOR_ITOA 4 /* to define the max. number of Digit using in itoa function, until now using in SMS read and BaudRate */ 39 | #define MAX_DIGITS_Of_MOBILE_NUMBER 11 /* using in check mobile number function */ 40 | #define MAX_ATTEMPS 3 /* using in send data function to repeat steps until reaching this number if error occured */ 41 | #define SIZE_OF_RETURNED_ARRAY 100 /* Max size of returned Array (RX UART Buffer) */ 42 | #define FIRST_DATA_ELEMENT 9 43 | 44 | 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /HAL/EF_KeyPad.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_KeyPad.h 3 | * 4 | * Description: This simple driver for Keypad 3X3 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef _EF_KEYPAD_H_ 29 | #define _EF_KEYPAD_H_ 30 | #include "../ServiceLayer/std_types.h" 31 | 32 | 33 | 34 | /********************************************************************* 35 | * Function : void EF_void_KeyPad_Init (void); 36 | * 37 | * DESCRIPTION : This function used to Initialize keypad 38 | * 39 | * PARAMETERS : Void. 40 | * 41 | * 42 | * Return Value: Void. 43 | ***********************************************************************/ 44 | void EF_void_KeyPad_Init (void); 45 | 46 | /********************************************************************* 47 | * Function : U8_t EF_u8_KeyPad_Scan (void); 48 | * 49 | * DESCRIPTION : This function used to scan the input if it existed 50 | * 51 | * PARAMETERS : void 52 | * 53 | * 54 | * Return Value: U8_t : Return number from (1 to 9) if user press any 55 | key or 0 if user not press. 56 | ***********************************************************************/ 57 | 58 | U8_t EF_u8_KeyPad_Scan (void); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /HAL/EF_Keypad.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_KeyPad.c 3 | * 4 | * Description: This simple driver for keypad 3X3 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #include "EF_KeyPad.h" 28 | #include "../MCAL/EF_DIO.h" 29 | 30 | /************************************************************* 31 | * Global Definitions 32 | **************************************************************/ 33 | 34 | #define KEYBAD_PORT 'A' 35 | #define FIRST_ROW_PIN 4 36 | #define SECOND_ROW_PIN 3 37 | #define THIRD_ROW_PIN 2 38 | #define FIRST_COLUMN_PIN 7 39 | #define SECOND_COLUMN_PIN 6 40 | #define THIRD_COLUMN_PIN 5 41 | #define ENTER_KEY 2 42 | 43 | /************************************************************* 44 | * API Functions 45 | **************************************************************/ 46 | /********************************************************************* 47 | * Function : void EF_void_KeyPad_Init (void); 48 | * 49 | * DESCRIPTION : This function used to Initialize keypad 50 | * 51 | * PARAMETERS : Void. 52 | * 53 | * 54 | * Return Value: Void. 55 | ***********************************************************************/ 56 | void EF_void_KeyPad_Init (void) 57 | { 58 | /* make 3 pins output (COLOUMNS) and anther 3 inputs (ROWS) with pull-up 59 | * normally, input is high. */ 60 | /* TODO : don't use this function as it effects on all pins */ 61 | EF_S8_DIO_InitPort (KEYBAD_PORT, 0xE0); /* Init Port A "Keypad"*/ 62 | EF_S8_DIO_SetPin (KEYBAD_PORT, FIRST_ROW_PIN); /* Enable Internal PullUp Resistor */ 63 | EF_S8_DIO_SetPin (KEYBAD_PORT, SECOND_ROW_PIN); 64 | EF_S8_DIO_SetPin (KEYBAD_PORT, THIRD_ROW_PIN); 65 | } 66 | /********************************************************************* 67 | * Function : U8_t EF_u8_KeyPad_Scan (void); 68 | * 69 | * DESCRIPTION : This function used to scan the input if it existed 70 | * 71 | * PARAMETERS : void 72 | * 73 | * 74 | * Return Value: U8_t : Return number from (1 to 9) if user press any 75 | key or 0 if user not press. 76 | ***********************************************************************/ 77 | U8_t EF_u8_KeyPad_Scan (void) 78 | { 79 | U8_t KeyPressed = 0; 80 | /* when SW is pressed , it will be a short circuit between input and output, 81 | * so input will be low. So Scanning with making output low , will tell 82 | * the Scan function which SW is pressed. keypad mapping : 83 | * [1|2|3] 84 | * [4|5|6] 85 | * [7|8|9] 86 | * */ 87 | /* Scan First Column */ 88 | EF_S8_DIO_ClearPin(KEYBAD_PORT, FIRST_COLUMN_PIN); 89 | EF_S8_DIO_SetPin (KEYBAD_PORT, SECOND_COLUMN_PIN); 90 | EF_S8_DIO_SetPin (KEYBAD_PORT, THIRD_COLUMN_PIN); 91 | 92 | if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, FIRST_ROW_PIN))) 93 | { 94 | KeyPressed = 1; 95 | } 96 | else if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, SECOND_ROW_PIN))) 97 | { 98 | KeyPressed = 4; 99 | } 100 | else if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, THIRD_ROW_PIN))) 101 | { 102 | KeyPressed = 7; 103 | } 104 | /* Scan Second Column */ 105 | 106 | EF_S8_DIO_ClearPin(KEYBAD_PORT, SECOND_COLUMN_PIN); 107 | EF_S8_DIO_SetPin (KEYBAD_PORT, FIRST_COLUMN_PIN); 108 | EF_S8_DIO_SetPin (KEYBAD_PORT, THIRD_COLUMN_PIN); 109 | 110 | if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, FIRST_ROW_PIN))) 111 | { 112 | KeyPressed = 2; 113 | } 114 | else if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, SECOND_ROW_PIN))) 115 | { 116 | KeyPressed = 5; 117 | } 118 | else if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, THIRD_ROW_PIN))) 119 | { 120 | KeyPressed = 8; 121 | } 122 | 123 | /* Scan Third Column */ 124 | 125 | EF_S8_DIO_ClearPin(KEYBAD_PORT, THIRD_COLUMN_PIN); 126 | EF_S8_DIO_SetPin (KEYBAD_PORT, FIRST_COLUMN_PIN); 127 | EF_S8_DIO_SetPin (KEYBAD_PORT, SECOND_COLUMN_PIN); 128 | 129 | if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, FIRST_ROW_PIN))) 130 | { 131 | KeyPressed = 3; 132 | } 133 | else if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, SECOND_ROW_PIN))) 134 | { 135 | KeyPressed = 6; 136 | } 137 | else if(!(EF_S8_DIO_CheckPin(KEYBAD_PORT, THIRD_ROW_PIN))) 138 | { 139 | KeyPressed = 9; 140 | } 141 | return (KeyPressed); 142 | } 143 | 144 | 145 | 146 | -------------------------------------------------------------------------------- /HAL/EF_LCD.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_LCD.h 3 | * 4 | * Description: This simple driver for LCD 2X16 4bit mode 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | /************************************************************** 28 | * Notes: This driver can use with 4 bit mode only. 29 | * 30 | **************************************************************/ 31 | 32 | #ifndef EF_LCD_H_ 33 | #define EF_LCD_H_ 34 | 35 | //#define F_CPU 8000000UL 36 | #include "../ServiceLayer/std_types.h" 37 | 38 | /********************************************************************* 39 | * Function : void initLCD(void); 40 | * 41 | * DESCRIPTION : This function used to Initialize LCD Ports and send 42 | * suitable default CMD before start display. 43 | * 44 | * PARAMETERS : Void. 45 | * 46 | * Return Value: Void. 47 | ***********************************************************************/ 48 | void EF_void_LCD_init(); 49 | 50 | 51 | /********************************************************************* 52 | * Function : void EF_EF_void_LCD_send_command(U8_t cmnd); 53 | * 54 | * DESCRIPTION : This function used to send CMD to LCD like move or control 55 | * display mode. 56 | * 57 | * PARAMETERS : U8_t cmnd: Command User want to send. 58 | * 59 | * Return Value: Void. 60 | ***********************************************************************/ 61 | void EF_void_LCD_send_command(U8_t cmnd); 62 | 63 | 64 | /********************************************************************* 65 | * Function : void EF_void_LCD_send_data(U8_t data); 66 | * 67 | * DESCRIPTION : This function used to send data to LCD . 68 | * 69 | * PARAMETERS : U8_t Data: Data User want to send. 70 | * 71 | * Return Value: Void. 72 | ***********************************************************************/ 73 | void EF_void_LCD_send_data(U8_t data); 74 | 75 | 76 | /*********************************************************************** 77 | * Function : void EF_void_LCD_goto(U8_t y, U8_t x); 78 | * 79 | * DESCRIPTION : This function moves the cursor the line (row) y and 80 | * (column) x on the LCD module. 81 | * 82 | * PARAMETERS : U8_t y: 1 for first row, 2: for the second row 83 | * U8_t x: from 1 to 16 (represents columns) 84 | * 85 | * Return Value: Void. 86 | ***********************************************************************/ 87 | void EF_void_LCD_goto(U8_t y, U8_t x); 88 | 89 | /*********************************************************************** 90 | * Function : void EF_void_LCD_print(U8_t *string); 91 | * 92 | * DESCRIPTION : This function used to display String which user 93 | * wants to display . 94 | * 95 | * PARAMETERS : U8_t *string: String User want to send. 96 | * 97 | * Return Value: Void. 98 | ***********************************************************************/ 99 | void EF_void_LCD_print(unsigned char *string); 100 | 101 | /*********************************************************************** 102 | * Function : void EF_void_LCD_print_ByLength 103 | * 104 | * DESCRIPTION : This function used to display String which user 105 | * wants to display . 106 | * 107 | * PARAMETERS : U8_t *string: String User want to send. 108 | * U8_t length: number of characters to be displayed 109 | * 110 | * Return Value: Void. 111 | ***********************************************************************/ 112 | void EF_void_LCD_print_ByLength(unsigned char *string, U8_t length); 113 | 114 | 115 | /*********************************************************************** 116 | * Function : EF_void_LCD_Clear_Screen(void); 117 | * 118 | * DESCRIPTION : This function used to clear the LCD screen 119 | * 120 | * PARAMETERS : Void. 121 | * 122 | * Return Value: Void. 123 | ***********************************************************************/ 124 | void EF_void_LCD_Clear_Screen(void); 125 | 126 | /*********************************************************************** 127 | * Function : EF_void_LCD_print_NUM(S16_t s16Numberstring,U8_t u8ColNumber); 128 | * 129 | * DESCRIPTION : This function used to convert integer number to ASCII 130 | * then print it in LCD 131 | * 132 | * PARAMETERS : s16Numberstring: integer number wanted to be displayed in LCD 133 | * u8RowNumber : to define which row to display , 134 | * take 1 for first row, 2: for the second row 135 | * 136 | * Return Value: Void. 137 | ***********************************************************************/ 138 | void EF_void_LCD_print_NUM(S16_t s16Numberstring,U8_t u8RowNumber); 139 | 140 | 141 | /*********************************************************************** 142 | * Function :EF_void_uploadCustomChar(U8_t location, unsigned char *character); 143 | * 144 | * DESCRIPTION : This function used to upload a custom char which user wants to map 145 | * it using CGRAM (Character Generator Ram Address set). 146 | * 147 | * PARAMETERS : location : to define which CGRAM ADD offset. It takes from (0 to 7). 148 | * character: pointer to 8 pointer to char as CGRAM needs 8 char to map 149 | * 150 | * Return Value: Void. 151 | ***********************************************************************/ 152 | void EF_void_uploadCustomChar(U8_t location, unsigned char *character); 153 | 154 | /*********************************************************************** 155 | * Function : EF_void_LCD_HextoASCII(U8_t *hex); 156 | * 157 | * DESCRIPTION : This function used to convert hex to ASCII, then display it 158 | * 159 | * PARAMETERS : hex: pointer to hex (one byte) 160 | * 161 | * Return Value: Void. 162 | ***********************************************************************/ 163 | void EF_void_LCD_HextoASCII(U8_t *hex); 164 | 165 | #endif /* EF_LCD_H_ */ 166 | -------------------------------------------------------------------------------- /HAL/EF_SkyLabGPS.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_SkyLabGPS.h 3 | * 4 | * Description: Simple driver for SkyLab GPs module 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef _SKYLAB__ 28 | #define _SKYLAB__ 29 | 30 | #include "../ServiceLayer/std_types.h" 31 | /************************************************** 32 | * Definitions 33 | *************************************************/ 34 | /* return value from EF_B_SkyLabGPS_GetPosition function */ 35 | enum 36 | { 37 | DATA_NOT_VAILD, 38 | DATA_VAILD 39 | 40 | }ReturnFromGetPosition; 41 | 42 | /********************************************************************* 43 | * API Functions 44 | *********************************************************************/ 45 | /********************************************************************* 46 | * Function : EF_B_SkyLabGPS_Init() 47 | * 48 | * DESCRIPTION : initialise the uart and LCD/UartUtilts 49 | * 50 | * PARAMETERS : None 51 | * 52 | * Return Value: BOOLEAN to check for Errors 53 | **********************************************************************/ 54 | BOOLEAN EF_B_SkyLabGPS_Init(); 55 | 56 | /********************************************************************* 57 | * Function : EF_B_SkyLabGPS_GetPosition( double* D_LatitudePtr, double* D_LongitudePtr) 58 | * 59 | * DESCRIPTION : receive the frames which is sent by GPS module every 1sec, 60 | * and parse it to get the latitude and longitude after converting 61 | * them to double if data is valid 62 | * 63 | * PARAMETERS : D_LatitudePtr : pointer to return the latitude "double" in it 64 | * D_LongitudePtr : pointer to return the longitude "double" in it 65 | * 66 | * Return Value: returns DATA_NOT_VAILD or DATA_VAILD 67 | **********************************************************************/ 68 | BOOLEAN EF_B_SkyLabGPS_GetPosition( double* D_LatitudePtr, double* D_LongitudePtr); 69 | 70 | /********************************************************************* 71 | * Function : EF_B_SkyLabGPS_PrintPosition( double D_Latitude, double D_longitude) 72 | * 73 | * DESCRIPTION : display the latitude and longitude in LCD/UART_Utilts 74 | * 75 | * PARAMETERS : D_Latitude : latitude in double 76 | * D_longitude : longitude in double 77 | * 78 | * Return Value: BOOLEAN to check for Errors 79 | **********************************************************************/ 80 | BOOLEAN EF_B_SkyLabGPS_PrintPosition( double D_Latitude, double D_Longitude); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /HAL/EF_UltraSonic.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_UltraSonic.c 3 | * 4 | * Description: Simple driver for UltraSonic Sensor 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | /************************************************** 28 | * include files 29 | *************************************************/ 30 | #include 31 | #include 32 | #include 33 | #include "EF_UltraSonic.h" 34 | #include "../MCAL/EF_TIMER.h" 35 | #include "EF_LCD.h" 36 | #include "../ServiceLayer/std_types.h" 37 | #include 38 | #include 39 | #include "../MCAL/EF_DIO.h" 40 | /************************************************** 41 | * Define 42 | *************************************************/ 43 | #define F_CPU 8000000UL 44 | /* Trigger */ 45 | #define TRIGGER_PORT 'b' 46 | #define TRIGGER_PIN 0 /* starts from 0 to 7 */ 47 | /* Echo */ 48 | #if INTERRUPT_BASED == 0 49 | #define ECHO_PORT 'd' 50 | #define ECHO_PIN 3 /* starts from 0 to 7 */ 51 | #define ECHO (EF_S8_DIO_CheckPin(ECHO_PORT,ECHO_PIN )) 52 | #endif 53 | /* Led */ 54 | #define LED_PORT 'd' 55 | #define LED_PIN 7 56 | /************************************************** 57 | * global Variables 58 | *************************************************/ 59 | /* time of one timer clock cycle */ 60 | const float ClockCycleTime_uS = TIMER_PRESCALE/(F_CPU/1000000); //prescaler/freq .. (uS) 61 | /* Stores the NumOfTimerTicks length */ 62 | U16_t NumOfTimerTicks = 0; 63 | /* convert Timer ticks to time */ 64 | U16_t PulseTime_uS = 0; 65 | /* get the final distance_cm */ 66 | U16_t PulseDistance_Cm = 0; 67 | char string1[5] = {0}; 68 | 69 | /************************************************************************ 70 | ********************** Global API Functions **************************** 71 | ************************************************************************/ 72 | 73 | /********************************************************************* 74 | * Function : void EF_UltraSonic_Init(); 75 | * 76 | * DESCRIPTION : This function used to Initialise UltraSonic Sensor: 77 | * -Timer Initialise 78 | * -LCD Initialise 79 | * -Trigger Initialise 80 | * -Echo Initialise 81 | * -Test led Initialise 82 | * 83 | * PARAMETERS : None 84 | * 85 | * Return Value: None 86 | ***********************************************************************/ 87 | void EF_UltraSonic_Init() 88 | { 89 | /* Timer Initialise*/ 90 | EF_void_Timer_PORTinit(); 91 | 92 | EF_void_LCD_init(); 93 | 94 | /* Trigger Initialise */ 95 | EF_B_DIO_InitPin (TRIGGER_PORT, TRIGGER_PIN ,OUTPUT); 96 | EF_S8_DIO_ClearPin(TRIGGER_PORT, TRIGGER_PIN); 97 | 98 | /* Echo Initialise */ 99 | #if INTERRUPT_BASED == 1 100 | GICR |= (1< 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef _ULTRASONIC__ 28 | #define _ULTRASONIC__ 29 | 30 | 31 | /************************************************** 32 | * include files 33 | *************************************************/ 34 | #include "../ServiceLayer/std_types.h" 35 | 36 | /************************************************** 37 | * Define 38 | *************************************************/ 39 | /* 40 | * to define the way of getting the Echo time by polling or Interrupt 41 | * if Interrupt put INTERRUPT_BASED equals 1 42 | * * */ 43 | #define INTERRUPT_BASED 1 44 | 45 | /********************************************************************* 46 | * Function : void EF_UltraSonic_Init(); 47 | * 48 | * DESCRIPTION : This function used to Initialise UltraSonic Sensor: 49 | * -Timer Initialise 50 | * -LCD Initialise 51 | * -Trigger Initialise 52 | * -Echo Initialise 53 | * -Test led Initialise 54 | * 55 | * PARAMETERS : None 56 | * 57 | * Return Value: None 58 | ***********************************************************************/ 59 | void EF_UltraSonic_Init(void); 60 | 61 | /************************************************************************** 62 | * Function : U16_t EF_UltraSonic_GetDistance (); 63 | * 64 | * DESCRIPTION : This function used to trigger the sensor then get the distance between UltraSonic Sensor 65 | * and any barrier front of this Sensor 66 | * 67 | * PARAMETERS : Void. 68 | * 69 | * Return Value: Distance_cm from any barrier front of UltraSonic Sensor 70 | * if Interrupt based return 1 and ISR will calculate it and print in LCD 71 | ***************************************************************************/ 72 | U16_t EF_UltraSonic_GetDistance (void); 73 | 74 | #endif 75 | -------------------------------------------------------------------------------- /HAL/EF_Wavecom.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_Wavecom.h 3 | * 4 | * Description: This simple driver for Wavecom Fastrack M1306B (GSM module) 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef _WAVE_COM_ 29 | #define _WAVE_COM_ 30 | 31 | #include 32 | #include "../MCAL/EF_UART.h" 33 | #include "../ServiceLayer/std_types.h" 34 | #include "EF_LCD.h" 35 | #include 36 | 37 | /************************************************** 38 | * Define 39 | *************************************************/ 40 | #define ENABLE 1 41 | #define DISABLE 0 42 | #define ERROR 0 43 | #define MAX_SMS_SIZE 50 /* to define the size of Array which will include the Read SMS */ 44 | 45 | /************************************************** 46 | * configuration types 47 | *************************************************/ 48 | 49 | 50 | typedef struct 51 | { 52 | /* Enable New Message Indication, SMS-DELIVERs are directly stored, 53 | * SMS-STATUS- REPORTs are displayed*/ 54 | BOOLEAN NewMessageIndication; 55 | BOOLEAN SetModeParameters; /* Set text mode parameters ,SMS-SUBMIT message with a validity period (one day)*/ 56 | BOOLEAN TextFormat; /* Set SMS text format to be ASCII ,not PDU format*/ 57 | }Wavecom_Sms_cfg_str; 58 | 59 | 60 | typedef struct 61 | { 62 | /*Enable the extended format of incoming call indication 63 | present: CRING: Voice() ,except RING only */ 64 | BOOLEAN ExtendedFormat; 65 | /*Enable the incoming calling line identification presentation. 66 | to display the Mobile number of the incoming call */ 67 | BOOLEAN IncomingNumberIndication; 68 | }Wavecom_Call_cfg_str; 69 | 70 | 71 | /* argument: "Wavecom_ReadSms_cfg_str.ReadListType" should equal one of these Enums*/ 72 | typedef enum 73 | { All_list, 74 | REC_READ, //received read Messages 75 | REC_UNREAD, 76 | STORED_SENT, 77 | STORED_UNSENT 78 | }TenumReadListSms; 79 | 80 | 81 | typedef struct 82 | { 83 | BOOLEAN b_ListType; /* define what you want to read 1 Message or List of Messages */ 84 | U8_t ReadListType; /* if list type,to define type, should be equalled one of ReadListSmsEnum*/ 85 | U8_t* NumberOfMessags; /* if list type, return max number of Messages */ 86 | U8_t MessageNumber; /* if not list type , put integer number of the SMS which you want to read*/ 87 | U8_t* RxData_ptr; /* if not list type , used to return SMS data*/ 88 | }Wavecom_ReadSms_cfg_str; 89 | 90 | 91 | /********************************************************************* 92 | * API Functions 93 | *********************************************************************/ 94 | 95 | /********************************************************************* 96 | * Function : EF_BOOLEAN_Wavecom_InitModule (void); 97 | * 98 | * DESCRIPTION : This function used to initialise GSM Module: 99 | * disable Echo, 100 | * Enable General Indication, 101 | * Enable General Error Indication, 102 | no flow control, 103 | * check for PIN code ready, 104 | * check if the module is ready to receive or not, 105 | * check the network registration. 106 | * 107 | * PARAMETERS : none. 108 | * 109 | * Return Value: BOOLEAN to check for Errors 110 | **********************************************************************/ 111 | BOOLEAN EF_BOOLEAN_Wavecom_InitModule (void); 112 | 113 | /********************************************************************* 114 | * Function : EF_BOOLEAN_Wavecom_InitSms (Wavecom_Sms_cfg_str* Wavecom_Sms_cfg_ptr); 115 | * 116 | * DESCRIPTION : This function used to set the SMS Indication Commands 117 | * 118 | * PARAMETERS : Wavecom_Sms_cfg_ptr is a pointer to Wavecom_Sms_cfg_str to 119 | * configure the SMS Indication CMDs 120 | * 121 | * Return Value: BOOLEAN to check for Errors 122 | **********************************************************************/ 123 | BOOLEAN EF_BOOLEAN_Wavecom_InitSms (Wavecom_Sms_cfg_str* Wavecom_Sms_cfg_ptr); 124 | 125 | /********************************************************************* 126 | * Function : EF_BOOLEAN_Wavecom_SendSms (U8_t* MobileNumber_ptr, U8_t NumberLength, 127 | * U8_t* SendData_ptr, U16_t DataLength); 128 | * 129 | * DESCRIPTION : This function used to Send SMS 130 | * 131 | * PARAMETERS : U8_t* MobileNumber_ptr: pointer to Mobile Number in "ASCII" 132 | * U8_t NumberLength : has the length of Mobile Number 133 | * U8_t* SendData_ptr : pointer to the data which you want to send as SMS 134 | * U8_t DataLength : length of the data which you want to send as SMS 135 | * 136 | * Return Value: BOOLEAN to check for Errors 137 | **********************************************************************/ 138 | BOOLEAN EF_BOOLEAN_Wavecom_SendSms (U8_t* MobileNumber_ptr, U8_t NumberLength, U8_t* SendData_ptr, U16_t DataLength); 139 | 140 | /********************************************************************* 141 | * Function : EF_S16_Wavecom_ReadSms (Wavecom_ReadSms_cfg_str* Wavecom_ReadSms_cfg_ptr); 142 | * 143 | * DESCRIPTION : This function used to Read SMS 144 | * 145 | * PARAMETERS : Wavecom_ReadSms_cfg_ptr is pointer to Wavecom_ReadSms_cfg_str 146 | * to define what types of SMS which you want to read 147 | * 148 | * 149 | * Return Value: -1 : Error 150 | * 0 : SMS is not found 151 | * : SMS length 152 | **********************************************************************/ 153 | S16_t EF_S16_Wavecom_ReadSms (Wavecom_ReadSms_cfg_str* Wavecom_ReadSms_cfg_ptr); 154 | 155 | /********************************************************************* 156 | * Function : EF_BOOLEAN_Wavecom_InitCall (Wavecom_Call_cfg_str* Wavecom_Call_cfg_ptr); 157 | * 158 | * DESCRIPTION : This function used to configure the indication for incoming Call 159 | * 160 | * PARAMETERS : Wavecom_Call_cfg_ptr is pointer to Wavecom_Call_cfg_str to 161 | * define which indication is wanted to be enabled 162 | * 163 | * 164 | * Return Value: BOOLEAN to check for Errors 165 | **********************************************************************/ 166 | BOOLEAN EF_BOOLEAN_Wavecom_InitCall (Wavecom_Call_cfg_str* Wavecom_Call_cfg_ptr); 167 | 168 | /********************************************************************* 169 | * Function : EF_BOOLEAN_Wavecom_Call (U8_t* MobileNumber_ptr ,U8_t NumberLength) 170 | * 171 | * DESCRIPTION : This function used to check number then call 172 | * 173 | * PARAMETERS : U8_t* MobileNumber_ptr: pointer to Mobile Number in "ASCII" 174 | * U8_t NumberLength : has the length of Mobile Number 175 | * 176 | * 177 | * Return Value: -1: Communication error 178 | * 0: MobileNumber is wrong 179 | * 1: OK 180 | **********************************************************************/ 181 | S8_t EF_BOOLEAN_Wavecom_Call (U8_t* MobileNumber_ptr ,U8_t NumberLength); 182 | 183 | /********************************************************************* 184 | * Function : EF_BOOLEAN_Wavecom_CallAnswer (void); 185 | * 186 | * DESCRIPTION : This function used to answer to the incoming call. 187 | * 188 | * PARAMETERS : none. 189 | * 190 | * Return Value: BOOLEAN to check for Errors 191 | **********************************************************************/ 192 | BOOLEAN EF_BOOLEAN_Wavecom_CallAnswer (void); 193 | 194 | /********************************************************************* 195 | * Function : EF_BOOLEAN_Wavecom_CallRelease (void); 196 | * 197 | * DESCRIPTION : This function used to end the call. 198 | * 199 | * PARAMETERS : none. 200 | * 201 | * Return Value: BOOLEAN to check for Errors 202 | **********************************************************************/ 203 | BOOLEAN EF_BOOLEAN_Wavecom_CallRelease (void); 204 | 205 | #endif 206 | 207 | -------------------------------------------------------------------------------- /HAL/EF_nRF2401.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/HAL/EF_nRF2401.c -------------------------------------------------------------------------------- /HAL/EF_nRF2401.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_nRF2401.h 3 | * 4 | * Description: Simple driver for nRF2401+ module 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 28/7/2015 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2015> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef _EF_NRF2401_ 28 | #define _EF_NRF2401_ 29 | #include "../ServiceLayer/std_types.h" 30 | 31 | /********************************************************************* 32 | * Function : EF_void_nRF_init() 33 | * 34 | * DESCRIPTION : initialise the SPI ,External Interrupt and nRF module 35 | * 36 | * PARAMETERS : None 37 | * 38 | * Return Value: None 39 | **********************************************************************/ 40 | extern void EF_void_nRF_init(); 41 | 42 | /********************************************************************* 43 | * Function : EF_void_nRF_TXSetup() 44 | * 45 | * DESCRIPTION : establish the module to transmit 46 | * 47 | * PARAMETERS : None 48 | * 49 | * Return Value: None 50 | **********************************************************************/ 51 | extern void EF_void_nRF_TXSetup(void); 52 | 53 | 54 | /********************************************************************* 55 | * Function : EF_BOOLEAN_nRF_SendData 56 | * 57 | * DESCRIPTION : transmit data by the nRF module 58 | * 59 | * PARAMETERS : U8_t* Data: pointer to transmitted data 60 | * U8_t DataLength: no of bytes of transmitted data 61 | * 62 | * Return Value: BOOLEAN to check for Errors 63 | **********************************************************************/ 64 | extern BOOLEAN EF_BOOLEAN_nRF_SendData(U8_t* Data, U8_t DataLength); 65 | 66 | /********************************************************************* 67 | * Function : EF_BOOLEAN_nRF_RXSetup() 68 | * 69 | * DESCRIPTION : establish the module to receive 70 | * 71 | * PARAMETERS : None 72 | * 73 | * Return Value: None 74 | **********************************************************************/ 75 | extern void EF_BOOLEAN_nRF_RXSetup(void); 76 | 77 | /********************************************************************* 78 | * Function : EF_BOOLEAN_nRF_GetData 79 | * 80 | * DESCRIPTION : receive data by the nRF module 81 | * 82 | * PARAMETERS : U8_t* Data: pointer to received data 83 | * U8_t DataLength: no of bytes of received data 84 | * 85 | * Return Value: BOOLEAN to check for Errors 86 | **********************************************************************/ 87 | extern BOOLEAN EF_BOOLEAN_nRF_GetData(U8_t* Data , U8_t DataLength); 88 | 89 | /********************************************************************* 90 | * Function : EF_u8_nRF_ReadRegister 91 | * 92 | * DESCRIPTION : read specific register located the nRF module 93 | * 94 | * PARAMETERS : U8_t Reg_Add: address of wanted register 95 | * 96 | * Return Value: the data located in this register 97 | **********************************************************************/ 98 | U8_t EF_u8_nRF_ReadRegister(U8_t Reg_Add); 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /HAL/EF_nRF2401_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_nRF2401_cfg.h 3 | * 4 | * Description: Simple driver for nRF2401+ module 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 28/7/2015 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2015> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef _EF_NRF2401_ 29 | #define _EF_NRF2401_ 30 | 31 | /* SPI chip select, to enable the connection to nRF by SPI used LOW_CSN*/ 32 | #define LOW_CSN SPI_PORT &= ~(1< 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #include 29 | #include 30 | #include "../ServiceLayer/std_types.h" 31 | #include "EF_ADC.h" 32 | #include "EF_DIO.h" 33 | /************************************************************* 34 | * Global Definitions 35 | **************************************************************/ 36 | #define ADC_PORT 'a' 37 | #define ADC_DIRECTION 0x00 38 | /* TODO : handle this module to switch between interrupt based or not */ 39 | //volatile static U8_t adcCompleteFlag ; 40 | 41 | /************************************************************* 42 | * API 43 | **************************************************************/ 44 | /********************************************************************* 45 | * Function : EF_u16_ADC_read 46 | * 47 | * DESCRIPTION : this function initializes the timer module with the configuration data 48 | * 49 | * PARAMETERS : None 50 | * 51 | * Return Value: None 52 | ***********************************************************************/ 53 | void EF_void_ADC_init(void) 54 | { 55 | EF_S8_DIO_InitPort (ADC_PORT, ADC_DIRECTION); /* make PORTA input to receive analogue voltage*/ 56 | ADCSRA |= (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0); /* 128 pre-scale for 8Mhz */ 57 | ADCSRA |= (1 << ADEN); /* Enable the ADC */ 58 | 59 | } 60 | 61 | /********************************************************************* 62 | * Function : DIO_WritePort(U8_t PortName, U8_t Value); 63 | * 64 | * DESCRIPTION : this function is used to read ADC value from the o/p 65 | * 66 | * PARAMETERS : ADC_PIN define which Single Ended Input channel, Enter 67 | * number from (0 to 7) 68 | * 69 | * Return Value: ADC value ratio (from 0 to 2^n ) , n: bit resolution 70 | * 71 | * NOTE: to read input voltage value use ( vin =ADC*(vref/2^n)), n: bit resolution 72 | ***********************************************************************/ 73 | U16_t EF_u16_ADC_read(U8_t ADC_PIN) 74 | { 75 | U8_t ADC_LOW; 76 | U8_t ADC_high; 77 | U16_t ADC_value; 78 | ADMUX = ADC_PIN; /* define which ADC channel */ 79 | ADMUX |= (1 << REFS0); /* use AVcc as the reference */ 80 | ADMUX &= ~(1 << ADLAR); /* making ADCH has the MSbit */ 81 | ADCSRA |= (1< 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef _EF_ADC_H_ 28 | #define _EF_ADC_H_ 29 | 30 | #include "../ServiceLayer/std_types.h" 31 | 32 | 33 | 34 | 35 | /********************************************************************* 36 | * Function : EF_u16_ADC_read 37 | * 38 | * DESCRIPTION : this function initializes the timer module with the configuration data 39 | * 40 | * PARAMETERS : None 41 | * 42 | * Return Value: None 43 | ***********************************************************************/ 44 | extern void EF_void_ADC_init(void); 45 | 46 | /********************************************************************* 47 | * Function : DIO_WritePort(U8_t PortName, U8_t Value); 48 | * 49 | * DESCRIPTION : this function is used to read ADC value from the o/p 50 | * 51 | * PARAMETERS : ADC_PIN define which Single Ended Input channel, Enter 52 | * number from (0 to 7) 53 | * 54 | * Return Value: ADC value ratio (from 0 to 2^n ) , n: bit resolution 55 | * 56 | * NOTE: to read input voltage value use ( vin =ADC*(vref/2^n)), n: bit resolution 57 | ***********************************************************************/ 58 | extern U16_t EF_u16_ADC_read(U8_t ADC_PIN); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /MCAL/EF_DIO.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_DIO.h 3 | * 4 | * Description: DIO driver For ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #include "../ServiceLayer/std_types.h" 29 | 30 | /************************************************** 31 | * Define 32 | *************************************************/ 33 | #define INPUT 0 34 | #define OUTPUT 1 35 | 36 | /********************************************************************* 37 | * Function : DIO_InitPort(U8_t PortName, U8_t Value); 38 | * 39 | * DESCRIPTION : This function used to Initialize port. 40 | * 41 | * PARAMETERS : 42 | * 43 | * U8_t PortName: User write which port need to access. 44 | * like 'A' or 'a'. 45 | * U8_t Value : User write the value in range (0 -> 255). 46 | * 47 | * Return Value: The function will return -1 if user enter wrong inputs. 48 | * or return 1 if OK. 49 | * Note : To configure PIN as output you should set the bit mask "1" 50 | * and to set PIN input you should set bit mask "0" 51 | ***********************************************************************/ 52 | S8_t EF_S8_DIO_InitPort (U8_t PortName, U8_t Value); 53 | 54 | /********************************************************************* 55 | * Function : DIO_WritePort(U8_t PortName, U8_t Value); 56 | * 57 | * DESCRIPTION : This function used to write value to any port. 58 | * 59 | * PARAMETERS : 60 | * 61 | * U8_t PortName: User write which port need to access. 62 | * like 'A' or 'a'. 63 | * U8_t Value : User write the value in range (0 -> 255). 64 | * 65 | * Return Value: The function will return -1 if user enter wrong inputs. 66 | * or return 1 if OK. 67 | ***********************************************************************/ 68 | S8_t EF_S8_DIO_WritePort(U8_t PortName, U8_t Value); 69 | 70 | /********************************************************************* 71 | * Function : S16_t DIO_ReadPort (U8_t PortName); 72 | * 73 | * DESCRIPTION : This function used to read value from any port. 74 | * 75 | * PARAMETERS : 76 | * 77 | * U8_t PortName: User write which port need to access. 78 | * like 'A' or 'a'. 79 | * 80 | * Return Value: The function will return -1 if user enter wrong inputs. 81 | * or the value. 82 | ***********************************************************************/ 83 | S16_t EF_S16_DIO_ReadPort (U8_t PortName); 84 | 85 | /********************************************************************* 86 | * Function : EF_B_DIO_InitPin (U8_t PortName, U8_t PinNumber,U8_t Direction) 87 | * 88 | * DESCRIPTION : This function used to Initialize port. 89 | * 90 | * PARAMETERS : 91 | * 92 | * U8_t PortName: User write which port need to access. 93 | * like 'A' or 'a'. 94 | * U8_t PinNumber: Pin Number between 0 and 7 95 | * 96 | * U8_t Direction: Either INPUT or OUTPUT 97 | * 98 | * Return Value: The function will return -1 if user enter wrong inputs. 99 | * or return 1 if OK. 100 | * Note : Nothing 101 | ***********************************************************************/ 102 | BOOLEAN EF_B_DIO_InitPin (U8_t PortName, U8_t PinNumber,U8_t Direction); 103 | 104 | /********************************************************************* 105 | * Function : S8_t DIO_SetPin (U8_t PortName, U8_t PinNumber); 106 | * 107 | * DESCRIPTION : This function used to set pin any port. 108 | * 109 | * PARAMETERS : 110 | * 111 | * U8_t PortName: User write which port need to access. 112 | * like 'A' or 'a'. 113 | * U8_t PinNumber: User write the value in range (0 -> 7). 114 | * 115 | * Return Value: The function will return -1 if user enter wrong inputs. 116 | * or return 1 if OK. 117 | * Note : This function set output PIN. 118 | ***********************************************************************/ 119 | S8_t EF_S8_DIO_SetPin (U8_t PortName, U8_t PinNumber); 120 | 121 | /********************************************************************* 122 | * Function : S8_t DIO_ClearPin (U8_t PortName, U8_t PinNumber); 123 | * 124 | * DESCRIPTION : This function used to clear Pin in port. 125 | * 126 | * PARAMETERS : 127 | * 128 | * U8_t PortName: User write which port need to access. 129 | * like 'A' or 'a'. 130 | * U8_t PinNumber: User write the value in range (0 -> 7). 131 | * 132 | * Return Value: The function will return -1 if user enter wrong inputs. 133 | * or return 1 if OK. 134 | ***********************************************************************/ 135 | S8_t EF_S8_DIO_ClearPin (U8_t PortName, U8_t PinNumber); 136 | 137 | /********************************************************************* 138 | * Function : S8_t DIO_SetPort (U8_t PortName); 139 | * 140 | * DESCRIPTION : This function used to set port. 141 | * 142 | * PARAMETERS : 143 | * 144 | * U8_t PortName: User write which port need to access. 145 | * like 'A' or 'a'. 146 | * U8_t Value : User write the value in range (0 -> 255). 147 | * 148 | * Return Value: The function will return -1 if user enter wrong inputs. 149 | * or return 1 if OK. 150 | ***********************************************************************/ 151 | S8_t EF_S8_DIO_SetPort (U8_t PortName); 152 | 153 | /********************************************************************* 154 | * Function : S8_t DIO_ClearPort(U8_t PortName); 155 | * 156 | * DESCRIPTION : This function used to clear port. 157 | * 158 | * PARAMETERS : 159 | * 160 | * U8_t PortName: User write which port need to access. 161 | * like 'A' or 'a'. 162 | * 163 | * Return Value: The function will return -1 if user enter wrong inputs. 164 | * or return 1 if OK. 165 | ***********************************************************************/ 166 | S8_t EF_S8_DIO_ClearPort(U8_t PortName); 167 | 168 | /********************************************************************* 169 | * Function : S8_t DIO_TogglePin(U8_t PortName, U8_t PinNumber); 170 | * 171 | * DESCRIPTION : This function used to toggle any PIN in any PORT. 172 | * 173 | * PARAMETERS : 174 | * 175 | * U8_t PortName: User write which port need to access. 176 | * like 'A' or 'a'. 177 | * U8_t PinNumber: User write the value in range (0 -> 7). 178 | * 179 | * Return Value: The function will return -1 if user enter wrong inputs. 180 | * or return 1 if OK. 181 | ***********************************************************************/ 182 | S8_t EF_S8_DIO_TogglePin(U8_t PortName, U8_t PinNumber); 183 | 184 | /********************************************************************* 185 | * Function : S8_t DIO_CheckPin (U8_t PortName, U8_t PinNumber); 186 | * 187 | * DESCRIPTION : This function used to Check pin status . 188 | * 189 | * PARAMETERS : 190 | * 191 | * U8_t PortName: User write which port need to access. 192 | * like 'A' or 'a'. 193 | * U8_t PinNumber: User write the value in range (0 -> 7). 194 | * 195 | * Return Value: The function will return -1 if user enter wrong inputs. 196 | * or return 1 if Pin ON and 0 If pin OFF. 197 | ***********************************************************************/ 198 | S8_t EF_S8_DIO_CheckPin (U8_t PortName, U8_t PinNumber); 199 | 200 | -------------------------------------------------------------------------------- /MCAL/EF_EEPROM.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_EEPROM.c 3 | * 4 | * Description: Internal EEPROM (1Kbytes) driver For ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | /************************************************************** 28 | * Notes: This driver can use with EEPROM module only. 29 | * 30 | **************************************************************/ 31 | 32 | #include 33 | #include 34 | #include "EF_EEPROM.h" 35 | 36 | /*The below value should be set depending on the controller 37 | by referring the respective data sheet*/ 38 | #define MAX_EEPROM_SIZE 1024 39 | 40 | 41 | /********************************************************************* 42 | * Function : void EF_void_EEPROM_WriteByte(U16_t eeprom_Address, 43 | * U8_t eeprom_Data); 44 | * DESCRIPTION : This function is used to write the data at specified 45 | * EEPROM_address... 46 | * PARAMETERS : 47 | * U16_t eeprom_Address: Location address for data. 48 | * U8_t eeprom_Data : Data which user need to save. 49 | * 50 | * Return Value: void. 51 | * Note : void. 52 | ***********************************************************************/ 53 | void EF_void_EEPROM_WriteByte(U16_t eeprom_Address, U8_t eeprom_Data) 54 | { 55 | /* Wait for completion of previous write, EEWE will be 56 | cleared by hardware once EEprom write is completed */ 57 | while(EECR & (1< 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef EF_EEPROM_H_ 29 | #define EF_EEPROM_H_ 30 | 31 | #include "../ServiceLayer/std_types.h" 32 | /********************************************************************* 33 | * Function : void EF_void_EEPROM_WriteByte(U16_t eeprom_Address, 34 | * U8_t eeprom_Data); 35 | * DESCRIPTION : This function is used to write the data at specified 36 | * EEPROM_address... 37 | * PARAMETERS : 38 | * U16_t eeprom_Address: Location address for data. 39 | * U8_t eeprom_Data : Data which user need to save. 40 | * 41 | * Return Value: void. 42 | * Note : void. 43 | ***********************************************************************/ 44 | extern void EF_void_EEPROM_WriteByte(U16_t eeprom_Address, U8_t eeprom_Data); 45 | 46 | /********************************************************************* 47 | * Function : void EF_void_EEPROM_WriteNBytes(U16_t EepromAddr, 48 | * U8_t *RamAddr, 49 | * S8_t NoOfBytes); 50 | * DESCRIPTION : This function is used to write N-bytes of data 51 | * at specified EEPROM_address. 52 | * PARAMETERS : 53 | * U16_t eeprom_Address: Location address for data. 54 | * U8_t *RamAddr : 55 | * S8_t NoOfBytes : 56 | * 57 | * Return Value: void. 58 | * Note : void. 59 | ***********************************************************************/ 60 | extern void EF_void_EEPROM_WriteNBytes(U16_t eeprom_Address, U8_t *RamAddr, S8_t NoOfBytes); 61 | 62 | /********************************************************************* 63 | * Function : U8_t EF_EPROM_ReadByte(U16_t eeprom_Address); 64 | * DESCRIPTION : This function is used to read the data from 65 | * specified EEPROM_address. 66 | * PARAMETERS : 67 | * U16_t eeprom_Address: Location address for data. 68 | * 69 | * Return Value: U8_t : Data read from Address. 70 | * Note : void. 71 | ***********************************************************************/ 72 | extern U8_t EF_u8_EPROM_ReadByte(U16_t eeprom_Address); 73 | 74 | /********************************************************************* 75 | * Function : void EEPROM_ReadNBytes(U16_t EepromAddr, 76 | * U8_t *RamAddr, 77 | * S8_t NoOfBytes); 78 | * DESCRIPTION : This function is used to Read N-bytes of data 79 | * from specified EEPROM_address. 80 | * PARAMETERS : 81 | * U16_t eeprom_Address: Location address for data. 82 | * U8_t *RamAddr : 83 | * S8_t NoOfBytes : 84 | * 85 | * Return Value: void. 86 | * Note : void. 87 | ***********************************************************************/ 88 | extern void EF_void_EEPROM_ReadNBytes(U16_t EepromAddr, U8_t *RamAddr, S8_t NoOfBytes); 89 | 90 | /********************************************************************* 91 | * Function : void EEPROM_Erase(void); 92 | * DESCRIPTION : This function is used to erase the entire EEprom memory. 93 | * PARAMETERS : void. 94 | * 95 | * Return Value: void. 96 | * Note : void. 97 | ***********************************************************************/ 98 | extern void EF_void_EEPROM_Erase(void); 99 | 100 | #endif /* EF_EEPROM_H_ */ 101 | -------------------------------------------------------------------------------- /MCAL/EF_I2C.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_I2C.c 3 | * 4 | * Description: I2C driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | 29 | #include "EF_I2C.h" 30 | 31 | 32 | /********************************************************************* 33 | * Function : void EF_void_I2C_Write(U8_t data); 34 | * 35 | * DESCRIPTION : This function used to Write One byte one I2C data bus 36 | * 37 | * PARAMETERS : U8_t data : Data user want to send 38 | * 39 | * Return Value: Void 40 | * 41 | * Notes: 42 | ***********************************************************************/ 43 | void EF_void_I2C_Write(U8_t data) 44 | { 45 | /* put the data in TW data register */ 46 | TWDR = data; 47 | /* to start sending Byte */ 48 | TWCR = (1< 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef EF_I2C_H_ 28 | #define EF_I2C_H_ 29 | 30 | #include 31 | #include "EF_DIO.h" 32 | #include "../ServiceLayer/std_types.h" 33 | 34 | /***************************************************************** 35 | ***************** API's Prototype ******************************* 36 | ******************************************************************/ 37 | 38 | /********************************************************************* 39 | * Function : void EF_void_I2C_Init(void); 40 | * 41 | * DESCRIPTION : This function used to Send Init I2C Module 42 | * 43 | * PARAMETERS : Void 44 | * 45 | * Return Value: Void 46 | * 47 | * Notes: 48 | ***********************************************************************/ 49 | void EF_void_I2C_Init(void); 50 | 51 | /********************************************************************* 52 | * Function : U8_t EF_U8_I2C_Read_Byte (BOOLEAN ACK); 53 | * 54 | * DESCRIPTION : This function used to Read One byte one I2C data bus 55 | * 56 | * PARAMETERS : U8_t data : Data user want to send 57 | * 58 | * Return Value: Void 59 | * 60 | * Notes: 61 | ***********************************************************************/ 62 | U8_t EF_U8_I2C_Read_Byte (BOOLEAN ACK); 63 | /********************************************************************* 64 | * Function : void EF_void_I2C_Start(void); 65 | * 66 | * DESCRIPTION : This function used to Send Start Bit data bus 67 | * 68 | * PARAMETERS : Void 69 | * 70 | * Return Value: Void 71 | * 72 | * Notes: 73 | ***********************************************************************/ 74 | void EF_void_I2C_Start(void); 75 | 76 | /********************************************************************* 77 | * Function : void EF_void_I2C_Stop(void); 78 | * 79 | * DESCRIPTION : This function used to Send Stop Bit data bus 80 | * 81 | * PARAMETERS : Void 82 | * 83 | * Return Value: Void 84 | * 85 | * Notes: 86 | ***********************************************************************/ 87 | void EF_void_I2C_Stop(void); 88 | 89 | /********************************************************************* 90 | * Function : void EF_void_I2C_Write(U8_t data); 91 | * 92 | * DESCRIPTION : This function used to Write One byte one I2C data bus 93 | * 94 | * PARAMETERS : U8_t data : Data user want to send 95 | * 96 | * Return Value: Void 97 | * 98 | * Notes: 99 | ***********************************************************************/ 100 | void EF_void_I2C_Write(U8_t data); 101 | 102 | #endif /* EF_I2C_H_ */ 103 | -------------------------------------------------------------------------------- /MCAL/EF_InputCapture.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_InputCapture.h 3 | * 4 | * Description: Input Capture driver For ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | **************************************************************/ 26 | 27 | #ifndef _EF_INPUTCAPTURE_H_ 28 | #define _EF_INPUTCAPTURE_H_ 29 | /*- INCLUDES ---------------------------------------------------*/ 30 | #include "../ServiceLayer/std_types.h" 31 | 32 | /*- API FUNCTIONS ----------------------------------------------*/ 33 | 34 | /********************************************************************* 35 | * Function : EF_void_InputCapture_Init 36 | * 37 | * DESCRIPTION : this function init the Input Capture using Timer1 38 | * 39 | * PARAMETERS : None 40 | * 41 | * Return Value: None 42 | ***********************************************************************/ 43 | extern void EF_void_InputCapture_Init(void); 44 | 45 | /********************************************************************* 46 | * Function : EF_BOOLEAN_InputCapture_GetPulse 47 | * 48 | * DESCRIPTION : this function is used to Get the pulse of the signal 49 | * which connected to ICP1 pin 50 | * 51 | * PARAMETERS : Pulse_ptr: pointer to the wanted Pulse (No. of CLockCycles) 52 | * TimeOut : time of waiting the pulse. for example for 100 msec 53 | * put 100. TimeOut is Multipliers of 20 ms 54 | * 55 | * Return Value: indicate the status: FAILURE to get pulse or SUCESS 56 | * 57 | * NOTE : 1-returned pulse is number of clock cycles ,to convert it 58 | * to time using Time_pulse = pulse*(1/(F_CPU/prescaler)) 59 | * 2-don't forget to init. Timer 60 | ***********************************************************************/ 61 | extern BOOLEAN EF_BOOLEAN_InputCapture_GetPulse(U16_t* Pulse_ptr, U16_t TimeOut); 62 | 63 | /********************************************************************* 64 | * Function : EF_BOOLEAN_InputCapture_GetPeriod 65 | * 66 | * DESCRIPTION : this function is used to Get the Period of the signal 67 | * which connected to ICP1 pin 68 | * 69 | * PARAMETERS : Pulse_ptr: pointer to the wanted Period (No. of CLockCycles) 70 | * TimeOut : time of waiting the period. for example for 2000 msec 71 | * put 2000. TimeOut is Multipliers of 20 ms 72 | * 73 | * Return Value: indicate the status: FAILURE to get period or SUCESS 74 | * 75 | * * NOTE : 1-returned pulse is number of clock cycles ,to convert it 76 | * to time using Time_pulse = pulse*(1/(F_CPU/prescaler)) 77 | * 2-don't forget to init. Timer 78 | * 79 | ***********************************************************************/ 80 | extern BOOLEAN EF_BOOLEAN_InputCapture_GetPeriod(U16_t* Period_ptr, U16_t TimeOut); 81 | 82 | #endif 83 | -------------------------------------------------------------------------------- /MCAL/EF_PWM.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_PWM.c 3 | * 4 | * Description: PWM driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #include "EF_pwm_cfg.h" 29 | 30 | 31 | /********************************************************************* 32 | * Function : EF_void_PWM_init(U8_t u8TimerNumber); 33 | * 34 | * DESCRIPTION : Initializes the PWM in fast mode. 35 | * 36 | * PARAMETERS : The number of 8 bit timer to set for fast mode pwm. 37 | * Either Timer 0 or Timer 2. 38 | * 39 | * Return Value: Nothing 40 | ***********************************************************************/ 41 | void EF_void_PWM_init(U8_t u8TimerNumber) 42 | { 43 | switch(u8TimerNumber) 44 | { 45 | #ifdef ENABLE_TIMER_2 46 | case TIMER_2: 47 | /* OC2 PIN TO BE OUTPUT */ 48 | TIMER2_DDR |= (1<255 131 | 132 | 133 | PWM_actual_Duty = (DutyCycle * TIMER_MAX_VALUE) / DUTY_CYCLE_MAX_VALUE; 134 | /*Output Compare Register OCRx 135 | * contains an 8-bit value that is continuously compared 136 | * with the counter value (TCNTx). A match can be used to 137 | * generate an output compare interrupt 138 | **/ 139 | switch(u8TimerNumber) 140 | { 141 | 142 | #ifdef ENABLE_TIMER_2 143 | case TIMER_2: 144 | OCR2 = PWM_actual_Duty; 145 | break; 146 | #else 147 | case TIMER_0: 148 | OCR0 = PWM_actual_Duty; 149 | break; 150 | #endif 151 | default: 152 | break; 153 | } 154 | } 155 | 156 | 157 | -------------------------------------------------------------------------------- /MCAL/EF_PWM.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_PWM.h 3 | * 4 | * Description: PWM driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef EF_PWM_H_ 29 | #define EF_PWM_H_ 30 | 31 | #include "EF_pwm_cfg.h" 32 | 33 | /************************************************* 34 | * extern API functions 35 | *************************************************/ 36 | 37 | /********************************************************************* 38 | * Function : EF_void_PWM_init(U8_t u8TimerNumber); 39 | * 40 | * DESCRIPTION : Initializes the PWM in fast mode. 41 | * 42 | * PARAMETERS : The number of 8 bit timer to set for fast mode pwm. 43 | * Either Timer 0 or Timer 2. 44 | * 45 | * Return Value: Nothing 46 | ***********************************************************************/ 47 | extern void EF_void_PWM_init(U8_t u8TimerNumber); 48 | 49 | /**************************************************************************** 50 | * Function : EF_void_PWM_SetDutyValue(U8_t DutyValue, U8_t u8TimerNumber) 51 | * 52 | * DESCRIPTION : Sets duty cycle for the PWM 53 | * 54 | * PARAMETER 1 : The duty cycle value. A value between 0 and 255. 55 | * 56 | * PARAMETER 2 : The number of 8 bit timer. Either Timer 0 or Timer 2. 57 | * 58 | * Return Value: Nothing 59 | ******************************************************************************/ 60 | extern void EF_void_PWM_SetDutyValue(U8_t DutyValue, U8_t u8TimerNumber); 61 | 62 | /**************************************************************************** 63 | * Function : EF_void_PWM_SetDutyCycle(U8_t DutyCycle, U8_t u8TimerNumber) 64 | * 65 | * DESCRIPTION : Sets duty cycle for the PWM 66 | * 67 | * PARAMETER 1 : The duty cycle value. A value between (0 %) and (100 %). 68 | * 69 | * PARAMETER 2 : The number of 8 bit timer. Either Timer 0 or Timer 2. 70 | * 71 | * Return Value: Nothing 72 | ******************************************************************************/ 73 | extern void EF_void_PWM_SetDutyCycle(U8_t DutyCycle, U8_t u8TimerNumber); 74 | 75 | #endif /* PWM_EF_H_ */ 76 | -------------------------------------------------------------------------------- /MCAL/EF_PWM_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_PWM_cfg.h 3 | * 4 | * Description: PWM driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef EF_PWM_CFG_H_ 28 | #define EF_PWM_CFG_H_ 29 | 30 | #include 31 | #include "../ServiceLayer/std_types.h" 32 | 33 | /* TCCR0. (0111 1011) 0x 34 | * Bit 7 FOC0: writing a logical one to the FOC0 bit, an immediate compare match is forced on the Waveform Generation unit. 35 | * Bit 6,3 WGM01:0: 1 1 Fast PWM 36 | * Bit 5:4 COM01:0: 1 1 Set OC0 on compare match, clear OC0 at TOP 37 | * Bit 2:0 CS02:0: Clock Select 0 1 1 clkI/O/64 (From prescaler ) 38 | * */ 39 | #define FAST_PWM (1<<3)|(1<<6) 40 | #define NON_INVERT (1<<5) 41 | #define PRESCLR1_VALUE 0x01 42 | #define PRESCLR8_VALUE 0x02 43 | #define PRESCLR64_VALUE 0x03 44 | #define PRESCLR256_VALUE 0x04 45 | #define PRESCLR1024_VALUE 0x05 46 | #define DISABLE_MODULE_VALUE 0x00 47 | /* Timer DDR */ 48 | #define TIMER0_DDR DDRB 49 | #define TIMER2_DDR DDRD 50 | /* to put in the EF_void_PWM_init function */ 51 | #define TIMER_0 0 52 | #define TIMER_2 2 53 | /* Out compare pin */ 54 | #define OC0_OUTPUT_SETTER 3 55 | #define OC2_OUTPUT_SETTER 7 56 | 57 | #define ZER0_INITIALIZER 0x00 58 | /* Max counts of timer0 is 2^8=255 */ 59 | #define TIMER_MAX_VALUE 255 60 | /* max Percentage Value (100%) */ 61 | #define DUTY_CYCLE_MAX_VALUE 100 62 | 63 | /* #define ENABLE_TIMER_2 */ 64 | 65 | #endif /* EF_PWM_CFG_H_ */ 66 | -------------------------------------------------------------------------------- /MCAL/EF_SPI.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_SPI.c 3 | * 4 | * Description: SPI driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #include "EF_SPI.h" 28 | #include 29 | #include 30 | #include "EF_SPI_cfg.h" 31 | #include "EF_SpechialTIMER.h" 32 | 33 | 34 | /********************************************************************* 35 | * Function : void EF_void_SPI_Init(U8_t DeviceType); 36 | * 37 | * DESCRIPTION : This function used to Initialize SPI Module. 38 | * 39 | * PARAMETERS : U8_t DeviceType : 1 ----> Master 40 | * 0 ----> Slave 41 | * Return Value: void 42 | **********************************************************************/ 43 | void EF_SpiInit(U8_t DeviceType) 44 | { 45 | if(MASTER_TYPE == DeviceType) 46 | { 47 | /* make (MOSI) PB5 & (SCK)PB7 & (SS)PB4 : output */ 48 | SPI_DDR |= (1< 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #include "../ServiceLayer/std_types.h" 28 | 29 | 30 | 31 | /********************************************************************* 32 | * Function : void EF_SpiInit(U8_t DeviceType); 33 | * 34 | * DESCRIPTION : This function used to Initialize SPI Module. 35 | * 36 | * PARAMETERS : U8_t DeviceType : 1 ----> Master 37 | * 0 ----> Slave 38 | * Return Value: void 39 | **********************************************************************/ 40 | void EF_SpiInit(U8_t DeviceType); 41 | 42 | /********************************************************************* 43 | * Function : U8_t EF_SpiTransfer(U8_t data); 44 | * 45 | * DESCRIPTION : This function used to Transfer Data through SPI bus 46 | * 47 | * PARAMETERS : U8_t data Data user need to transmit. 48 | * 49 | * 50 | * Return Value: Data User received 51 | **********************************************************************/ 52 | U8_t EF_SpiTransfer(U8_t data); 53 | 54 | 55 | /********************************************************************* 56 | * Function : U8_t EF_void_SPI_TransferArray(U8_t data); 57 | * 58 | * DESCRIPTION : This function used to Transfer Data array through SPI bus 59 | * 60 | * PARAMETERS : DataOut pointer to Data user need to transmit. 61 | * DataIn pointer to received Data during transmitting 62 | * Data_Length 63 | * 64 | * 65 | * Return Value: Data User received 66 | **********************************************************************/ 67 | void EF_void_SPI_TransferArray(U8_t * DataOut, U8_t * DataIn, U8_t Data_Length); 68 | 69 | 70 | /********************************************************************* 71 | * Function : U8_t EF_BOOLEAN_SpiTransfer(U8_t * returnedValue); 72 | * 73 | * DESCRIPTION : This function used to Transfer Data through SPI bus without Stuck . 74 | * 75 | * PARAMETERS : U8_t data transfered data . 76 | * 77 | * 78 | * Return Value: return True if Byte is received or false 79 | **********************************************************************/ 80 | BOOLEAN EF_BOOLEAN_SpiTransfer(U8_t * returnedValue); 81 | -------------------------------------------------------------------------------- /MCAL/EF_SPI_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_SPI_cfg.h 3 | * 4 | * Description: SPI driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef EF_SPI_CFG_H_ 29 | #define EF_SPI_CFG_H_ 30 | 31 | /************************************************************** 32 | * Definitions 33 | **************************************************************/ 34 | 35 | #define MASTER_TYPE 1 36 | #define SLAVE_TYPE 0 37 | 38 | #define SPI_DDR DDRB 39 | #define SPI_PORT PORTB 40 | #define MISO_BIT 6 41 | #define MOSI_BIT 5 42 | #define SCK_BIT 7 43 | #define SS_BIT 4 44 | 45 | 46 | #define SPI_TRANSMIT 47 | //#define SPI_RECEIVE 48 | 49 | 50 | 51 | #endif /* EF_SPI_CFG_H_ */ 52 | -------------------------------------------------------------------------------- /MCAL/EF_SpechialTIMER.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_SpechialTIMER.c 3 | * 4 | * Description: using Timer driver to make many features with time 5 | * such as delay , make unstuck functions ,.. 6 | * 7 | * History: Version 1.0 - INIT Version 8 | * Date : 25/08/2014 9 | * ------------------------------------------------------- 10 | * Author : EmbeddedFab. 11 | * 12 | * Copyright (C) <2014> 13 | 14 | * This program is free software: you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation, either version 3 of the License, or 17 | * (at your option) any later version. 18 | 19 | * This program is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | 24 | * You should have received a copy of the GNU General Public License 25 | * along with this program. If not, see 26 | 27 | **************************************************************/ 28 | 29 | #include "EF_SpechialTIMER.h" 30 | 31 | /************************************************** 32 | * global variables 33 | *************************************************/ 34 | static TIMER_ID_str timers_list[MAX_NUMBER_OF_TIMERS]; 35 | 36 | /**************************************************************************** 37 | * Function : void_SCHEDULER_timerISRCallback 38 | * 39 | * DESCRIPTION : Function to set the systemTik Flag, "Called in the TIMER ISR" 40 | * 41 | * PARAMETERS : None 42 | * 43 | * Return Value: None 44 | * 45 | * NOTE : "Don't forget putting Timer_ISR function in the startup code" 46 | ******************************************************************************/ 47 | static void EF_void_TimerISRCallback(void) 48 | { 49 | //count the enabled timer and if it reached the timeOut ,counter=0 and set timeOut Flag 50 | EF_void_TimersUpdate(); 51 | } 52 | 53 | /**************************************************************************** 54 | * Function : EF_void_TimerDelete 55 | * 56 | * DESCRIPTION : make all timer_list_parameters = 0 57 | * 58 | * PARAMETERS : timerNumber 59 | * 60 | * Return Value: None 61 | * 62 | ******************************************************************************/ 63 | void EF_void_TimerDelete(U8_t timerNumber) 64 | { 65 | timers_list[timerNumber].counter = 0; 66 | timers_list[timerNumber].timeOut = 0; 67 | timers_list[timerNumber].isTimedout = FALSE; 68 | timers_list[timerNumber].isEnables = FALSE; 69 | } 70 | 71 | /**************************************************************************** 72 | * Function : EF_void_TimerInit 73 | * 74 | * DESCRIPTION : initialize the timer ,define the callback function and 75 | * call void_timerDelete(). 76 | * 77 | * PARAMETERS : None. 78 | * 79 | * Return Value: None. 80 | * 81 | ******************************************************************************/ 82 | void EF_void_TimerInit(void) 83 | { 84 | U16_t timersCounter; 85 | //don't forget put ISR function in startup code 86 | EF_void_Timer_PORTinit(); 87 | // set the timer interrupt callback 88 | EF_void_Timer_SetISRCallBack(EF_void_TimerISRCallback); 89 | // set all Timers to the initial state 90 | for( timersCounter=0 ; timersCounter < MAX_NUMBER_OF_TIMERS ; timersCounter++ ) 91 | { 92 | EF_void_TimerDelete(timersCounter); 93 | } 94 | } 95 | /**************************************************************************** 96 | * Function : EF_void_TimerCreate 97 | * 98 | * DESCRIPTION : set the time out for defined timer. 99 | * 100 | * PARAMETERS : timerNumber : Timer ID 101 | * timerTimeout: depend on Timer clock cycle 102 | * 103 | * Return Value: None. 104 | * 105 | ******************************************************************************/ 106 | void EF_void_TimerCreate(U8_t timerNumber , U16_t timerTimeout) /* Timer timeout in ticks */ 107 | { 108 | if(timers_list[timerNumber].timeOut == 0) 109 | { 110 | timers_list[timerNumber].timeOut = timerTimeout; 111 | timers_list[timerNumber].counter = 0 ; 112 | timers_list[timerNumber].isTimedout = FALSE ; 113 | timers_list[timerNumber].isEnables = FALSE; 114 | } 115 | } 116 | /**************************************************************************** 117 | * Function : EF_void_TimersUpdate 118 | * 119 | * DESCRIPTION : count the enabled timer and if it reached the timeOut ,counter=0 and set timeOut Flag 120 | * this function called in the ISR by call back function. 121 | * 122 | * PARAMETERS : None. 123 | * 124 | * Return Value: None. 125 | * 126 | ******************************************************************************/ 127 | void EF_void_TimersUpdate(void) 128 | { 129 | U16_t timersCounter = 0; 130 | 131 | for( timersCounter = 0 ; timersCounter < MAX_NUMBER_OF_TIMERS ; timersCounter++ ) 132 | { 133 | if(timers_list[timersCounter].isEnables == TRUE) 134 | { 135 | timers_list[timersCounter].counter++ ; 136 | 137 | if(timers_list[timersCounter].counter == timers_list[timersCounter].timeOut) 138 | { 139 | timers_list[timersCounter].counter = 0; 140 | timers_list[timersCounter].isTimedout = TRUE; 141 | } 142 | } 143 | } 144 | } 145 | /**************************************************************************** 146 | * Function : EF_BOOLEAN_TimerCheck 147 | * 148 | * DESCRIPTION : check for time out 149 | * 150 | * PARAMETERS : timerNumber 151 | * 152 | * Return Value: BOOLEAN : return True when timer timeout 153 | * 154 | ******************************************************************************/ 155 | BOOLEAN EF_BOOLEAN_TimerCheck(U8_t timerNumber) 156 | { 157 | BOOLEAN timerTimeout = FALSE; 158 | if(timers_list[timerNumber].isTimedout) 159 | { 160 | timers_list[timerNumber].isTimedout = FALSE; 161 | timerTimeout = TRUE; 162 | } 163 | return timerTimeout; 164 | } 165 | /**************************************************************************** 166 | * Function : EF_void_TimerStart 167 | * 168 | * DESCRIPTION : enable this timer by making isEnables = True 169 | * 170 | * PARAMETERS : timerNumber 171 | * 172 | * Return Value: None. 173 | * 174 | ******************************************************************************/ 175 | void EF_void_TimerStart(U8_t timerNumber) 176 | { 177 | if(timers_list[timerNumber].timeOut != 0) 178 | { 179 | timers_list[timerNumber].isEnables = TRUE; 180 | } 181 | } 182 | /**************************************************************************** 183 | * Function : EF_void_TimerStop 184 | * 185 | * DESCRIPTION : stop this timer by making isEnables = False 186 | * 187 | * PARAMETERS : timerNumber 188 | * 189 | * Return Value: None. 190 | * 191 | ******************************************************************************/ 192 | void EF_void_TimerStop(U8_t timerNumber) 193 | { 194 | timers_list[timerNumber].isEnables = FALSE; 195 | } 196 | /**************************************************************************** 197 | * Function : EF_void_TimerReset 198 | * 199 | * DESCRIPTION : make counter = 0 200 | * 201 | * PARAMETERS : timerNumber 202 | * 203 | * Return Value: None. 204 | * 205 | ******************************************************************************/ 206 | void EF_void_TimerReset(U8_t timerNumber) 207 | { 208 | timers_list[timerNumber].counter = 0; 209 | } 210 | 211 | -------------------------------------------------------------------------------- /MCAL/EF_SpechialTIMER.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_SpechialTIMER.h 3 | * 4 | * Description: using Timer driver to make many features with time 5 | * such as delay , make unstuck functions ,.. 6 | * 7 | * History: Version 1.0 - INIT Version 8 | * Date : 25/08/2014 9 | * ------------------------------------------------------- 10 | * Author : EmbeddedFab. 11 | * 12 | * Copyright (C) <2014> 13 | 14 | * This program is free software: you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation, either version 3 of the License, or 17 | * (at your option) any later version. 18 | 19 | * This program is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | 24 | * You should have received a copy of the GNU General Public License 25 | * along with this program. If not, see 26 | 27 | **************************************************************/ 28 | #ifndef _SPECHIAL_TIMER__ 29 | #define _SPECHIAL_TIMER__ 30 | 31 | #include "EF_SpechialTIMER_cfg.h" 32 | 33 | 34 | /************************************************* 35 | * API functions 36 | *************************************************/ 37 | 38 | /**************************************************************************** 39 | * Function : EF_void_TimerInit 40 | * 41 | * DESCRIPTION : initialize the timer ,define the callback function and 42 | * call void_timerDelete(). 43 | * 44 | * PARAMETERS : None. 45 | * 46 | * Return Value: None. 47 | * 48 | ******************************************************************************/ 49 | extern void EF_void_TimerInit(void); 50 | /**************************************************************************** 51 | * Function : EF_void_TimerCreate 52 | * 53 | * DESCRIPTION : set the time out for defined timer. 54 | * 55 | * PARAMETERS : timerNumber : Timer ID 56 | * timerTimeout: depend on Timer clock cycle 57 | * 58 | * Return Value: None. 59 | * 60 | ******************************************************************************/ 61 | extern void EF_void_TimerCreate(U8_t timerNumber , U16_t timerTimeout); 62 | /**************************************************************************** 63 | * Function : EF_void_TimerDelete 64 | * 65 | * DESCRIPTION : make all timer_list_parameters = 0 66 | * 67 | * PARAMETERS : timerNumber 68 | * 69 | * Return Value: None 70 | * 71 | ******************************************************************************/ 72 | extern void EF_void_TimerDelete(U8_t timerNumber); 73 | /**************************************************************************** 74 | * Function : EF_void_TimersUpdate 75 | * 76 | * DESCRIPTION : count the enabled timer and if it reached the timeOut ,counter=0 and set timeOut Flag 77 | * this function called in the ISR by call back function. 78 | * 79 | * PARAMETERS : None. 80 | * 81 | * Return Value: None. 82 | * 83 | ******************************************************************************/ 84 | extern void EF_void_TimersUpdate(void); 85 | /**************************************************************************** 86 | * Function : EF_BOOLEAN_TimerCheck 87 | * 88 | * DESCRIPTION : check for time out 89 | * 90 | * PARAMETERS : timerNumber 91 | * 92 | * Return Value: BOOLEAN : return True when timer timeout 93 | * 94 | ******************************************************************************/ 95 | extern BOOLEAN EF_BOOLEAN_TimerCheck(U8_t timerNumber); 96 | /**************************************************************************** 97 | * Function : EF_void_TimerStart 98 | * 99 | * DESCRIPTION : enable this timer by making isEnables = True 100 | * 101 | * PARAMETERS : timerNumber 102 | * 103 | * Return Value: None. 104 | * 105 | ******************************************************************************/ 106 | extern void EF_void_TimerStart(U8_t timerNumber); 107 | /**************************************************************************** 108 | * Function : EF_void_TimerStop 109 | * 110 | * DESCRIPTION : stop this timer by making isEnables = False 111 | * 112 | * PARAMETERS : timerNumber 113 | * 114 | * Return Value: None. 115 | * 116 | ******************************************************************************/ 117 | extern void EF_void_TimerStop(U8_t timerNumber); 118 | /**************************************************************************** 119 | * Function : EF_void_TimerReset 120 | * 121 | * DESCRIPTION : make counter = 0 122 | * 123 | * PARAMETERS : timerNumber 124 | * 125 | * Return Value: None. 126 | * 127 | ******************************************************************************/ 128 | void EF_void_TimerReset(U8_t timerNumber); 129 | 130 | #endif 131 | -------------------------------------------------------------------------------- /MCAL/EF_SpechialTIMER_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_SpechialTIMER_cfg.h 3 | * 4 | * Description: using Timer driver to make many features with time 5 | * such as delay , make unstuck functions ,.. 6 | * 7 | * History: Version 1.0 - INIT Version 8 | * Date : 25/08/2014 9 | * ------------------------------------------------------- 10 | * Author : EmbeddedFab. 11 | * 12 | * Copyright (C) <2014> 13 | 14 | * This program is free software: you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation, either version 3 of the License, or 17 | * (at your option) any later version. 18 | 19 | * This program is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | 24 | * You should have received a copy of the GNU General Public License 25 | * along with this program. If not, see 26 | 27 | **************************************************************/ 28 | 29 | #ifndef OS_TIMER_CFG_H_ 30 | #define OS_TIMER_CFG_H_ 31 | 32 | #include "../ServiceLayer/std_types.h" 33 | #include "EF_Timer.h" 34 | /************************************************** 35 | * Definitions 36 | **************************************************/ 37 | #define MAX_NUMBER_OF_TIMERS 10 38 | 39 | /* different IDs*/ 40 | #define THREE_SEC_TIMER_ID 0 41 | #define MILLIS_200_TIMER_ID 1 42 | #define TWO_MIN_TIMER_ID 2 43 | #define ONE_SEC_TIMER_ID 3 44 | #define ESP8266_FIND_KEYWORD_ID 4 45 | #define INPUT_CAPTURE_ID 5 46 | #define UART_TIMER_ID 6 47 | #define SPI_TIMER_ID 7 48 | #define Bluetooth_FIND_KEYWORD_ID 8 49 | 50 | /* using with Special Timer to able SPI Function to be unstuck */ 51 | #define SPI_TIMEOUT 100/SYSTEMTICKTIME 52 | #define UART_WAIT_TIME 100/SYSTEMTICKTIME 53 | /************************************************** 54 | * configuration types 55 | *************************************************/ 56 | 57 | typedef struct timer_struct 58 | { 59 | volatile U16_t timeOut ; /* max. time counts */ 60 | volatile U16_t counter ; /* count every Timer Interrupt happened */ 61 | volatile BOOLEAN isTimedout; /* check if count == timeOut */ 62 | volatile BOOLEAN isEnables; /* check if TimerID is Enable */ 63 | }TIMER_ID_str; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /MCAL/EF_Timer.c: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_Timer.c 3 | * 4 | * Description: Timer driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #include 29 | #include 30 | #include "EF_Timer.h" 31 | #include "../ServiceLayer/std_types.h" 32 | 33 | /************************************************** 34 | * Global variables 35 | *************************************************/ 36 | static void (*voidFuncPtr)(void); 37 | 38 | 39 | /**************************************************************************** 40 | * Function : EF_void_Timer_PORTinit 41 | * 42 | * DESCRIPTION : this function initializes the timer module with the configuration data 43 | * 44 | * PARAMETERS : None 45 | * 46 | * Return Value: None 47 | ******************************************************************************/ 48 | void EF_void_Timer_PORTinit(void) 49 | { 50 | 51 | /* initialize timer 1 , set the prescaler */ 52 | TIMER_CONTROL_REG = (TIMER_CONTROL_REG & ~ TIMER_PRESCALE_MASK) | TIMER1PRESCALE ; 53 | /* reset TCNT1 */ 54 | TIMER_REG = MAX_U8_t - (U8_t)TIMERCYCLES ; 55 | /* enable TCNT1 overflow */ 56 | TIMSK |= TOIE_MASK; 57 | /* TOV1 can be cleared by writing a logic one to its bit location */ 58 | TIFR |= TOV_MASK; 59 | /* Enable Global interrupt */ 60 | sei(); 61 | } 62 | 63 | 64 | /**************************************************************************** 65 | * Function : EF_void_Timer_SetISRCallBack 66 | * 67 | * DESCRIPTION : this call back function in the timer module. 68 | * Attach a user function to a timer interrupt 69 | * 70 | * PARAMETERS : void (*userFunc)(void) : pointer to the call back function which 71 | * will call in the Timer ISR if timer interrupt is happened 72 | * 73 | * Return Value: None 74 | ******************************************************************************/ 75 | void EF_void_Timer_SetISRCallBack( void (*userFunc)(void) ) 76 | { 77 | /* the supplied user's function */ 78 | voidFuncPtr = userFunc; 79 | } 80 | 81 | 82 | /**************************************************************************** 83 | * Function : void_ucPORT_removeTimerISRCallBack 84 | * 85 | * DESCRIPTION : Detach a user function from a timer interrupt 86 | * 87 | * PARAMETERS : None 88 | * 89 | * Return Value: None 90 | ******************************************************************************/ 91 | void EF_void_Timer_RemoveTimerISRCallBack(void) 92 | { 93 | 94 | /* set the interrupt function to run nothing */ 95 | voidFuncPtr = NULL; 96 | 97 | } 98 | 99 | 100 | /**************************************************************************** 101 | * Function : ISR(TIMER1_OVF_vect) 102 | * 103 | * DESCRIPTION : Interrupt handler for tcnt1 overflow interrupt 104 | * 105 | * PARAMETERS : None 106 | * 107 | * Return Value: None 108 | ******************************************************************************/ 109 | 110 | ISR(TIMER_OFV_VECTOR) 111 | 112 | { 113 | /* if a user function is defined, execute it */ 114 | if(voidFuncPtr != NULL) 115 | voidFuncPtr(); 116 | 117 | /* reset TCNT1 */ 118 | TIMER_REG = MAX_U8_t - (U8_t)TIMERCYCLES ; 119 | /* TOV1 can be cleared by writing a logic one to its bit location */ 120 | TIFR |= TOV_MASK; 121 | 122 | 123 | } 124 | 125 | 126 | -------------------------------------------------------------------------------- /MCAL/EF_Timer.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_Timer.h 3 | * 4 | * Description: Timer driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef TIMER_H 29 | #define TIMER_H 30 | 31 | #include "../ServiceLayer/std_types.h" 32 | #include "EF_Timer_cfg.h" 33 | 34 | 35 | 36 | 37 | /**************************************************************************** 38 | * Function : EF_void_Timer_PORTinit 39 | * 40 | * DESCRIPTION : this function initializes the timer module with the configuration data 41 | * 42 | * PARAMETERS : None 43 | * 44 | * Return Value: None 45 | ******************************************************************************/ 46 | extern void EF_void_Timer_PORTinit(void); 47 | 48 | 49 | /**************************************************************************** 50 | * Function : EF_void_Timer_SetISRCallBack 51 | * 52 | * DESCRIPTION : this call back function in the timer module. 53 | * Attach a user function to a timer interrupt 54 | * 55 | * PARAMETERS : void (*userFunc)(void) : pointer to the call back function which 56 | * will call in the Timer ISR if timer interrupt is happened 57 | * 58 | * Return Value: None 59 | ******************************************************************************/ 60 | extern void EF_void_Timer_SetISRCallBack( void (*userFunc)(void) ); 61 | 62 | 63 | /**************************************************************************** 64 | * Function : void_ucPORT_removeTimerISRCallBack 65 | * 66 | * DESCRIPTION : Detach a user function from a timer interrupt 67 | * 68 | * PARAMETERS : None 69 | * 70 | * Return Value: None 71 | ******************************************************************************/ 72 | extern void EF_void_Timer_RemoveTimerISRCallBack(void); 73 | 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /MCAL/EF_Timer_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_Timer_cfg.h 3 | * 4 | * Description: Timer driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef TIMER_CFG_H 29 | #define TIMER_CFG_H 30 | #include 31 | #include "../ServiceLayer/std_types.h" 32 | #include "EF_SpechialTIMER.h" 33 | 34 | /************************************************** 35 | * Definitions 36 | *************************************************/ 37 | #define TIMER_CONTROL_REG TCCR2 /* Timer Control Register */ 38 | #define TIMER_REG TCNT2 /* Timer Register */ 39 | #define TOIE2_MASK 0x40 /* Timer2 Interrupt Enable mask */ 40 | #define TOV2_MASK 0x40 /* Timer2 Over Flow flag mask */ 41 | #define TOIE_MASK TOIE2_MASK /* Interrupt Enable bit mask */ 42 | #define TOV_MASK TOV2_MASK /* Over Flow flag bit mask */ 43 | #define TIMER_OFV_VECTOR TIMER2_OVF_vect 44 | 45 | #define TIMER_CLK_STOP 0x00 /* Timer Stopped */ 46 | #define TIMER_CLK_DIV1 0x01 /* Timer clocked at F_CPU */ 47 | #define TIMER_CLK_DIV8 0x02 /* Timer clocked at F_CPU/8 */ 48 | #define TIMER_CLK_DIV64 0x04 /* Timer clocked at F_CPU/64 */ 49 | #define TIMER_CLK_DIV256 0x06 /* Timer clocked at F_CPU/256 */ 50 | #define TIMER_CLK_DIV1024 0x07 /* Timer clocked at F_CPU/1024 */ 51 | 52 | #define TIMER_PRESCALE_MASK 0x07 /* Timer Prescaler Bit-Mask */ 53 | 54 | 55 | /* default prescale settings for the timer,these settings are applied 56 | * when calling timerInit */ 57 | 58 | #define TIMER1PRESCALE TIMER_CLK_DIV1024 /* timer 1 prescaler default */ 59 | #define TIMERCYCLES CYCLES_PER_V_MLI_S /* cycles per variable Mili seconds */ 60 | #define SYSTEMTICKTIME 20 61 | 62 | //#define TIMER_PRESCALE 8 63 | 64 | #if (TIMER1PRESCALE == TIMER_CLK_DIV1) 65 | #define TIMER_PRESCALE 1 66 | #elif (TIMER1PRESCALE == TIMER_CLK_DIV8) 67 | #define TIMER_PRESCALE 8 68 | #elif (TIMER1PRESCALE == TIMER_CLK_DIV64) 69 | #define TIMER_PRESCALE 64 70 | #elif (TIMER1PRESCALE == TIMER_CLK_DIV256) 71 | #define TIMER_PRESCALE 256 72 | #elif (TIMER1PRESCALE == TIMER_CLK_DIV1024) 73 | #define TIMER_PRESCALE 1024 74 | #endif 75 | 76 | /* Timer_Counts = ( F_timer/(F_required) ) - 1 = ( F_timer * T_required ) - 1 */ 77 | #define CYCLES_PER_US ((F_CPU/ TIMER_PRESCALE )/1000000 ) /* system tick is 1 micro */ 78 | #define CYCLES_PER_5_MLI_S ((F_CPU/ TIMER_PRESCALE )/200) /* system tick is 5 ms */ 79 | #define CYCLES_PER_10_MLI_S ((F_CPU/ TIMER_PRESCALE )/100) /* system tick is 10 ms */ 80 | #define CYCLES_PER_20_MLI_S ((F_CPU/ TIMER_PRESCALE )/50) /* system tick is 20 ms */ 81 | #define CYCLES_PER_V_MLI_S ((F_CPU/ TIMER_PRESCALE )/SYSTEMTICKTIME) /* system tick variable */ 82 | 83 | 84 | 85 | #define MAX_U8_t 255 /* Max. counts of Timer 8 bit Register */ 86 | #define MAX_U16_t 65535 /* Max. counts of Timer 16 bit Register */ 87 | 88 | 89 | #endif 90 | 91 | -------------------------------------------------------------------------------- /MCAL/EF_UART.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_UART.h 3 | * 4 | * Description: UART driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | #ifndef UART_H 28 | #define UART_H 29 | 30 | #include "EF_UART_cfg.h" 31 | /**************************************************************************** 32 | * Function : EF_void_UART_Init 33 | * 34 | * DESCRIPTION : init the UART 35 | * 36 | * PARAMETERS : uart_cfg : pointer to UART_cfg_str which has parameters to init the UART 37 | * 38 | * Return Value: None. 39 | ******************************************************************************/ 40 | extern void EF_void_UART_Init(UART_cfg_str *uart_cfg); 41 | 42 | /**************************************************************************** 43 | * Function : EF_BOOLEAN_UART_PutChar 44 | * 45 | * DESCRIPTION : Sending the TX byte ,used timer to be unStuck 46 | * 47 | * PARAMETERS : data : TX byte 48 | * 49 | * Return Value: return True if Byte is transmitted or false 50 | * 51 | * NOTE : special timer must be initialized and enable Global interrupt 52 | * before using this function 53 | ******************************************************************************/ 54 | extern BOOLEAN EF_BOOLEAN_UART_PutChar(U8_t data); 55 | 56 | /**************************************************************************** 57 | * Function : EF_BOOLEAN_UART_GetChar 58 | * 59 | * DESCRIPTION : Getting the RX byte ,used timer to be unStuck 60 | * 61 | * PARAMETERS : returnedValue: pointer to the Rx byte 62 | * 63 | * Return Value: return True if Byte is received or false 64 | * 65 | * NOTE : special timer must be initialized and enable Global interrupt 66 | * before using this function 67 | ******************************************************************************/ 68 | extern BOOLEAN EF_BOOLEAN_UART_GetChar(U8_t * returnedValue); 69 | 70 | 71 | extern BOOLEAN EF_BOOLEAN_UART_CheckForRxData( ); 72 | /**************************************************************************** 73 | * Function : EF_u8_UART_WaitChar 74 | * 75 | * DESCRIPTION : Getting the RX byte 76 | * 77 | * PARAMETERS : None 78 | * 79 | * Return Value: U8_t : Rx byte 80 | ******************************************************************************/ 81 | extern U8_t EF_u8_UART_WaitChar(); 82 | /**************************************************************************** 83 | * Function : EF_void_UART_PutChar 84 | * 85 | * DESCRIPTION : Sending the TX byte 86 | * 87 | * PARAMETERS : Tx_byte 88 | * 89 | * Return Value: None 90 | * 91 | ******************************************************************************/ 92 | extern void EF_void_UART_PutChar(U8_t data); 93 | /**************************************************************************** 94 | * Function : EF_void_UART_SendArray 95 | * 96 | * DESCRIPTION : sending arrays of bytes 97 | * 98 | * 99 | * PARAMETERS : array : pointer to TX data 100 | * Length : length of array 101 | * 102 | * Return Value: None 103 | * 104 | ******************************************************************************/ 105 | void EF_void_UART_SendArray(U8_t *array, U8_t Length); 106 | 107 | 108 | void EF_void_UART_HextoASCII(U8_t *hex); 109 | 110 | #endif 111 | -------------------------------------------------------------------------------- /MCAL/EF_UART_cfg.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: EF_UART_cfg.h 3 | * 4 | * Description: UART driver for ATMEGA32 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | #ifndef UART_CFG_H 29 | #define UART_CFG_H 30 | 31 | #include 32 | #include "../ServiceLayer/std_types.h" 33 | 34 | /************************************************** 35 | * Predefine variables 36 | **************************************************/ 37 | #define NO_PARITY 0 38 | #define EVEN_PARITY 2 39 | #define ODD_PARITY 3 40 | 41 | #define ONE_STOP_BIT 0 42 | #define TWO_STOP_BITS 1 43 | 44 | 45 | /************************************************** 46 | * configuration types 47 | *************************************************/ 48 | /* structure is passed in the void_UART_init argument*/ 49 | typedef struct 50 | { 51 | U32_t baudrate; /* put here the normal Baud rate as 9600 */ 52 | U8_t numberOfDataBits; /* take number from 5 to 9 */ 53 | U8_t stopBits; /* take one of #defined above as ONE_STOP_BIT */ 54 | U8_t parity; /* take one of #defined above as NO_PARITY */ 55 | BOOLEAN RXInterruptEnable; /* take 1 if enable and 0 if disable */ 56 | BOOLEAN TXInterruptEnable; /* take 1 if enable and 0 if disable */ 57 | BOOLEAN ReceiverEnable; /* take 1 if enable and 0 if disable */ 58 | BOOLEAN TransmitterEnable; /* take 1 if enable and 0 if disable */ 59 | }UART_cfg_str; 60 | 61 | 62 | /************************************************** 63 | * register types 64 | *************************************************/ 65 | 66 | /* using this structure to map the UART registers */ 67 | typedef struct 68 | { 69 | volatile U8_t * UDR_Reg ; 70 | volatile U8_t * UCSRA_Reg ; 71 | volatile U8_t * UCSRB_Reg ; 72 | volatile U8_t * UCSRC_Reg ; 73 | volatile U8_t * UBRRH_Reg ; 74 | volatile U8_t * UBRRL_Reg ; 75 | }UART_reg_str; 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /Readme.txt: -------------------------------------------------------------------------------- 1 | /=======================================================/ 2 | Embedded Fab provides OpenSource Atmel Library 3 | Any one can modify or fix any bugs and pull it to us 4 | /=======================================================/ 5 | 6 | The library depends on the Abstraction Layers with Application programming Interface (API). 7 | |-----------------------------------| 8 | | Application layer | | 9 | |-------------------| service Layer | 10 | | HAL | | 11 | |-----------------------------------| 12 | | MCAL | 13 | |-----------------------------------| 14 | There are: 15 | -MCAL file (drivers handle with the modules in uC) 16 | -HAL file (drivers on the Board or out , there are not modules in uC) 17 | -ServiceLayer (data types definition) 18 | -References File in HAL (references to some externel Modules 19 | and Embedded Fab Red kit features ) 20 | -Documentation File in HAL ,(Documentation to some externel Modules) 21 | - GuideLines_to_Learn_Git pdf 22 | -------------------------------------------------------------------------------- /Release/HAL/EF_7Segment.d: -------------------------------------------------------------------------------- 1 | HAL/EF_7Segment.d HAL/EF_7Segment.o: ../HAL/EF_7Segment.c \ 2 | ../HAL/EF_7Segment.h ../HAL/../ServiceLayer/std_types.h \ 3 | ../HAL/../MCAL/EF_DIO.h ../HAL/../MCAL/../ServiceLayer/std_types.h 4 | 5 | ../HAL/EF_7Segment.h: 6 | 7 | ../HAL/../ServiceLayer/std_types.h: 8 | 9 | ../HAL/../MCAL/EF_DIO.h: 10 | 11 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 12 | -------------------------------------------------------------------------------- /Release/HAL/EF_7Segment.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/HAL/EF_7Segment.o -------------------------------------------------------------------------------- /Release/HAL/EF_Bluetooth.d: -------------------------------------------------------------------------------- 1 | HAL/EF_Bluetooth.d HAL/EF_Bluetooth.o: ../HAL/EF_Bluetooth.c \ 2 | ../HAL/../MCAL/EF_UART.h ../HAL/../MCAL/EF_UART_cfg.h \ 3 | ../HAL/../MCAL/../ServiceLayer/std_types.h \ 4 | ../HAL/../MCAL/EF_SpechialTIMER.h ../HAL/../MCAL/EF_SpechialTIMER_cfg.h \ 5 | ../HAL/../MCAL/EF_Timer.h ../HAL/../MCAL/EF_Timer_cfg.h \ 6 | ../HAL/../MCAL/EF_SpechialTIMER.h ../HAL/../MCAL/EF_DIO.h \ 7 | ../HAL/EF_Bluetooth.h ../HAL/../ServiceLayer/std_types.h \ 8 | ../HAL/EF_Bluetooth_cfg.h ../HAL/EF_LCD.h 9 | 10 | ../HAL/../MCAL/EF_UART.h: 11 | 12 | ../HAL/../MCAL/EF_UART_cfg.h: 13 | 14 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 15 | 16 | ../HAL/../MCAL/EF_SpechialTIMER.h: 17 | 18 | ../HAL/../MCAL/EF_SpechialTIMER_cfg.h: 19 | 20 | ../HAL/../MCAL/EF_Timer.h: 21 | 22 | ../HAL/../MCAL/EF_Timer_cfg.h: 23 | 24 | ../HAL/../MCAL/EF_SpechialTIMER.h: 25 | 26 | ../HAL/../MCAL/EF_DIO.h: 27 | 28 | ../HAL/EF_Bluetooth.h: 29 | 30 | ../HAL/../ServiceLayer/std_types.h: 31 | 32 | ../HAL/EF_Bluetooth_cfg.h: 33 | 34 | ../HAL/EF_LCD.h: 35 | -------------------------------------------------------------------------------- /Release/HAL/EF_DS1307.d: -------------------------------------------------------------------------------- 1 | HAL/EF_DS1307.d HAL/EF_DS1307.o: ../HAL/EF_DS1307.c ../HAL/EF_DS1307.h \ 2 | ../HAL/../MCAL/EF_I2C.h ../HAL/../MCAL/EF_DIO.h \ 3 | ../HAL/../MCAL/../ServiceLayer/std_types.h \ 4 | ../HAL/../ServiceLayer/std_types.h 5 | 6 | ../HAL/EF_DS1307.h: 7 | 8 | ../HAL/../MCAL/EF_I2C.h: 9 | 10 | ../HAL/../MCAL/EF_DIO.h: 11 | 12 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 13 | 14 | ../HAL/../ServiceLayer/std_types.h: 15 | -------------------------------------------------------------------------------- /Release/HAL/EF_DS1307.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/HAL/EF_DS1307.o -------------------------------------------------------------------------------- /Release/HAL/EF_E2PROM_24C16.d: -------------------------------------------------------------------------------- 1 | HAL/EF_E2PROM_24C16.d HAL/EF_E2PROM_24C16.o: ../HAL/EF_E2PROM_24C16.c \ 2 | ../HAL/EF_E2PROM_24C16.h ../HAL/../MCAL/EF_DIO.h \ 3 | ../HAL/../MCAL/../ServiceLayer/std_types.h ../HAL/../MCAL/EF_I2C.h \ 4 | ../HAL/../MCAL/EF_DIO.h ../HAL/../ServiceLayer/std_types.h 5 | 6 | ../HAL/EF_E2PROM_24C16.h: 7 | 8 | ../HAL/../MCAL/EF_DIO.h: 9 | 10 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 11 | 12 | ../HAL/../MCAL/EF_I2C.h: 13 | 14 | ../HAL/../MCAL/EF_DIO.h: 15 | 16 | ../HAL/../ServiceLayer/std_types.h: 17 | -------------------------------------------------------------------------------- /Release/HAL/EF_E2PROM_24C16.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/HAL/EF_E2PROM_24C16.o -------------------------------------------------------------------------------- /Release/HAL/EF_ESP8266.d: -------------------------------------------------------------------------------- 1 | HAL/EF_ESP8266.d HAL/EF_ESP8266.o: ../HAL/EF_ESP8266.c \ 2 | ../HAL/EF_ESP8266.h ../HAL/../ServiceLayer/std_types.h ../HAL/EF_LCD.h \ 3 | ../HAL/EF_ESP8266_cfg.h ../HAL/../MCAL/EF_UART.h \ 4 | ../HAL/../MCAL/EF_UART_cfg.h ../HAL/../MCAL/../ServiceLayer/std_types.h \ 5 | ../HAL/../MCAL/EF_SpechialTIMER.h ../HAL/../MCAL/EF_SpechialTIMER_cfg.h \ 6 | ../HAL/../MCAL/EF_Timer.h ../HAL/../MCAL/EF_Timer_cfg.h \ 7 | ../HAL/../MCAL/EF_SpechialTIMER.h ../HAL/../MCAL/EF_DIO.h 8 | 9 | ../HAL/EF_ESP8266.h: 10 | 11 | ../HAL/../ServiceLayer/std_types.h: 12 | 13 | ../HAL/EF_LCD.h: 14 | 15 | ../HAL/EF_ESP8266_cfg.h: 16 | 17 | ../HAL/../MCAL/EF_UART.h: 18 | 19 | ../HAL/../MCAL/EF_UART_cfg.h: 20 | 21 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 22 | 23 | ../HAL/../MCAL/EF_SpechialTIMER.h: 24 | 25 | ../HAL/../MCAL/EF_SpechialTIMER_cfg.h: 26 | 27 | ../HAL/../MCAL/EF_Timer.h: 28 | 29 | ../HAL/../MCAL/EF_Timer_cfg.h: 30 | 31 | ../HAL/../MCAL/EF_SpechialTIMER.h: 32 | 33 | ../HAL/../MCAL/EF_DIO.h: 34 | -------------------------------------------------------------------------------- /Release/HAL/EF_Keypad.d: -------------------------------------------------------------------------------- 1 | HAL/EF_Keypad.d HAL/EF_Keypad.o: ../HAL/EF_Keypad.c ../HAL/EF_KeyPad.h \ 2 | ../HAL/../ServiceLayer/std_types.h ../HAL/../MCAL/EF_DIO.h \ 3 | ../HAL/../MCAL/../ServiceLayer/std_types.h 4 | 5 | ../HAL/EF_KeyPad.h: 6 | 7 | ../HAL/../ServiceLayer/std_types.h: 8 | 9 | ../HAL/../MCAL/EF_DIO.h: 10 | 11 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 12 | -------------------------------------------------------------------------------- /Release/HAL/EF_Keypad.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/HAL/EF_Keypad.o -------------------------------------------------------------------------------- /Release/HAL/EF_LCD.d: -------------------------------------------------------------------------------- 1 | HAL/EF_LCD.d HAL/EF_LCD.o: ../HAL/EF_LCD.c ../HAL/EF_LCD.h \ 2 | ../HAL/../ServiceLayer/std_types.h ../HAL/../MCAL/EF_DIO.h \ 3 | ../HAL/../MCAL/../ServiceLayer/std_types.h 4 | 5 | ../HAL/EF_LCD.h: 6 | 7 | ../HAL/../ServiceLayer/std_types.h: 8 | 9 | ../HAL/../MCAL/EF_DIO.h: 10 | 11 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 12 | -------------------------------------------------------------------------------- /Release/HAL/EF_LCD.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/HAL/EF_LCD.o -------------------------------------------------------------------------------- /Release/HAL/EF_SkyLabGPS.d: -------------------------------------------------------------------------------- 1 | HAL/EF_SkyLabGPS.d HAL/EF_SkyLabGPS.o: ../HAL/EF_SkyLabGPS.c \ 2 | ../HAL/../MCAL/EF_UART.h ../HAL/../MCAL/EF_UART_cfg.h \ 3 | ../HAL/../MCAL/../ServiceLayer/std_types.h ../HAL/EF_LCD.h \ 4 | ../HAL/../ServiceLayer/std_types.h ../HAL/EF_SkyLabGPS.h 5 | 6 | ../HAL/../MCAL/EF_UART.h: 7 | 8 | ../HAL/../MCAL/EF_UART_cfg.h: 9 | 10 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 11 | 12 | ../HAL/EF_LCD.h: 13 | 14 | ../HAL/../ServiceLayer/std_types.h: 15 | 16 | ../HAL/EF_SkyLabGPS.h: 17 | -------------------------------------------------------------------------------- /Release/HAL/EF_SkyLabGPS.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/HAL/EF_SkyLabGPS.o -------------------------------------------------------------------------------- /Release/HAL/EF_UltraSonic.d: -------------------------------------------------------------------------------- 1 | HAL/EF_UltraSonic.d HAL/EF_UltraSonic.o: ../HAL/EF_UltraSonic.c \ 2 | ../HAL/EF_UltraSonic.h ../HAL/../ServiceLayer/std_types.h \ 3 | ../HAL/../MCAL/EF_TIMER.h ../HAL/../MCAL/../ServiceLayer/std_types.h \ 4 | ../HAL/../MCAL/EF_Timer_cfg.h ../HAL/../MCAL/EF_SpechialTIMER.h \ 5 | ../HAL/../MCAL/EF_SpechialTIMER_cfg.h ../HAL/../MCAL/EF_Timer.h \ 6 | ../HAL/EF_LCD.h ../HAL/../MCAL/EF_DIO.h 7 | 8 | ../HAL/EF_UltraSonic.h: 9 | 10 | ../HAL/../ServiceLayer/std_types.h: 11 | 12 | ../HAL/../MCAL/EF_TIMER.h: 13 | 14 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 15 | 16 | ../HAL/../MCAL/EF_Timer_cfg.h: 17 | 18 | ../HAL/../MCAL/EF_SpechialTIMER.h: 19 | 20 | ../HAL/../MCAL/EF_SpechialTIMER_cfg.h: 21 | 22 | ../HAL/../MCAL/EF_Timer.h: 23 | 24 | ../HAL/EF_LCD.h: 25 | 26 | ../HAL/../MCAL/EF_DIO.h: 27 | -------------------------------------------------------------------------------- /Release/HAL/EF_UltraSonic.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/HAL/EF_UltraSonic.o -------------------------------------------------------------------------------- /Release/HAL/EF_Wavecom.d: -------------------------------------------------------------------------------- 1 | HAL/EF_Wavecom.d HAL/EF_Wavecom.o: ../HAL/EF_Wavecom.c \ 2 | ../HAL/EF_Wavecom.h ../HAL/../MCAL/EF_UART.h \ 3 | ../HAL/../MCAL/EF_UART_cfg.h ../HAL/../MCAL/../ServiceLayer/std_types.h \ 4 | ../HAL/../ServiceLayer/std_types.h ../HAL/EF_LCD.h 5 | 6 | ../HAL/EF_Wavecom.h: 7 | 8 | ../HAL/../MCAL/EF_UART.h: 9 | 10 | ../HAL/../MCAL/EF_UART_cfg.h: 11 | 12 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 13 | 14 | ../HAL/../ServiceLayer/std_types.h: 15 | 16 | ../HAL/EF_LCD.h: 17 | -------------------------------------------------------------------------------- /Release/HAL/EF_Wavecom.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/HAL/EF_Wavecom.o -------------------------------------------------------------------------------- /Release/HAL/EF_nRF2401.d: -------------------------------------------------------------------------------- 1 | HAL/EF_nRF2401.d HAL/EF_nRF2401.o: ../HAL/EF_nRF2401.c \ 2 | ../HAL/../ServiceLayer/std_types.h ../HAL/../MCAL/EF_SPI.h \ 3 | ../HAL/../MCAL/../ServiceLayer/std_types.h ../HAL/../MCAL/EF_SPI_cfg.h \ 4 | ../HAL/../MCAL/EF_UART.h ../HAL/../MCAL/EF_UART_cfg.h \ 5 | ../HAL/EF_nRF2401_cfg.h 6 | 7 | ../HAL/../ServiceLayer/std_types.h: 8 | 9 | ../HAL/../MCAL/EF_SPI.h: 10 | 11 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 12 | 13 | ../HAL/../MCAL/EF_SPI_cfg.h: 14 | 15 | ../HAL/../MCAL/EF_UART.h: 16 | 17 | ../HAL/../MCAL/EF_UART_cfg.h: 18 | 19 | ../HAL/EF_nRF2401_cfg.h: 20 | -------------------------------------------------------------------------------- /Release/HAL/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../HAL/EF_7Segment.c \ 8 | ../HAL/EF_Bluetooth.c \ 9 | ../HAL/EF_DS1307.c \ 10 | ../HAL/EF_E2PROM_24C16.c \ 11 | ../HAL/EF_ESP8266.c \ 12 | ../HAL/EF_Keypad.c \ 13 | ../HAL/EF_LCD.c \ 14 | ../HAL/EF_SkyLabGPS.c \ 15 | ../HAL/EF_UltraSonic.c \ 16 | ../HAL/EF_Wavecom.c \ 17 | ../HAL/EF_nRF2401.c 18 | 19 | OBJS += \ 20 | ./HAL/EF_7Segment.o \ 21 | ./HAL/EF_Bluetooth.o \ 22 | ./HAL/EF_DS1307.o \ 23 | ./HAL/EF_E2PROM_24C16.o \ 24 | ./HAL/EF_ESP8266.o \ 25 | ./HAL/EF_Keypad.o \ 26 | ./HAL/EF_LCD.o \ 27 | ./HAL/EF_SkyLabGPS.o \ 28 | ./HAL/EF_UltraSonic.o \ 29 | ./HAL/EF_Wavecom.o \ 30 | ./HAL/EF_nRF2401.o 31 | 32 | C_DEPS += \ 33 | ./HAL/EF_7Segment.d \ 34 | ./HAL/EF_Bluetooth.d \ 35 | ./HAL/EF_DS1307.d \ 36 | ./HAL/EF_E2PROM_24C16.d \ 37 | ./HAL/EF_ESP8266.d \ 38 | ./HAL/EF_Keypad.d \ 39 | ./HAL/EF_LCD.d \ 40 | ./HAL/EF_SkyLabGPS.d \ 41 | ./HAL/EF_UltraSonic.d \ 42 | ./HAL/EF_Wavecom.d \ 43 | ./HAL/EF_nRF2401.d 44 | 45 | 46 | # Each subdirectory must supply rules for building sources it contributes 47 | HAL/%.o: ../HAL/%.c 48 | @echo 'Building file: $<' 49 | @echo 'Invoking: AVR Compiler' 50 | avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega32 -DF_CPU=8000000UL -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -c -o "$@" "$<" 51 | @echo 'Finished building: $<' 52 | @echo ' ' 53 | 54 | 55 | -------------------------------------------------------------------------------- /Release/MCAL/EF_ADC.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_ADC.d MCAL/EF_ADC.o: ../MCAL/EF_ADC.c \ 2 | ../MCAL/../ServiceLayer/std_types.h ../MCAL/EF_ADC.h ../MCAL/EF_DIO.h 3 | 4 | ../MCAL/../ServiceLayer/std_types.h: 5 | 6 | ../MCAL/EF_ADC.h: 7 | 8 | ../MCAL/EF_DIO.h: 9 | -------------------------------------------------------------------------------- /Release/MCAL/EF_ADC.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_ADC.o -------------------------------------------------------------------------------- /Release/MCAL/EF_DIO.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_DIO.d MCAL/EF_DIO.o: ../MCAL/EF_DIO.c ../MCAL/EF_DIO.h \ 2 | ../MCAL/../ServiceLayer/std_types.h 3 | 4 | ../MCAL/EF_DIO.h: 5 | 6 | ../MCAL/../ServiceLayer/std_types.h: 7 | -------------------------------------------------------------------------------- /Release/MCAL/EF_DIO.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_DIO.o -------------------------------------------------------------------------------- /Release/MCAL/EF_EEPROM.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_EEPROM.d MCAL/EF_EEPROM.o: ../MCAL/EF_EEPROM.c \ 2 | ../MCAL/EF_EEPROM.h ../MCAL/../ServiceLayer/std_types.h 3 | 4 | ../MCAL/EF_EEPROM.h: 5 | 6 | ../MCAL/../ServiceLayer/std_types.h: 7 | -------------------------------------------------------------------------------- /Release/MCAL/EF_EEPROM.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_EEPROM.o -------------------------------------------------------------------------------- /Release/MCAL/EF_I2C.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_I2C.d MCAL/EF_I2C.o: ../MCAL/EF_I2C.c ../MCAL/EF_I2C.h \ 2 | ../MCAL/EF_DIO.h ../MCAL/../ServiceLayer/std_types.h 3 | 4 | ../MCAL/EF_I2C.h: 5 | 6 | ../MCAL/EF_DIO.h: 7 | 8 | ../MCAL/../ServiceLayer/std_types.h: 9 | -------------------------------------------------------------------------------- /Release/MCAL/EF_I2C.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_I2C.o -------------------------------------------------------------------------------- /Release/MCAL/EF_InputCapture.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_InputCapture.d MCAL/EF_InputCapture.o: ../MCAL/EF_InputCapture.c \ 2 | ../MCAL/EF_InputCapture.h ../MCAL/../ServiceLayer/std_types.h \ 3 | ../MCAL/EF_SpechialTIMER.h ../MCAL/EF_SpechialTIMER_cfg.h \ 4 | ../MCAL/EF_Timer.h ../MCAL/EF_Timer_cfg.h ../MCAL/EF_DIO.h 5 | 6 | ../MCAL/EF_InputCapture.h: 7 | 8 | ../MCAL/../ServiceLayer/std_types.h: 9 | 10 | ../MCAL/EF_SpechialTIMER.h: 11 | 12 | ../MCAL/EF_SpechialTIMER_cfg.h: 13 | 14 | ../MCAL/EF_Timer.h: 15 | 16 | ../MCAL/EF_Timer_cfg.h: 17 | 18 | ../MCAL/EF_DIO.h: 19 | -------------------------------------------------------------------------------- /Release/MCAL/EF_InputCapture.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_InputCapture.o -------------------------------------------------------------------------------- /Release/MCAL/EF_PWM.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_PWM.d MCAL/EF_PWM.o: ../MCAL/EF_PWM.c ../MCAL/EF_pwm_cfg.h \ 2 | ../MCAL/../ServiceLayer/std_types.h 3 | 4 | ../MCAL/EF_pwm_cfg.h: 5 | 6 | ../MCAL/../ServiceLayer/std_types.h: 7 | -------------------------------------------------------------------------------- /Release/MCAL/EF_PWM.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_PWM.o -------------------------------------------------------------------------------- /Release/MCAL/EF_SPI.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_SPI.d MCAL/EF_SPI.o: ../MCAL/EF_SPI.c ../MCAL/EF_SPI.h \ 2 | ../MCAL/../ServiceLayer/std_types.h ../MCAL/EF_SPI_cfg.h \ 3 | ../MCAL/EF_SpechialTIMER.h ../MCAL/EF_SpechialTIMER_cfg.h \ 4 | ../MCAL/EF_Timer.h ../MCAL/EF_Timer_cfg.h 5 | 6 | ../MCAL/EF_SPI.h: 7 | 8 | ../MCAL/../ServiceLayer/std_types.h: 9 | 10 | ../MCAL/EF_SPI_cfg.h: 11 | 12 | ../MCAL/EF_SpechialTIMER.h: 13 | 14 | ../MCAL/EF_SpechialTIMER_cfg.h: 15 | 16 | ../MCAL/EF_Timer.h: 17 | 18 | ../MCAL/EF_Timer_cfg.h: 19 | -------------------------------------------------------------------------------- /Release/MCAL/EF_SPI.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_SPI.o -------------------------------------------------------------------------------- /Release/MCAL/EF_SpechialTIMER.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_SpechialTIMER.d MCAL/EF_SpechialTIMER.o: \ 2 | ../MCAL/EF_SpechialTIMER.c ../MCAL/EF_SpechialTIMER.h \ 3 | ../MCAL/EF_SpechialTIMER_cfg.h ../MCAL/../ServiceLayer/std_types.h \ 4 | ../MCAL/EF_Timer.h ../MCAL/EF_Timer_cfg.h 5 | 6 | ../MCAL/EF_SpechialTIMER.h: 7 | 8 | ../MCAL/EF_SpechialTIMER_cfg.h: 9 | 10 | ../MCAL/../ServiceLayer/std_types.h: 11 | 12 | ../MCAL/EF_Timer.h: 13 | 14 | ../MCAL/EF_Timer_cfg.h: 15 | -------------------------------------------------------------------------------- /Release/MCAL/EF_SpechialTIMER.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_SpechialTIMER.o -------------------------------------------------------------------------------- /Release/MCAL/EF_Timer.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_Timer.d MCAL/EF_Timer.o: ../MCAL/EF_Timer.c ../MCAL/EF_Timer.h \ 2 | ../MCAL/../ServiceLayer/std_types.h ../MCAL/EF_Timer_cfg.h \ 3 | ../MCAL/EF_SpechialTIMER.h ../MCAL/EF_SpechialTIMER_cfg.h 4 | 5 | ../MCAL/EF_Timer.h: 6 | 7 | ../MCAL/../ServiceLayer/std_types.h: 8 | 9 | ../MCAL/EF_Timer_cfg.h: 10 | 11 | ../MCAL/EF_SpechialTIMER.h: 12 | 13 | ../MCAL/EF_SpechialTIMER_cfg.h: 14 | -------------------------------------------------------------------------------- /Release/MCAL/EF_Timer.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_Timer.o -------------------------------------------------------------------------------- /Release/MCAL/EF_UART.d: -------------------------------------------------------------------------------- 1 | MCAL/EF_UART.d MCAL/EF_UART.o: ../MCAL/EF_UART.c ../MCAL/EF_UART.h \ 2 | ../MCAL/EF_UART_cfg.h ../MCAL/../ServiceLayer/std_types.h \ 3 | ../MCAL/EF_SpechialTIMER.h ../MCAL/EF_SpechialTIMER_cfg.h \ 4 | ../MCAL/EF_Timer.h ../MCAL/EF_Timer_cfg.h 5 | 6 | ../MCAL/EF_UART.h: 7 | 8 | ../MCAL/EF_UART_cfg.h: 9 | 10 | ../MCAL/../ServiceLayer/std_types.h: 11 | 12 | ../MCAL/EF_SpechialTIMER.h: 13 | 14 | ../MCAL/EF_SpechialTIMER_cfg.h: 15 | 16 | ../MCAL/EF_Timer.h: 17 | 18 | ../MCAL/EF_Timer_cfg.h: 19 | -------------------------------------------------------------------------------- /Release/MCAL/EF_UART.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/MCAL/EF_UART.o -------------------------------------------------------------------------------- /Release/MCAL/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../MCAL/EF_ADC.c \ 8 | ../MCAL/EF_DIO.c \ 9 | ../MCAL/EF_EEPROM.c \ 10 | ../MCAL/EF_I2C.c \ 11 | ../MCAL/EF_InputCapture.c \ 12 | ../MCAL/EF_PWM.c \ 13 | ../MCAL/EF_SPI.c \ 14 | ../MCAL/EF_SpechialTIMER.c \ 15 | ../MCAL/EF_Timer.c \ 16 | ../MCAL/EF_UART.c 17 | 18 | OBJS += \ 19 | ./MCAL/EF_ADC.o \ 20 | ./MCAL/EF_DIO.o \ 21 | ./MCAL/EF_EEPROM.o \ 22 | ./MCAL/EF_I2C.o \ 23 | ./MCAL/EF_InputCapture.o \ 24 | ./MCAL/EF_PWM.o \ 25 | ./MCAL/EF_SPI.o \ 26 | ./MCAL/EF_SpechialTIMER.o \ 27 | ./MCAL/EF_Timer.o \ 28 | ./MCAL/EF_UART.o 29 | 30 | C_DEPS += \ 31 | ./MCAL/EF_ADC.d \ 32 | ./MCAL/EF_DIO.d \ 33 | ./MCAL/EF_EEPROM.d \ 34 | ./MCAL/EF_I2C.d \ 35 | ./MCAL/EF_InputCapture.d \ 36 | ./MCAL/EF_PWM.d \ 37 | ./MCAL/EF_SPI.d \ 38 | ./MCAL/EF_SpechialTIMER.d \ 39 | ./MCAL/EF_Timer.d \ 40 | ./MCAL/EF_UART.d 41 | 42 | 43 | # Each subdirectory must supply rules for building sources it contributes 44 | MCAL/%.o: ../MCAL/%.c 45 | @echo 'Building file: $<' 46 | @echo 'Invoking: AVR Compiler' 47 | avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega32 -DF_CPU=8000000UL -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -c -o "$@" "$<" 48 | @echo 'Finished building: $<' 49 | @echo ' ' 50 | 51 | 52 | -------------------------------------------------------------------------------- /Release/RedKitDrivers.eep: -------------------------------------------------------------------------------- 1 | :00000001FF 2 | -------------------------------------------------------------------------------- /Release/RedKitDrivers.elf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/RedKitDrivers.elf -------------------------------------------------------------------------------- /Release/main.d: -------------------------------------------------------------------------------- 1 | main.d main.o: ../main.c ../HAL/EF_Wavecom.h ../HAL/../MCAL/EF_UART.h \ 2 | ../HAL/../MCAL/EF_UART_cfg.h ../HAL/../MCAL/../ServiceLayer/std_types.h \ 3 | ../HAL/../ServiceLayer/std_types.h ../HAL/EF_LCD.h \ 4 | ../HAL/EF_SkyLabGPS.h ../MCAL/EF_PWM.h ../MCAL/EF_pwm_cfg.h \ 5 | ../MCAL/../ServiceLayer/std_types.h ../HAL/EF_LCD.h \ 6 | ../HAL/EF_UltraSonic.h ../MCAL/EF_SpechialTimer.h \ 7 | ../MCAL/EF_SpechialTIMER_cfg.h ../MCAL/EF_Timer.h \ 8 | ../MCAL/EF_Timer_cfg.h ../MCAL/EF_SpechialTIMER.h \ 9 | ../MCAL/EF_InputCapture.h 10 | 11 | ../HAL/EF_Wavecom.h: 12 | 13 | ../HAL/../MCAL/EF_UART.h: 14 | 15 | ../HAL/../MCAL/EF_UART_cfg.h: 16 | 17 | ../HAL/../MCAL/../ServiceLayer/std_types.h: 18 | 19 | ../HAL/../ServiceLayer/std_types.h: 20 | 21 | ../HAL/EF_LCD.h: 22 | 23 | ../HAL/EF_SkyLabGPS.h: 24 | 25 | ../MCAL/EF_PWM.h: 26 | 27 | ../MCAL/EF_pwm_cfg.h: 28 | 29 | ../MCAL/../ServiceLayer/std_types.h: 30 | 31 | ../HAL/EF_LCD.h: 32 | 33 | ../HAL/EF_UltraSonic.h: 34 | 35 | ../MCAL/EF_SpechialTimer.h: 36 | 37 | ../MCAL/EF_SpechialTIMER_cfg.h: 38 | 39 | ../MCAL/EF_Timer.h: 40 | 41 | ../MCAL/EF_Timer_cfg.h: 42 | 43 | ../MCAL/EF_SpechialTIMER.h: 44 | 45 | ../MCAL/EF_InputCapture.h: 46 | -------------------------------------------------------------------------------- /Release/main.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/Release/main.o -------------------------------------------------------------------------------- /Release/makefile: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | -include ../makefile.init 6 | 7 | RM := rm -rf 8 | 9 | # All of the sources participating in the build are defined here 10 | -include sources.mk 11 | -include MCAL/subdir.mk 12 | -include HAL/subdir.mk 13 | -include subdir.mk 14 | -include objects.mk 15 | 16 | ifneq ($(MAKECMDGOALS),clean) 17 | ifneq ($(strip $(ASM_DEPS)),) 18 | -include $(ASM_DEPS) 19 | endif 20 | ifneq ($(strip $(S_DEPS)),) 21 | -include $(S_DEPS) 22 | endif 23 | ifneq ($(strip $(S_UPPER_DEPS)),) 24 | -include $(S_UPPER_DEPS) 25 | endif 26 | ifneq ($(strip $(C_DEPS)),) 27 | -include $(C_DEPS) 28 | endif 29 | endif 30 | 31 | -include ../makefile.defs 32 | 33 | # Add inputs and outputs from these tool invocations to the build variables 34 | LSS += \ 35 | RedKitDrivers.lss \ 36 | 37 | FLASH_IMAGE += \ 38 | RedKitDrivers.hex \ 39 | 40 | EEPROM_IMAGE += \ 41 | RedKitDrivers.eep \ 42 | 43 | SIZEDUMMY += \ 44 | sizedummy \ 45 | 46 | 47 | # All Target 48 | all: RedKitDrivers.elf secondary-outputs 49 | 50 | # Tool invocations 51 | RedKitDrivers.elf: $(OBJS) $(USER_OBJS) 52 | @echo 'Building target: $@' 53 | @echo 'Invoking: AVR C Linker' 54 | avr-gcc -Wl,-Map,RedKitDrivers.map -mmcu=atmega32 -o "RedKitDrivers.elf" $(OBJS) $(USER_OBJS) $(LIBS) 55 | @echo 'Finished building target: $@' 56 | @echo ' ' 57 | 58 | RedKitDrivers.lss: RedKitDrivers.elf 59 | @echo 'Invoking: AVR Create Extended Listing' 60 | -avr-objdump -h -S RedKitDrivers.elf >"RedKitDrivers.lss" 61 | @echo 'Finished building: $@' 62 | @echo ' ' 63 | 64 | RedKitDrivers.hex: RedKitDrivers.elf 65 | @echo 'Create Flash image (ihex format)' 66 | -avr-objcopy -R .eeprom -R .fuse -R .lock -R .signature -O ihex RedKitDrivers.elf "RedKitDrivers.hex" 67 | @echo 'Finished building: $@' 68 | @echo ' ' 69 | 70 | RedKitDrivers.eep: RedKitDrivers.elf 71 | @echo 'Create eeprom image (ihex format)' 72 | -avr-objcopy -j .eeprom --no-change-warnings --change-section-lma .eeprom=0 -O ihex RedKitDrivers.elf "RedKitDrivers.eep" 73 | @echo 'Finished building: $@' 74 | @echo ' ' 75 | 76 | sizedummy: RedKitDrivers.elf 77 | @echo 'Invoking: Print Size' 78 | -avr-size --format=avr --mcu=atmega32 RedKitDrivers.elf 79 | @echo 'Finished building: $@' 80 | @echo ' ' 81 | 82 | # Other Targets 83 | clean: 84 | -$(RM) $(FLASH_IMAGE)$(ELFS)$(OBJS)$(ASM_DEPS)$(EEPROM_IMAGE)$(S_DEPS)$(SIZEDUMMY)$(S_UPPER_DEPS)$(LSS)$(C_DEPS) RedKitDrivers.elf 85 | -@echo ' ' 86 | 87 | secondary-outputs: $(LSS) $(FLASH_IMAGE) $(EEPROM_IMAGE) $(SIZEDUMMY) 88 | 89 | .PHONY: all clean dependents 90 | .SECONDARY: 91 | 92 | -include ../makefile.targets 93 | -------------------------------------------------------------------------------- /Release/objects.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | USER_OBJS := 6 | 7 | LIBS := 8 | 9 | -------------------------------------------------------------------------------- /Release/sources.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | OBJ_SRCS := 6 | S_SRCS := 7 | ASM_SRCS := 8 | C_SRCS := 9 | S_UPPER_SRCS := 10 | O_SRCS := 11 | FLASH_IMAGE := 12 | ELFS := 13 | OBJS := 14 | ASM_DEPS := 15 | EEPROM_IMAGE := 16 | S_DEPS := 17 | SIZEDUMMY := 18 | S_UPPER_DEPS := 19 | LSS := 20 | C_DEPS := 21 | 22 | # Every subdirectory with source files must be described here 23 | SUBDIRS := \ 24 | . \ 25 | MCAL \ 26 | HAL \ 27 | 28 | -------------------------------------------------------------------------------- /Release/subdir.mk: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | # Automatically-generated file. Do not edit! 3 | ################################################################################ 4 | 5 | # Add inputs and outputs from these tool invocations to the build variables 6 | C_SRCS += \ 7 | ../main.c 8 | 9 | OBJS += \ 10 | ./main.o 11 | 12 | C_DEPS += \ 13 | ./main.d 14 | 15 | 16 | # Each subdirectory must supply rules for building sources it contributes 17 | %.o: ../%.c 18 | @echo 'Building file: $<' 19 | @echo 'Invoking: AVR Compiler' 20 | avr-gcc -Wall -Os -fpack-struct -fshort-enums -ffunction-sections -fdata-sections -std=gnu99 -funsigned-char -funsigned-bitfields -mmcu=atmega32 -DF_CPU=8000000UL -MMD -MP -MF"$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -c -o "$@" "$<" 21 | @echo 'Finished building: $<' 22 | @echo ' ' 23 | 24 | 25 | -------------------------------------------------------------------------------- /ServiceLayer/std_types.h: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * Source File: std_types.h 3 | * 4 | * Description: standard data types 5 | * 6 | * History: Version 1.0 - INIT Version 7 | * Date : 25/08/2014 8 | * ------------------------------------------------------- 9 | * Author : EmbeddedFab. 10 | * 11 | * Copyright (C) <2014> 12 | 13 | * This program is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | 18 | * This program is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | 23 | * You should have received a copy of the GNU General Public License 24 | * along with this program. If not, see 25 | 26 | **************************************************************/ 27 | 28 | 29 | #ifndef STD_TYPES_H 30 | #define STD_TYPES_H 31 | 32 | typedef unsigned char BOOLEAN; 33 | 34 | typedef unsigned char U8_t; 35 | typedef char S8_t; 36 | 37 | typedef unsigned int U16_t; 38 | typedef signed int S16_t; 39 | 40 | typedef unsigned long U32_t; 41 | typedef signed long S32_t; 42 | 43 | typedef float FP32; 44 | typedef double FP64; 45 | 46 | typedef int MAINRETURN_t; 47 | 48 | #define BYTE S8_t 49 | #define UBYTE U8_t 50 | 51 | #define WORD S16_t 52 | #define UWORD U16_t 53 | 54 | #define LONG S32_t 55 | #define ULONG U32_t 56 | 57 | #define TRUE 1 58 | #define FALSE 0 59 | 60 | #define FAILURE 0 61 | #define SUCCESS 1 62 | 63 | //#ifndef NULL 64 | #define NULL 0 65 | //#endif 66 | #endif 67 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/EmbeddedFab/EF_AVR_Lib/517e784d4ed94184fddb8f252078e509b9947f8a/main.c --------------------------------------------------------------------------------