I-Raspberry Pi GPIO Pin enye imisebenzi

NguMike Cook, uJonathan Evans, uBrock Craft

Inxalenye ye Iiprojekthi zeRaspberry Pi zeDummies Cheat Sheet



Izikhonkwane zenjongo-jikelele yokufaka / yokuphuma (GPIO) inokutshintshwa phakathi kwegalelo okanye ukuphuma kwayo kwaye inesixhobo sokutsala okanye sokutsala ezantsi, kodwa kukho uninzi lwezinye izinto ezikwipip Raspberry Pi ezinokuthi zitshintshelwe kwezi izikhonkwane. Ungabona ulungiselelo olusisiseko lwepini enye, i-GPIO 18.



umfanekiso0.jpg

Zonke ezinye izikhonkwane zinolungiselelo olufanayo kodwa ezineebhloko ezahlukeneyo ukukhetha kuzo. Amanani ekutshintsheni lixabiso lerejista enee-bit ezintathu ekufuneka zisetelwe kwingqokelela yeminye imisebenzi ekhetha iirejista. Qaphela ukuba iinombolo ze-Alt zinobudlelwane obuncinci kwiipateni ezincinci ozibekileyo.



ipilisi emhlophe okanye wena 4

Nangona kukho imigca engama-54 ye-GPIO kwiprosesa ye-Raspberry Pi, zingama-28 kuphela ezikhutshelwa kwisinxibelelanisi se-P1 ebhodini (kuncinci kwiimodeli ezingadibananga); Zonke ezinye zisetyenziselwa ukwenza iprosesa ukuba isebenze njengekhompyuter (izinto ezinjengekhadi le-SD, isinxibelelanisi se-USB, kunye nee-LED). Kwiimodeli ze-B + kunye ne-A, unezikhonkwane zokuqala ezingama-28 ze-GPIO; kwiimodeli zangaphambili, une-subset yezi. Uninzi lweemizobo ozifumanayo zikunika kuphela ukhetho lwenye imisebenzi. Apha, uyayibona yonke eminye imisebenzi kunye nalapho ivele khona kwisidibanisi se-GPIO.

umfanekiso1.jpg

Into yokuqala oza kuyibona kukuba zimbini iintlobo zezinto apha: Enye ayinanto kwaye enye inelebhile enje. Kungenzeka ukuba le misebenzi igcinelwe ukuvavanywa kwe-chip okanye imisebenzi engachazwanga kwiphepha ledatha. Ezingenanto azenziwa.



Kwimbali epheleleyo, i I-BCM2835 ye-ARM yeziPhumo uxwebhu kulapho ufuna ukujonga khona, kodwa nantsi ukujonga ngokukhawuleza kweminye imisebenzi:

  • ALT 0: Apho uninzi lweminye imisebenzi enomdla kunye noluncedo ifikelela kwiRaspberry Pi echaphazelekayo. I-SDA kunye ne-SCL 0 kunye no-1 zezi IMbiniIibhasi ze-C, kunye ne-TXD0 kunye ne-RXD0 zonxibelelwano oludityanisiweyo. Imigca ye-GPCLK yimveliso yewotshi ejolise ekujongeni enokuthi isethwe ukuba isebenze kumaza amiselweyo azimeleyo kuyo nayiphi na isoftware. Izikhonkwane ze-PWM zibonelela ngezixhobo ezibubume beplse ezibini; i-SPI 0 yimigca yebhasi ejongene nomda wesiriyeli. Okokugqibela, izikhonkwane ze-PCM zibonelela ngekhowudi yokubetha kwimodyuli yeziphumo.

  • ALT 1: Izikhonkwane zisetyenziswa njengememori yebhasi yesibini. Ngenxa yoyilo lweRaspberry Pi, oku akunamsebenzi kwaphela.

    Ihlala ixesha elingakanani i-amoxicillin
  • ALT 2: Izikhonkwane ze-ALT 2 kuphela ezikhutshiweyo kwi-GPIO pin header zigciniwe.

  • ALT 3: Izikhonkwane eziluncedo kakhulu apha zii-CTS0 kunye ne-RTS0 imigca; le yimigca yokuxhawulana kwemodyuli yemodyuli ukuba uyayifuna. Imigca ye-BSC ye-Broadcom Serial Controller, eyindlela ekhawulezayo mnaMbiniIbhasi ehambelana ne-C exhasa i-7-bit kunye ne-10-bit addressing kunye nexesha elilawulwa ziirejista zangaphakathi. Imigca ye-SD1 mhlawumbi yeyolawulo lwekhadi le-SD, kodwa uxwebhu lwe-BCM2835 ARM Peripherals alwenzi enye into ngalo. Ayisiyondlela iRaspberry Pi efikelela ngayo kwikhadi le-SD.

  • ALT 4: Imigca ye-SPI 1 yibhasi yesibini ye-SPI. Kwaye izikhonkwane zeARM zezonxibelelwano lweJTAG. I-JTAG yindlela yokuthetha kwi-chip ngaphandle kwesoftware kuyo. Isetyenziswa kakhulu kuvavanyo lokuqala kwinkqubo ngexesha lophuhliso, nangona inokusetyenziselwa ukulungisa izixhobo zehardware ngokunjalo.

  • ALT 5: Izikhonkwane eziluncedo apha ziyidatha yesibini yezibuko yedatha kunye nokuxhawulana kwemigca. Imigca ye-PWM iyafana ngokufana nemigca ye-PWM etshintshela kwi-GPIO 12 kunye ne-13 phantsi kwe-ALT 0, kuphela ngeli xesha kutshintshelwe kwi-GPIO 20 kunye ne-21. umqondiso we-ARM JTAG.