ataradov / mcu-starter-projects

Simple starter projects for bare-metal MCU development
303 stars 41 forks source link

How can I send and receive data via SPI? RP2040 #11

Open firmwarenewbie opened 3 months ago

firmwarenewbie commented 3 months ago

I love the idea of this project, but I'm learning to use the RP2040 and have no idea how, using your starter pack, I can initialize SPI at 10MHz, for example, and send and receive data. Is there any example code?

ataradov commented 3 months ago

There is no example code for this. This is not meant to be a complete framework, just a basic starter project with the startup code and the build system setup.

The way you support any peripheral is the same - read the datasheet and write the code. Use UART as an example template of enabling the clocks and configuring the pins. You can use the low level functions of the official SDK as a reference too.

firmwarenewbie commented 3 months ago

Oh, I understand, I don't have the level for this. It would be great to have more examples for an educational setting like the one I'm in. Thanks anyway!

ataradov commented 3 months ago

Use the official SDK if you need a lot of support. It has a ton of examples and good community support. This project will never deviate from the basic template I'm using here. It is just enough code to quickly start a bare metal project. You have to build the rest yourself.