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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

3.4 API<br />

The driver API consists of <strong>the</strong> following functions:<br />

1. <strong>SENT</strong>_<strong>SPC</strong>_Init()<br />

2. <strong>SENT</strong>_<strong>SPC</strong>_Request()<br />

3. <strong>SENT</strong>_<strong>SPC</strong>_Load()<br />

4. <strong>SENT</strong>_<strong>SPC</strong>_Read_Hall()<br />

3.4.1 <strong>SENT</strong>_<strong>SPC</strong>_Init<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 />

Syntax: <strong>SENT</strong>_<strong>SPC</strong>_STATE_T <strong>SENT</strong>_<strong>SPC</strong>_Init(<strong>SENT</strong>_<strong>SPC</strong>_CONTROL_T *pParam);<br />

Reentrancy: Non-reentrant.<br />

Parameters: *pParam — pointer to <strong>the</strong> <strong>SENT</strong>/<strong>SPC</strong> channel configuration structure variable.<br />

Return: 16-bit driver status word.<br />

Description: The function initializes all on-chip peripherals which are required <strong>for</strong> <strong>the</strong> proper generation<br />

of <strong>the</strong> master trigger pulse, <strong>SENT</strong> data reception, <strong>and</strong> processing of <strong>the</strong> selected <strong>SENT</strong>/<strong>SPC</strong><br />

channel data. The function updates <strong>the</strong> internal <strong>SENT</strong>/<strong>SPC</strong> channel 16-bit status word (see<br />

Table 11).<br />

NOTE<br />

Initialization of <strong>the</strong> e200z0 core (<strong>MPC560xP</strong>) <strong>and</strong> <strong>the</strong> e200z4 core(s)<br />

(<strong>MPC564xL</strong>), system clock (PLL_0), motor control clock (PLL_1), on-chip<br />

FLASH memory, SRAM, interrupt controller (INTC), <strong>and</strong> <strong>the</strong> interrupt<br />

vector table is not h<strong>and</strong>led by <strong>the</strong> driver — it is <strong>the</strong> responsibility of <strong>the</strong> user.<br />

3.4.2 <strong>SENT</strong>_<strong>SPC</strong>_Request<br />

Syntax: <strong>SENT</strong>_<strong>SPC</strong>_STATE_T <strong>SENT</strong>_<strong>SPC</strong>_Request(<strong>SENT</strong>_<strong>SPC</strong>_CONTROL_T *pParam,<br />

uint8_t u8MasterTime);<br />

Reentrancy: Non-reentrant.<br />

Parameters: *pParam — pointer to <strong>the</strong> <strong>SENT</strong>/<strong>SPC</strong> channel configuration structure.<br />

u8MasterTime — <strong>the</strong> width of <strong>the</strong> external transistor gate driving pulse in μs.<br />

Return: 16-bit driver status word.<br />

Description: The function generates <strong>the</strong> master trigger pulse on <strong>the</strong> communication line of <strong>the</strong> selected<br />

<strong>SENT</strong>/<strong>SPC</strong> channel via <strong>the</strong> external transistor. The function updates <strong>the</strong> internal <strong>SENT</strong>/<strong>SPC</strong><br />

channel 16-bit status word (see Table 11).<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 15

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

Saved successfully!

Ooh no, something went wrong!