
Know what board will be used in this course and its components
What document we need to write drivers and how to download them?
What software needed for development environment
How to install Keil uVision 5 - where we will build, download software and debug code
How to install VSCode - a powerful code editor in our course. We will mainly using it to write code.
How to install STLink driver - a driver to communicate with programmer and debugger
How to install Git - A must-know version control tool that helps us save our work safely!
Download and run Hercules - Tool to communicate with USART on the board
Install supported package for the board on Keil uVision 5
Initialize git for the project
"Hello World" project to test the installation and environment setup
Show you basic Git commands
Show the importance of the "Volatile" keyword through examples
Commit "Volatile" code and show you how to switch between commits
Overview architecture of the MCU - Where you can see how processor connects to peripherals through buses
Examples of how the processor writes data to or reads data from peripherals
A simplified version of the MCU architecture that gives a better view of how everything connects inside the MCU.
Bus matrix – an interconnect that directs data between masters and target slaves
The clock system in the MCU that provides the timing for it to operate.
The memory map provides addresses for all components in the MCU, so the processor knows exactly where to access data.
General Purpose Input/Output (GPIO) – a simple yet powerful peripheral for beginners to write their very first embedded driver from scratch.
Inside the output buffer
Inside the input buffer
Input buffer behavior when there is no external connection
Input buffer behavior with pull-up/pull-down resistors
Output buffer behavior in different configurations
How quickly the output buffer changes its signal levels
How GPIO in STM32F407 looks like
How input configuration works in the MCU
How output configuration works in the MCU
How a GPIO pin configured in alternate function mode works
How a GPIO pin configured in analog mode works
Some notes that show you how to learn this section affectively
An overview of all registers in a GPIO peripheral
A register that you can use to configure GPIO pin mode like input, output, alternate function or analog mode
A register that you can use to configure the output type like push-pull or open-drain
A register that you can use to enable or disable pull-up/pull-down register
A register that you can use to set the output speed
A register that you can read input data (0 or 1) of GPIO pins
A register that you can use to set output data (0 or 1) of GPIO pins
A register that you can use to set output data of a specific output pin
You can use this register to lock all configuration registers from modifying
A couple of registers that you can use to set the alternate function for a GPIO pin
How to use structure in C to access a set of registers of a peripheral
Define a GPIO register definition struct to access GPIO registers
Define base address of GPIO ports in the MCU
Define GPIO pin configuration struct to store your GPIO setting before write it to the registers
Define macros for configuration values so your driver is readable
Define basic function prototypes that we will need to run the GPIO driver
Write a GPIO initialization function
Write a GPIO initialization function
Implement a function to write data (0 or 1) to a specific output pin
Implement an application that blink an LED to test driver implementation
Define RCC register definition struct to enable peripheral's clock
Define macros enable peripheral's clock and retest the driver
Configure the Keil so that you can download the code and it will be automatically run
Commit your first driver code
Implement a function to read data (0 or 1) from a specific GPIO input pin
Implement an application to read the state of the User button and control the LED base on input values
Implement a function to toggle the state of a GPIO output pin (0 to 1 or 1 to 0)
Test the implementation of toggle pin function
Commit code and give you a coding challenge
The answer of the challenge
Implement a function to control the output value of a specific GPIO pin at bit level and test it
Implement a function to lock all configuration registers from modifying
Test the implementation of the lock configuration function by locking the GPIO mode register
How to comment your code properly you that you will not forget what you have done in the next few months
An overview of what you will learn in the interrupt sections
What is interrupt and how it works
A table that contents the address of interrupt service routines and IRQ numbers
Provide an overview of how the program responses to an interrupt event
Interrupt with GPIO and components that support GPIO interrupt
Inside the EXTI and how does it connect to the NVIC
Steps to setup interrupt for a GPIO pin
Define SYSCFG register definition struct, which is used to connect GPIO pins and respective EXTI lines.
Define the EXTI register definition struct, which allows you to configure which event will trigger the interrupt.
List down all steps needed to configure the GPIO interrupt
Specify SYSCFG_EXTICR register index
Specify SYSCFG_EXTICR bit position
Give an example of finding SYSCFG_EXTICR register index and bit position
Specify GPIO port to be mapped
Configure the edge trigger selection for the interrupt
Define the NVIC register definition struct for interrupt priority configuration and IRQ enable
Define a function to set interrupt priority for an IRQ number in the NVIC
Define a function to enable IRQ number in the NVIC
The fine macros to represent IRQ numbers
Test the GPIO interrupt with button press event detection and toggle LED state.
Debug the code step by step to find out the problem.
The button press event will trigger the Dino jump action
Master GPIO in Embedded C — Build Your First Driver From Scratch
Want to understand what really happens when you turn an LED on, read a button, or control a microcontroller pin?
If you’re learning Embedded C and feel like libraries and HALs are hiding what’s actually happening inside the hardware, this free course is a great place to start.
In this hands-on course, you’ll learn how GPIO works at the register level and build your own GPIO driver from scratch using Embedded C.
No HAL
No complicated frameworks
No black boxes
Just you, the microcontroller, and the hardware registers
What you’ll learn
By the end of this course, you’ll understand:
What GPIO is and how microcontroller pins actually work
How GPIO peripherals are connected to the CPU
How memory-mapped registers control hardware
How to configure GPIO pins as inputs and outputs
How to read digital inputs such as buttons
How to control outputs such as LEDs
How to manipulate registers directly using Embedded C
How to structure and build your own reusable GPIO driver
How software instructions translate into real hardware behavior
Instead of spending hours reading complicated datasheets or memorizing register names, we’ll break each concept down using clear diagrams, visual explanations, and live coding.
You’ll see the thought process behind the code and understand why each register and bit matters.
Most importantly, you won’t just copy and paste code. You’ll learn how to think like an embedded engineer when working with microcontroller peripherals.
And GPIO is only the beginning...
GPIO is one of the fundamental building blocks of embedded systems.
Once you understand how to control hardware directly through registers, you can apply the same concepts to other peripherals such as UART, timers, interrupts, PWM, and more.
That’s exactly where the full course takes you.
In the complete course, Embedded Driver: Build Drivers and Control Dino Game, you’ll go beyond GPIO and build GPIO, UART, and Timer drivers from scratch. Then, you’ll combine what you’ve learned to control a fun and interactive Dino Game.
So if you’re ready to move beyond simply using libraries and start understanding what’s actually happening inside your microcontroller, start here.
Stop relying on libraries. Start understanding the hardware.
Let’s build your first driver.