The contents of SPI.h library

Hi,
I am writing some code for testing some other hardware.
I want to change the functionality of few functions.

For example: SPISettings settingsA(8000000, MSBFIRST, SPI_MODE2);

I want to change the functionality so that it is also working with 10 MHz.

The question is: I was searching where is this library and how can I change it. I just want to change this function and related functionalities.

Help is needed.

The source code is on your computer, but where it is depends on the type of computer and how you installed the Arduino IDE.

The library comes with the IDE and is with all the others. You will probably need a dedicated editor like NP++ to work on it. NP++ is a freebie.

tahirsengine:
Hi,
I am writing some code for testing some other hardware.
I want to change the functionality of few functions.

For example: SPISettings settingsA(8000000, MSBFIRST, SPI_MODE2);

I want to change the functionality so that it is also working with 10 MHz.
I just want to change this function and related functionalities.

Help is needed.

No need to change the library, just use this in your programs;

SPI.begin();
SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE2));

srnet:
No need to change the library, just use this in your programs;

SPI.begin();
SPI.beginTransaction(SPISettings(10000000, MSBFIRST, SPI_MODE2));

Really? Will it work on 10MHz as well?
The reason why I am asking this question is because I somewhere read that we can not use it at frequencies divided by 2,4,8.... So for Arduino UNO, 10MHz doesnt fall into this range.

Can you please shed some light on it.

The 10000000 defines the max setting and whether SPI will run at that speed depends on the Arduino you are using and you did not reveal that until post #4, always a good idea to tell people from the start which Arduino you are using.

A UNO runs a 16Mhz CPU clock, so can be set to SPISettings(16000000, but SPISettings(10000000 will result in it running at 8Mhz.

Nick_Pyner:
The library comes with the IDE and is with all the others. You will probably need a dedicated editor like NP++ to work on it. NP++ is a freebie.

Thanks for reply. Can you please guide how to locate a particular library and change the functionality of different functions in IDE.

srnet:
The 10000000 defines the max setting and whether SPI will run at that speed depends on the Arduino you are using and you did not reveal that until post #4, always a good idea to tell people from the start which Arduino you are using.

A UNO runs a 16Mhz CPU clock, so can be set to SPISettings(16000000, but SPISettings(10000000 will result in it running at 8Mhz.

Thanks for reply. Actually I have still not bought any board. UNO was in my mind, but want to be sure before buying. Is it possible to achieve this exact 10MHz speed on any other Arduino Board?

tahirsengine:
Thanks for reply. Can you please guide how to locate a particular library and change the functionality of different functions in IDE.

As I said, the library is with all the other libraries, i.e. in
\libraries,
and you change the functionality by editing the text using the NP++ editor I referred to.

Since you are asking these questions, I think you should also question whether you actually need to do this.

I think you should also question whether you actually need to do this.

Certainly not until the hardware is in hand, and an actual problem arises.

This is a pointless theoretical discussion.