lin_task.h File Reference


Detailed Description

Lin Task.

Author:
Atmel Corporation: http://www.atmel.com
Support and FAQ: http://support.atmel.no/

Definition in file lin_task.h.

Go to the source code of this file.

Functions

void lin_task (void)
 LIN Task
  • Update LIN Message content (message to be sent).

void lin_task_init (void)
 LIN Task Init
  • Initialize Node 0 and Node 1
  • Initialize lin messages (lin_descriptor)
  • Start Sequencer.

void lin_task_restart (void)
 LIN Task Restart.
void lin_task_stop (void)
 LIN Task Stop.


Function Documentation

void lin_task ( void   ) 

LIN Task

  • Update LIN Message content (message to be sent).

Definition at line 205 of file lin_task.c.

References BUFFER_LENGTH, and signal2_buf.

Referenced by main().

00206 {
00207     int i;
00208     int value;
00209     for (i=BUFFER_LENGTH-1;i>=1;i--)
00210     {
00211         signal2_buf[i] = signal2_buf[i-1];
00212     }
00213     value = (lin_descript_list_node1[0].l_pt_data[0]<<8)|(lin_descript_list_node1[1].l_pt_data[1]);
00214     signal2_buf[0] = ( value*0x20) - 0x8000;
00215 }

void lin_task_init ( void   ) 

LIN Task Init

  • Initialize Node 0 and Node 1
  • Initialize lin messages (lin_descriptor)
  • Start Sequencer.

Definition at line 169 of file lin_task.c.

References lin_data_in_node1, lin_data_out_node0, lin_master_cb_task_ID12(), lin_slave_task_ID12(), and start_scheduler().

Referenced by main().

00170 {
00171   // USART LIN options.
00172   // Node 0:  LIN_MASTER_MODE
00173   lin_init (TRUE,0,9600,FOSC0);
00174 
00175   // Node 1:  LIN_SLAVE_MODE
00176   lin_init (FALSE,1,9600,FOSC0);
00177 
00178   // Configure lin_descriptor
00179   //- Init LIN data Node 0
00180   // Object 0
00181   lin_descript_list_node0[0].l_id = 0x22;
00182   lin_descript_list_node0[0].l_dlc = 8;
00183   lin_descript_list_node0[0].l_cmd = PUBLISH;
00184   lin_descript_list_node0[0].l_status = 0;
00185   lin_descript_list_node0[0].l_pt_data = lin_data_out_node0;
00186   lin_descript_list_node0[0].l_pt_function = lin_master_cb_task_ID12;
00187 
00188   // Configure lin_descriptor
00189   //- Init LIN data Node 1
00190   // Object 0
00191   lin_descript_list_node1[0].l_id = 0x22;
00192   lin_descript_list_node1[0].l_dlc = 8;
00193   lin_descript_list_node1[0].l_cmd = SUBSCRIBE;
00194   lin_descript_list_node1[0].l_status = 0;
00195   lin_descript_list_node1[0].l_pt_data = (U8 *)lin_data_in_node1;
00196   lin_descript_list_node1[0].l_pt_function = lin_slave_task_ID12;
00197 
00198   // In case of Master Mode, the timing transmission starts...
00199   start_scheduler();
00200 }

void lin_task_restart ( void   ) 

LIN Task Restart.

Definition at line 223 of file lin_task.c.

00224 {
00225     Disable_global_interrupt();
00226     lin_init (FALSE,1,9600,FOSC0);
00227     Enable_global_interrupt();
00228 }

void lin_task_stop ( void   ) 

LIN Task Stop.

Definition at line 218 of file lin_task.c.

00219 {
00220 }


Generated on Fri Feb 19 02:22:37 2010 for AVR32 - CAN LIN LOOPBACKS Demo. by  doxygen 1.5.5