#include <avr32/io.h>
#include "compiler.h"
#include "board.h"
#include "power_clocks_lib.h"
#include "gpio.h"
#include "tc.h"
#include "intc.h"
#include "usart.h"
#include "lin.h"
Macros | |
#define | FPBA FOSC0 |
PBA Clock Reference. More... | |
#define | TC_CHANNEL 0 |
Timer Counter Channel Used. More... | |
#define | TC_INSTANCE &AVR32_TC0 |
#define | TC_INSTANCE_IRQ AVR32_TC0_IRQ0 |
#define | TC_INSTANCE_IRQ_GROUP AVR32_TC0_IRQ_GROUP |
Functions | |
void | lin_master_task_ID12 (void) |
Lin Master Task linked to the transmission of the message with the ID 0x12. More... | |
void | lin_master_task_ID15 (void) |
Lin Master Task linked to the transmission of the message with the ID 0x15. More... | |
void | lin_slave_task_ID12 (U8 *d_buf) |
Lin Slave Task linked to the reception of the message with the ID 0x12. More... | |
void | lin_slave_task_ID15 (U8 *d_buf) |
Lin Slave Task linked to the reception of the message with the ID 0x15. More... | |
int | main (void) |
This is an example demonstrating the LIN mode of USART IP functionalities using a dedicated USART LIN driver. More... | |
void | start_scheduler (void) |
Start Scheduler: Configuration of dedicated timer for periodic LIN transmission. More... | |
static void | tc_irq (void) |
TC interrupt. More... | |
Variables | |
U8 | lin_data_in_node0 [8] |
Local Buffer for emission. More... | |
U8 | lin_data_out_node0 [8] |
Local Buffer for transmission. More... | |
volatile unsigned char | task_id = 0 |
Current Task Id used for the scheduled table. More... | |
#define FPBA FOSC0 |
PBA Clock Reference.
Referenced by start_scheduler().
#define TC_CHANNEL 0 |
Timer Counter Channel Used.
Referenced by start_scheduler(), and tc_irq().
#define TC_INSTANCE &AVR32_TC0 |
Referenced by start_scheduler(), and tc_irq().
#define TC_INSTANCE_IRQ AVR32_TC0_IRQ0 |
Referenced by start_scheduler().
#define TC_INSTANCE_IRQ_GROUP AVR32_TC0_IRQ_GROUP |
void lin_master_task_ID12 | ( | void | ) |
Lin Master Task linked to the transmission of the message with the ID 0x12.
lin_master_task_ID12
void lin_master_task_ID15 | ( | void | ) |
Lin Master Task linked to the transmission of the message with the ID 0x15.
lin_master_task_ID15
References lin_descript_list_node0, and lin_send_cmd().
Referenced by tc_irq().
void lin_slave_task_ID12 | ( | U8 * | d_buf | ) |
Lin Slave Task linked to the reception of the message with the ID 0x12.
lin_slave_task_ID12
void lin_slave_task_ID15 | ( | U8 * | d_buf | ) |
Lin Slave Task linked to the reception of the message with the ID 0x15.
lin_slave_task_ID15
References gpio_tgl_gpio_pin().
Referenced by main().
int main | ( | void | ) |
This is an example demonstrating the LIN mode of USART IP functionalities using a dedicated USART LIN driver.
References Enable_global_interrupt, INTC_init_interrupts(), st_lin_message::l_cmd, st_lin_message::l_dlc, st_lin_message::l_id, st_lin_message::l_pt_data, st_lin_message::l_pt_function, st_lin_message::l_status, lin_data_in_node0, lin_data_out_node0, lin_descript_list_node0, lin_init(), lin_slave_task_ID12(), lin_slave_task_ID15(), PCL_OSC0, pcl_switch_to_osc(), PUBLISH, start_scheduler(), and SUBSCRIBE.
void start_scheduler | ( | void | ) |
Start Scheduler: Configuration of dedicated timer for periodic LIN transmission.
References tc_waveform_opt_t::channel, tc_interrupt_t::etrgs, FPBA, INTC_register_interrupt(), tc, TC_CHANNEL, TC_CLOCK_SOURCE_TC5, tc_configure_interrupts(), TC_EVT_EFFECT_NOOP, tc_init_waveform(), TC_INSTANCE, TC_INSTANCE_IRQ, tc_irq(), TC_SEL_NO_EDGE, tc_start(), TC_WAVEFORM_SEL_UP_MODE_RC_TRIGGER, and tc_write_rc().
|
static |
TC interrupt.
References lin_master_task_ID12(), lin_master_task_ID15(), task_id, TC_CHANNEL, TC_INSTANCE, and tc_read_sr().
Referenced by start_scheduler().
U8 lin_data_out_node0[8] |
Local Buffer for transmission.
volatile unsigned char task_id = 0 |
Current Task Id used for the scheduled table.