File tree Expand file tree Collapse file tree 6 files changed +11
-15
lines changed
libraries/CurieSerialFlash/examples Expand file tree Collapse file tree 6 files changed +11
-15
lines changed Original file line number Diff line number Diff line change 8181#define BYTE_ESCAPE 0x7d
8282#define BYTE_SEPARATOR 0x7c
8383
84- #define CSPIN 21
85-
8684void setup (){
8785 Serial.begin (9600 ); // Teensy serial is always at full USB speed and buffered... the baud rate here is required but ignored
8886
8987 pinMode (13 , OUTPUT);
9088
91- SerialFlash.begin (SPI1, CSPIN );
89+ SerialFlash.begin (ONBOARD_FLASH_SPI_PORT, ONBOARD_FLASH_CS_PIN );
9290
9391 // We start by formatting the flash...
9492 uint8_t id[5 ];
Original file line number Diff line number Diff line change 33#include < CurieSerialFlash.h>
44#include < SPI.h>
55
6- const int FlashChipSelect = 21 ; // digital pin for flash chip CS pin
7-
86SerialFlashFile file;
97
108const unsigned long testIncrement = 4096 ;
@@ -26,7 +24,7 @@ void setup() {
2624 while (!Serial && (millis () - startMillis < 10000 )) ;
2725 delay (100 );
2826
29- SerialFlash.begin (SPI1, FlashChipSelect );
27+ SerialFlash.begin (ONBOARD_FLASH_SPI_PORT, ONBOARD_FLASH_CS_PIN );
3028 unsigned char id[5 ];
3129 SerialFlash.readID (id);
3230 unsigned long size = SerialFlash.capacity (id);
Original file line number Diff line number Diff line change 88const char *filename = " myfile.txt" ;
99const char *contents = " 0123456789ABCDEF" ;
1010
11- const int FlashChipSelect = 21 ; // digital pin for flash chip CS pin
12-
1311void setup () {
1412 Serial.begin (9600 );
1513
@@ -18,7 +16,7 @@ void setup() {
1816 delay (100 );
1917
2018 // Init. SPI Flash chip
21- if (!SerialFlash.begin (SPI1, FlashChipSelect )) {
19+ if (!SerialFlash.begin (ONBOARD_FLASH_SPI_PORT, ONBOARD_FLASH_CS_PIN )) {
2220 Serial.println (" Unable to access SPI Flash chip" );
2321 }
2422
Original file line number Diff line number Diff line change 33#include < CurieSerialFlash.h>
44#include < SPI.h>
55
6- const int FlashChipSelect = 21 ; // digital pin for flash chip CS pin
7-
86void setup () {
97 // uncomment these if using Teensy audio shield
108 // SPI.setSCK(14); // Audio shield has SCK on pin 14
@@ -22,7 +20,7 @@ void setup() {
2220 delay (100 );
2321 Serial.println (" All Files on SPI Flash chip:" );
2422
25- if (!SerialFlash.begin (SPI1, FlashChipSelect )) {
23+ if (!SerialFlash.begin (ONBOARD_FLASH_SPI_PORT, ONBOARD_FLASH_CS_PIN )) {
2624 error (" Unable to access SPI Flash chip" );
2725 }
2826
Original file line number Diff line number Diff line change 2525#include < CurieSerialFlash.h>
2626#include < SPI.h>
2727
28- const int FlashChipSelect = 21 ; // digital pin for flash chip CS pin
29-
3028SerialFlashFile file;
3129
3230const unsigned long testIncrement = 4096 ;
@@ -48,7 +46,7 @@ void setup() {
4846 delay (100 );
4947
5048 Serial.println (" Raw SerialFlash Hardware Test" );
51- SerialFlash.begin (SPI1, FlashChipSelect );
49+ SerialFlash.begin (ONBOARD_FLASH_SPI_PORT, ONBOARD_FLASH_CS_PIN );
5250
5351 if (test ()) {
5452 Serial.println ();
Original file line number Diff line number Diff line change @@ -113,6 +113,12 @@ extern "C"{
113113 * ADC
114114 */
115115
116+ /*
117+ * ONBOARD SPI FLASH
118+ */
119+ #define ONBOARD_FLASH_SPI_PORT SPI1
120+ #define ONBOARD_FLASH_CS_PIN 21
121+
116122/* EAI ADC device registers */
117123#define ADC_SET (0x80015000)
118124#define ADC_DIVSEQSTAT (0x80015001)
You can’t perform that action at this time.
0 commit comments