C Language Flashcards
What are the main topics covered in Advanced C Programming?
Arrays, Structures, Pointers, Pointers to Structures.
What is a one-dimensional array in C?
A contiguous block of memory storing elements of the same type, e.g., int x[100];
What is a two-dimensional array in C?
An array of arrays; e.g., float mydata[8][25]; representing 200 float elements.
What is a structure in C?
A user-defined data type that groups variables of different types under one name.
How is a structure defined and used in C?
Using the struct keyword; memory is only allocated when variables are created.
How does typedef simplify structures in C?
It creates an alias for the structure type, making code cleaner.
What are the advantages of using pointers in C?
Efficient data handling, dynamic memory, direct memory access, and complex data structures.
What is the address (&) operator in C?
A unary operator that returns the memory address of its operand.
What is the indirection (*) operator in C?
A unary operator that accesses the value stored at the pointer’s address.
What does *p mean if p is a pointer?
It accesses the value pointed to by p.
Why use pointers to structures?
For efficient function calls, dynamic allocation, external access, and multiple return values.
How do you access structure members via pointers?
Use the ‘->’ operator; e.g., ptr->member is equivalent to (*ptr).member.
What does the output of the pointer-to-structure example show?
Structure members are accessed and modified via pointers using -> operator.
What is the STM32 chip used in EE2028?
STM32L475VG on the B-L475E-IOT01A1 board.
What does a generic computer system diagram include?
Processor, RAM, Flash, Bus, external interfaces (USB, HDMI), internal peripherals.
What is a multi-tiered bus architecture?
High-speed and low-speed peripherals connected via separate buses with bridges.
What are the types of peripherals on STM32?
Core peripherals, on-chip peripherals, external devices on board.
How does software interact with hardware on STM32?
By reading/writing peripheral registers like memory.
What are the three types of peripheral registers?
Status (read), Control (write), Data (read/write).
Where to find information on peripheral registers?
Reference manuals, datasheets on Canvas > Files > Labs.
How do libraries abstract peripheral access in C?
Using functions that internally manipulate pointers to registers.
What is the difference between MMIO and PMIO?
MMIO uses shared address space with memory; PMIO uses separate address spaces.
What is the difference between parallel and serial protocols?
Parallel uses multiple wires; serial transmits data one bit at a time.
What is bus skew in parallel protocols?
Signal timing differences due to wire length or properties.