1
0
mirror of https://github.com/arduino/Arduino.git synced 2025-01-18 07:52:14 +01:00

[sam] SPI Fixed modes constants

This commit is contained in:
Cristian Maglie 2012-04-24 18:43:33 +02:00
parent 33870d3aae
commit 45619b4336
3 changed files with 5 additions and 6 deletions

View File

@ -24,7 +24,7 @@ void SPIClass::begin() {
SPI_Configure(spi, id, SPI_MR_MSTR | SPI_MR_PS);
SPI_Enable(spi);
setClockDivider(1);
setDataMode(0);
setDataMode(SPI_MODE0);
}
void SPIClass::addSlave(uint8_t _channel) {

View File

@ -14,10 +14,10 @@
#include "variant.h"
#include <stdio.h>
#define SPI_MODE0 0x00
#define SPI_MODE1 0x01
#define SPI_MODE2 0x02
#define SPI_MODE3 0x03
#define SPI_MODE0 0x02
#define SPI_MODE1 0x00
#define SPI_MODE2 0x03
#define SPI_MODE3 0x01
class SPIClass {
public:

View File

@ -7,7 +7,6 @@ void setup() {
Serial1.begin(9600);
SPI_0.begin();
SPI_0.addSlave(FLASH_SPI_CHAN);
SPI_0.setDataMode(SPI_MODE2, FLASH_SPI_CHAN);
SPI_0.setClockDivider(2); // We are too fast with 1
}