SPI library on STM32F401

I made a program for a Teensy 4.0 (worked well) and then I changed the board to a STM32F401 board
I am using the SPI Arduino library
When I go to Verify I get errors when using the black Pill

 SPI.setMOSI(MOSI_pin);
  SPI.setSCK(SCK_pin);
  SPI.begin() ;

I get error message

/Users/michaelburnham/Documents/Arduino/CV_STEP_RECORDER/CV_STEP_RECORDER.ino: In function 'void setup()':
CV_STEP_RECORDER:111:7: error: 'class SPIClass' has no member named 'setSCK'; did you mean 'setSCLK'?
  111 |   SPI.setSCK(SCK_pin);
      |       ^~~~~~
      |       setSCLK
exit status 1
'class SPIClass' has no member named 'setSCK'; did you mean 'setSCLK'?

Firstly why would it behave differently? I presumed that any Library functions programmed in Arduino would be recognised by any Arduino compatible board. Why would the function change from setSCK to setSCLK. And would setSCLK work?

Also further down my code .....

  SPI.beginTransaction (SPISettings( 20000000, MSBFIRST , SPI_MODE0)) ;

    digitalWrite (package_one_cs_pin , LOW) ;
    SPI.transfer16 (dac_one | buffA[playCursor] ) ;
    digitalWrite (package_one_cs_pin , HIGH) ;

    digitalWrite (package_one_cs_pin , LOW) ;
    SPI.transfer16 (dac_two | buffB[playCursor] ) ;
    digitalWrite (package_one_cs_pin , HIGH) ;

    digitalWrite (package_two_cs_pin , LOW) ;
    SPI.transfer16 (dac_three | buffC[playCursor] ) ;
    digitalWrite (package_two_cs_pin , HIGH) ;

    digitalWrite (package_two_cs_pin , LOW) ;
    SPI.transfer16 (dac_four | buffD[playCursor] ) ;
    digitalWrite (package_two_cs_pin , HIGH) ;

    SPI.endTransaction () ;

"beginTransaction" is not highlighted in red as it is when on Teensy board
as well as "SPI.transfer16". Are these functions still going to work as intended?
Should I be using an SPI library that has been updated for STM32F boards?

tardishead:
Firstly why would it behave differently? I presumed that any Library functions programmed in Arduino would be recognised by any Arduino compatible board. Why would the function change from setSCK to setSCLK. And would setSCLK work?

That's not a good assumption. Those types of functions are platform-specific. And, in fact, they are not support on some platforms.

"beginTransaction" is not highlighted in red as it is when on Teensy board
as well as "SPI.transfer16". Are these functions still going to work as intended?
Should I be using an SPI library that has been updated for STM32F boards?

Does it compile error-free? If so, there's a good chance it will work. The definitive way to tell is to examine the SPI Library source code specific to the platform you're using.

gfvalvo:
That's not a good assumption. Those types of functions are platform-specific. And, in fact, they are not support on some platforms.
Does it compile error-free? If so, there's a good chance it will work. The definitive way to tell is to examine the SPI Library source code specific to the platform you're using.

Right. So most basic language works fine but some of the libraries will not work?
I struggle to find any definitive info on google that outlines the compatibility/information.

You used Teensy specific library extensions that are non-standard. Only the official API is common to all boards.

Also, you should be specific about which of the STM32 cores you are using.
There are at least 2 in current use. This is one of the clearer explanations of the current situation: Program "blue pill" with STM32 Cores in Arduino IDE · One Transistor

aarg:
You used Teensy specific library extensions that are non-standard. Only the official API is common to all boards.
SPI - Arduino Reference

Did I? I tried with Arduino IDE not Teensyduino with the same results

I changed SPI.setSCK to SPI.setSCLK and it complies now
I will see if it works

tardishead:
Did I? I tried with Arduino IDE not Teensyduino with the same results

Regardless what IDE you used, setSCK() is not a standard method of the SPI class. Also you didn't answer reply#4 about which STM core you're using.

aarg:
Regardless what IDE you used, setSCK() is not a standard method of the SPI class. Also you didn't answer reply#4 about which STM core you're using.

I am using STM32duino - does that answer your question?
From this link
https://github.com/stm32duino/BoardManagerFiles/raw/master/STM32/package_stm_index.json

Here are the SPI specialities for that core:

There are alternative ways to specify the pins and you even see the keyword highlighting rules.
If you discover an error, you can report it there as an issue.
There is also a web forum for support: https://www.stm32duino.com/