PIC und XC32

Gast #4003560
Lesenswert?

Guten Morgen,
ich versuche mich gerade mit der für mich neuen Programmierumgebung 
MPLABX und XC32.
Ich bin mir hier nicht ganz sicher, wenn ich jetzt Daten vom Slave holen 
will (mit der unteren Funktion) ob ich noch einen Takt herausschicken 
muss oder wird das hier automatisch generiert.
Würde mich sehr über eine Hilfe freuen.
1
/*********************************************************************
2
 * Function:        unsigned int SpiChnGetC(SpiChannel chn)
3
 *
4
 * PreCondition:    None
5
 *
6
 * Input:           chn         - the channel to check
7
 *
8
 * Output:          data available in the SPI rx buffer
9
 *
10
 * Side Effects:    None
11
 *
12
 * Overview:        This function waits for data to be available and returns it.
13
 *
14
 * Note:            When a new data word has been shifted into shift register SPIxSR and:
15
 *                  - in standard mode: the previous contents of receive register SPIxRXB have not been read
16
 *                  - in FIFO mode: the FIFO is full
17
 *                  then the Rx Overflow (SPIROV) bit will be set.
18
 *                  The module will not transfer the received data from SPIxSR to the SPIxRXB (FIFO).
19
 *                  Further data reception is disabled until the SPIROV bit is cleared.
20
 *                  The SPIROV bit is not cleared automatically by the module and must be
21
 *                  cleared by the user software (using SpiChnGetRov()).
22
 *
23
 * Example:         unsigned int newData=SpiChnGetC(SPI_CHANNEL2);
24
 ********************************************************************/
25
unsigned int        SpiChnGetC(SpiChannel chn);


Gruß Stefan

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren