0% found this document useful (0 votes)
79 views2 pages

Pacservice

This document describes a PAC service that initializes an SSI module to communicate with another device and retrieve data. It includes functions to initialize the SSI connection, respond to interrupts by reading 5 bytes of data, and get each individual byte of data.

Uploaded by

api-310813713
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
79 views2 pages

Pacservice

This document describes a PAC service that initializes an SSI module to communicate with another device and retrieve data. It includes functions to initialize the SSI connection, respond to interrupts by reading 5 bytes of data, and get each individual byte of data.

Uploaded by

api-310813713
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

PACService

PublicFunctions:InitSSI,InterruptPACResponse,GetFirstByte,GetSecondByte,
GetThirdByte,GetFourthByte,GetFifthByte

InitSSI
EnabletheclocktotheGPIOport
EnabletheclocktoSSImodule

WaitfortheGPIOporttobeready
ProgramtheGPIOtousethealternatefunctionsontheSSIpinsA2,A3,A4,A5
SetmuxpositioninGPIOPCTLtoselecttheSSIuseofthepinswrite2to
A2,A3,A4,A5
ProgramtheportlinesfordigitalI/O

ProgramtherequireddatadirectionsontheportlinesforCOMMANDGENERATOR
IfusingSPImode3,programthepullupontheclockline
WaitfortheSSI0tobeready
MakesurethattheSSIisdisabledbeforeprogrammingmodebits
Selectmastermode(MS)&TXRISindicatingEndofTransmit(EOT)
ConfiguretheSSIclocksourcetothesystemclock
Configuretheclockprescaler
Configureclockrate(SCR),phase&polarity(SPH,SPO)
Datasize(DSS)is8bits
ModeFRF
EnableNVIC
Globallyenableinterrupts
EndInitSSI

InterruptPACResponse
Read5bytesfromthedataregister
PostNEW_COMMANDeventtoMasterSM
Disableinterrupt
EndInterruptPACResponse

GetFirstByte
ReturnFirstByte
EndGetFirstByte

GetFirstByte
ReturnFirstByte
EndGetFirstByte

GetSecondByte
ReturnSecondByte
EndGetSecondByte

GetThirdByte
ReturnThirdByte
EndGetThirdByte

GetFourthByte
ReturnFourthByte
EndGetFourthByte

GetFifthByte
ReturnFifthByte

EndGetFifthByte

EndPACService

You might also like