03.08.2013 Views

SENT/SPC Driver for the MPC560xP and MPC564xL Microcontroller ...

SENT/SPC Driver for the MPC560xP and MPC564xL Microcontroller ...

SENT/SPC Driver for the MPC560xP and MPC564xL Microcontroller ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

}<br />

ui16Error_ch0 = <strong>SENT</strong>_<strong>SPC</strong>_Init(&ch0);<br />

ui16Error_ch1 = <strong>SENT</strong>_<strong>SPC</strong>_Init(&ch1);<br />

<strong>SENT</strong>/<strong>SPC</strong> software driver <strong>for</strong> <strong>the</strong> <strong>MPC560xP</strong> <strong>and</strong> <strong>MPC564xL</strong><br />

PIT_0_Init(0x12C00); /* Enable PIT_0 with 1.2 ms period */<br />

ui16Error_ch0 = <strong>SENT</strong>_<strong>SPC</strong>_Request(&ch0,<strong>SPC</strong>_SYNCH);<br />

ui16Error_ch1 = <strong>SENT</strong>_<strong>SPC</strong>_Request(&ch1,<strong>SPC</strong>_SYNCH);<br />

while (1)<br />

{<br />

} /* Wait <strong>for</strong>ever */<br />

__interrupt void Periodically(void)<br />

{<br />

PIT.CH[0].TFLG.R = 0x00000001;<br />

}<br />

ui16Error_ch0 = <strong>SENT</strong>_<strong>SPC</strong>_Load(&ch0);<br />

<strong>SENT</strong>_<strong>SPC</strong>_Read_Hall(&ch0,&ui16Nibble_hall_ch0,&ui8Nibble_status_ch0);<br />

ui16Error_ch0 = <strong>SENT</strong>_<strong>SPC</strong>_Request(&ch0,<strong>SPC</strong>_SYNCH);<br />

ui16Error_ch1 = <strong>SENT</strong>_<strong>SPC</strong>_Load(&ch1);<br />

<strong>SENT</strong>_<strong>SPC</strong>_Read_Hall(&ch1,&ui16Nibble_hall_ch1,&ui8Nibble_status_ch1);<br />

ui16Error_ch1 = <strong>SENT</strong>_<strong>SPC</strong>_Request(&ch1,<strong>SPC</strong>_SYNCH);<br />

INTC.EOIR.R = 0x0; /* Exit Interrupt (End-of-Interrupt Register) */<br />

<strong>SENT</strong>/<strong>SPC</strong> <strong>Driver</strong> <strong>for</strong> <strong>the</strong> <strong>MPC560xP</strong> <strong>and</strong> <strong>MPC564xL</strong> <strong>Microcontroller</strong> Families, Rev. 0<br />

Freescale Semiconductor 29

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!