@@ -120,6 +120,16 @@ A class of SPI implementation for Ameba.
120
120
+---------------------------------+------------------------------------------+
121
121
| SPIClass::end | Stop SPI master mode |
122
122
+---------------------------------+------------------------------------------+
123
+ | SPIClass::slaveRead | Slave receive one frame use SPI |
124
+ +---------------------------------+------------------------------------------+
125
+ | SPIClass::slaveWrite | Slave send one frame use SPI |
126
+ +---------------------------------+------------------------------------------+
127
+ | SPIClass::masterWrite | Master send one frame use SPI |
128
+ +---------------------------------+------------------------------------------+
129
+ | SPIClass::pSpiMaster | Pointer of SPI master project |
130
+ +---------------------------------+------------------------------------------+
131
+ | SPIClass::pSpiSlave | Pointer of SPI slave project |
132
+ +---------------------------------+------------------------------------------+
123
133
124
134
**SPIClass::SPIClass **
125
135
----------------------
519
529
NA
520
530
521
531
.. note :: After calling end(), you need to use begin() again to enable SPI function. "SPI.h" must be included to use the class function.
532
+
533
+ **SPIClass::slaveRead **
534
+ -----------------
535
+
536
+ **Description **
537
+ ~~~~~~~~~~~~~~~
538
+
539
+ This function retrieves data from receive buffer as slave. Slave receive one frame use SPI.
540
+
541
+ **Syntax **
542
+ ~~~~~~~~~~
543
+
544
+ .. code-block :: c++
545
+
546
+ int slaveRead(void);
547
+
548
+ **Parameters **
549
+ ~~~~~~~~~~~~~~
550
+
551
+ NA
552
+
553
+ **Returns **
554
+ ~~~~~~~~~~~
555
+
556
+ This function returns the data received from master.
557
+
558
+ **Example Code **
559
+ ~~~~~~~~~~~~~~~~
560
+
561
+ NA
562
+
563
+ .. note :: "SPI.h" must be included to use the class function.
564
+
565
+ **SPIClass::slaveWrite **
566
+ -----------------
567
+
568
+ **Description **
569
+ ~~~~~~~~~~~~~~~
570
+
571
+ This function use slave send one frame use SPI.
572
+
573
+ **Syntax **
574
+ ~~~~~~~~~~
575
+
576
+ .. code-block :: c++
577
+
578
+ void slaveWrite(int value);
579
+ void slaveWrite(spi_t *pSpiObj, int value);
580
+
581
+ **Parameters **
582
+ ~~~~~~~~~~~~~~
583
+
584
+ value: the data to transmit
585
+
586
+ pSpiObj: spi slave object define in application software
587
+
588
+ **Returns **
589
+ ~~~~~~~~~~~
590
+
591
+ NA
592
+
593
+ **Example Code **
594
+ ~~~~~~~~~~~~~~~~
595
+
596
+ NA
597
+
598
+ .. note :: "SPI.h" must be included to use the class function.
599
+
600
+ **SPIClass::masterWrite **
601
+ -----------------
602
+
603
+ **Description **
604
+ ~~~~~~~~~~~~~~~
605
+
606
+ This function use master send one frame use SPI.
607
+
608
+ **Syntax **
609
+ ~~~~~~~~~~
610
+
611
+ .. code-block :: c++
612
+
613
+ int masterWrite(int value);
614
+
615
+ **Parameters **
616
+ ~~~~~~~~~~~~~~
617
+
618
+ value: the data to transmit
619
+
620
+ **Returns **
621
+ ~~~~~~~~~~~
622
+
623
+ This function returns the data received from slave.
624
+
625
+ **Example Code **
626
+ ~~~~~~~~~~~~~~~~
627
+
628
+ NA
629
+
630
+ .. note :: "SPI.h" must be included to use the class function.
631
+
632
+ **SPIClass::pSpiMaster **
633
+ -----------------
634
+
635
+ **Description **
636
+ ~~~~~~~~~~~~~~~
637
+
638
+ It is a pointer of SPI master project.
639
+
640
+ **Syntax **
641
+ ~~~~~~~~~~
642
+
643
+ .. code-block :: c++
644
+
645
+ spi_t *pSpiMaster;
646
+
647
+ **Parameters **
648
+ ~~~~~~~~~~~~~~
649
+
650
+ NA
651
+
652
+ **Returns **
653
+ ~~~~~~~~~~~
654
+
655
+ NA
656
+
657
+ **Example Code **
658
+ ~~~~~~~~~~~~~~~~
659
+
660
+ NA
661
+
662
+ .. note :: "SPI.h" must be included to use the class function.
663
+
664
+ **SPIClass::pSpiMaster **
665
+ -----------------
666
+
667
+ **Description **
668
+ ~~~~~~~~~~~~~~~
669
+
670
+ It is a pointer of SPI slave project.
671
+
672
+ **Syntax **
673
+ ~~~~~~~~~~
674
+
675
+ .. code-block :: c++
676
+
677
+ spi_t *pSpiSlave;
678
+
679
+ **Parameters **
680
+ ~~~~~~~~~~~~~~
681
+
682
+ NA
683
+
684
+ **Returns **
685
+ ~~~~~~~~~~~
686
+
687
+ NA
688
+
689
+ **Example Code **
690
+ ~~~~~~~~~~~~~~~~
691
+
692
+ NA
693
+
694
+ .. note :: "SPI.h" must be included to use the class function.
0 commit comments