├── 0_Uart_driver-20200722T053524Z-001.zip ├── 10_uart_lib_c-20200722T082149Z-001.zip ├── 11_uart_lib_cpp-20200722T082621Z-001.zip ├── 12_systick_driver_c-20200722T082902Z-001.zip ├── 13_systick_lib_c-20200722T083009Z-001.zip ├── 14_systick_lib_cpp-20200722T082904Z-001.zip ├── 1_Led_Class-20200722T053338Z-001.zip ├── 2_Led_Class_part2-20200722T053340Z-001.zip ├── 3_5_Led_Class_Inheritance_cpp-20200722T053214Z-001.zip ├── 3_Led_Class_cpp-20200722T053343Z-001.zip ├── 4_Led_Class_part3_Inheritance-20200722T053244Z-001.zip ├── 5_5_Led_Class_cpp_another_class-20200722T053639Z-001.zip ├── 5_Led_Class_adding_another_class-20200722T053249Z-001.zip ├── 5_Led_polymorphism_c-20200722T073709Z-001.zip ├── 6_5_Led_polymorphism_cpp-20200722T073710Z-001.zip ├── 6_Gpio_driver_c_1-20200722T072954Z-001.zip ├── 6_Gpio_driver_c_2-20200722T073159Z-001.zip ├── 6_Gpio_driver_c_3-20200722T073127Z-001.zip ├── 6_Gpio_driver_lib_c_4-20200722T072956Z-001.zip ├── 7_Gpio_driver_lib_cpp-20200722T081935Z-001.zip ├── 8_Gpio_driver_lib_c_extended-20200722T081721Z-001.zip ├── 9_uart_driver_c-20200722T082234Z-001.zip ├── Gpio_BareMetal-20200722T083253Z-001.zip ├── LICENSE ├── README.md └── lecture19_Notice /0_Uart_driver-20200722T053524Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/0_Uart_driver-20200722T053524Z-001.zip -------------------------------------------------------------------------------- /10_uart_lib_c-20200722T082149Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/10_uart_lib_c-20200722T082149Z-001.zip -------------------------------------------------------------------------------- /11_uart_lib_cpp-20200722T082621Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/11_uart_lib_cpp-20200722T082621Z-001.zip -------------------------------------------------------------------------------- /12_systick_driver_c-20200722T082902Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/12_systick_driver_c-20200722T082902Z-001.zip -------------------------------------------------------------------------------- /13_systick_lib_c-20200722T083009Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/13_systick_lib_c-20200722T083009Z-001.zip -------------------------------------------------------------------------------- /14_systick_lib_cpp-20200722T082904Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/14_systick_lib_cpp-20200722T082904Z-001.zip -------------------------------------------------------------------------------- /1_Led_Class-20200722T053338Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/1_Led_Class-20200722T053338Z-001.zip -------------------------------------------------------------------------------- /2_Led_Class_part2-20200722T053340Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/2_Led_Class_part2-20200722T053340Z-001.zip -------------------------------------------------------------------------------- /3_5_Led_Class_Inheritance_cpp-20200722T053214Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/3_5_Led_Class_Inheritance_cpp-20200722T053214Z-001.zip -------------------------------------------------------------------------------- /3_Led_Class_cpp-20200722T053343Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/3_Led_Class_cpp-20200722T053343Z-001.zip -------------------------------------------------------------------------------- /4_Led_Class_part3_Inheritance-20200722T053244Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/4_Led_Class_part3_Inheritance-20200722T053244Z-001.zip -------------------------------------------------------------------------------- /5_5_Led_Class_cpp_another_class-20200722T053639Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/5_5_Led_Class_cpp_another_class-20200722T053639Z-001.zip -------------------------------------------------------------------------------- /5_Led_Class_adding_another_class-20200722T053249Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/5_Led_Class_adding_another_class-20200722T053249Z-001.zip -------------------------------------------------------------------------------- /5_Led_polymorphism_c-20200722T073709Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/5_Led_polymorphism_c-20200722T073709Z-001.zip -------------------------------------------------------------------------------- /6_5_Led_polymorphism_cpp-20200722T073710Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/6_5_Led_polymorphism_cpp-20200722T073710Z-001.zip -------------------------------------------------------------------------------- /6_Gpio_driver_c_1-20200722T072954Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/6_Gpio_driver_c_1-20200722T072954Z-001.zip -------------------------------------------------------------------------------- /6_Gpio_driver_c_2-20200722T073159Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/6_Gpio_driver_c_2-20200722T073159Z-001.zip -------------------------------------------------------------------------------- /6_Gpio_driver_c_3-20200722T073127Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/6_Gpio_driver_c_3-20200722T073127Z-001.zip -------------------------------------------------------------------------------- /6_Gpio_driver_lib_c_4-20200722T072956Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/6_Gpio_driver_lib_c_4-20200722T072956Z-001.zip -------------------------------------------------------------------------------- /7_Gpio_driver_lib_cpp-20200722T081935Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/7_Gpio_driver_lib_cpp-20200722T081935Z-001.zip -------------------------------------------------------------------------------- /8_Gpio_driver_lib_c_extended-20200722T081721Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/8_Gpio_driver_lib_c_extended-20200722T081721Z-001.zip -------------------------------------------------------------------------------- /9_uart_driver_c-20200722T082234Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/9_uart_driver_c-20200722T082234Z-001.zip -------------------------------------------------------------------------------- /Gpio_BareMetal-20200722T083253Z-001.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PacktPublishing/Embedded-Systems-Object-Oriented-Programming-in-C-and-C--/1290d899a5a6ff8cbf96c1c876a8b53f353a678b/Gpio_BareMetal-20200722T083253Z-001.zip -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Packt 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | # -Embedded-Systems-Object-Oriented-Programming-in-C-and-C++ 5 | A licensed video course that shows how to develop embedded systems using C and C++ 6 | -------------------------------------------------------------------------------- /lecture19_Notice: -------------------------------------------------------------------------------- 1 | Hello everyone, 2 | 3 | In the next lesson if you notice any inconsistency in the LIB_GPIO_Init () function just know that the correct implementation of the function is as shown below. 4 | 5 | void LIB_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init){ 6 | 7 | uint32_t position; 8 | uint32_t ioposition = 0x00U; 9 | uint32_t iocurrent = 0x00U; 10 | uint32_t temp = 0x00U; 11 | 12 | /* Configure the port pins */ 13 | for(position = 0U; position < GPIO_NUMBER; position++) 14 | { 15 | /* Get the IO position */ 16 | ioposition = 0x01U << position; 17 | /* Get the current IO position */ 18 | iocurrent = (uint32_t)(GPIO_Init->Pin) & ioposition; 19 | 20 | if(iocurrent == ioposition) 21 | { 22 | /* Configure IO Direction mode (Input, Output) */ 23 | temp = GPIOx->MODER; 24 | temp &= ~(GPIO_MODER_MODER0 << (position * 2U)); 25 | temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2U)); 26 | GPIOx->MODER = temp; 27 | 28 | /* Activate the Pull-up or Pull down resistor for the current IO */ 29 | temp = GPIOx->PUPDR; 30 | temp &= ~(GPIO_PUPDR_PUPDR0 << (position * 2U)); 31 | temp |= ((GPIO_Init->Pull) << (position * 2U)); 32 | GPIOx->PUPDR = temp; 33 | } 34 | 35 | } 36 | } 37 | --------------------------------------------------------------------------------