Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Do you use C++ for device drivers in embedded systems?

Joined
Mar 14, 2022
Messages
3
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
56
Do you use C++ for low level device drivers like accessing registers of peripherals like UART, I2C, GPIO, 1-WIRE, hardware timers etc... ?

Also, just to clarify, by embedded system I mean Cortex-M0, M3/4 devices etc... not Cortex-A or any equivalent that can run embedded linux.
 

doraemon

Super Moderator
Staff member
Joined
Jun 21, 2009
Messages
1,161
Helped
284
Reputation
576
Reaction score
274
Trophy points
1,363
Location
Japan
Activity points
11,730
Hello!
I do!
When properly done, there is no speed penalty. Basically configuring a peripheral is just about writing configs.
For instance if you configure a SPI port, you will write register specifying its speed, polarity, phase, etc. So first
for the configuration, writing it in assembler, C or C++ doesn't change anything.
Next, as for exchanging data, everything is made by the hardware, therefore there is no speed issue either.
I usually setup the hardware to use DMA, so I get a callback function called when a buffer is ready.
But I suppose you will have as many different opinions as there are users on this site.

Dora.
 

LaTeX Commands Quick-Menu:

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top