8 years, 11 months ago.

SPI programs

Hello. I am looking at the SPI example :

  1. include "mbed.h"

SPI device(SPI_MOSI, SPI_MISO, SPI_SCK);

int main() { int i = 0; while(1) { device.write(0x55); device.write(i++); device.write(0xE0); wait_us(50); } }

and it is a little bit TOO simple. Where can I set up the SPI mode? speed? etc... Can someone tell me where can I find documentation for this (SPI) and others (PWM, GPIO, etc) functions

Thanks

Question relating to:

2 Answers

8 years, 11 months ago.

Look at the SPI.h

8 years, 11 months ago.

Starting from the SPI handbook here, click on mbed lib and go to the API info here.

I ve tried the SPI methods. I got a strange error. When trying the clear_transfer_buffer method I got an error "class SPI has no member clear_transfer_buffer What could be happening here??

Also my program transmit well except the second transmission... wonder why

posted by Cristian Fuentes 24 Dec 2015