Application CAN Task Management.
Copyright (c) 2014-2018 Microchip Technology Inc. and its subsidiaries.
#include <stddef.h>
#include <stdio.h>
#include <avr32/io.h>
#include "compiler.h"
#include "board.h"
#include "power_clocks_lib.h"
#include "gpio.h"
#include "pm_uc3c.h"
#include "scif_uc3c.h"
#include "print_funcs.h"
#include "can_task.h"
#include "conf_can_task.h"
#include "dsp.h"
#include "conf_demo.h"
Functions | |
void | can_example_prepare_data_to_receive (void) |
CAN Prepare Data to Receive. More... | |
void | can_example_prepare_data_to_send (void) |
Local function to prepare RX and TX buffers. More... | |
void | can_out_callback_channel0 (U8 handle, U8 event) |
CAN Call Back when message is received. More... | |
void | can_out_callback_channel1 (U8 handle, U8 event) |
CAN Call Back when message is transmitted. More... | |
void | can_task (void) |
CAN Task: More... | |
void | can_task_init (void) |
Variables | |
volatile uint16_t | adc_current_conversion |
External reference on ADC Current Conversion. More... | |
volatile bool | message_received_on_channel0 = false |
Boolean for message transmitted on CAN channel 0. More... | |
volatile bool | message_transmitted_on_channel1 = false |
Boolean for message transmitted on CAN channel 1. More... | |
can_msg_t | mob_ram_ch0 [NB_MOB_CHANNEL] |
Local Mob Declaration. More... | |
can_msg_t | mob_ram_ch1 [NB_MOB_CHANNEL] |
A_ALIGNED dsp16_t | signal3_buf [BUFFER_LENGTH] |
Buffer to store ADC Conversions. More... | |
void can_example_prepare_data_to_receive | ( | void | ) |
CAN Prepare Data to Receive.
References can_init(), can_mob_alloc(), can_out_callback_channel0(), can_rx(), CANIF_CHANNEL_MODE_NORMAL, can_mob_t::handle, and pCANMOB_message2.
Referenced by can_task(), and can_task_init().
void can_example_prepare_data_to_send | ( | void | ) |
Local function to prepare RX and TX buffers.
CAN Prepare Data to Send.
References adc_current_conversion, CAN_CMD_REFUSED, can_init(), can_mob_alloc(), can_mob_t::can_msg, can_out_callback_channel1(), can_tx(), CANIF_CHANNEL_MODE_NORMAL, can_msg_t::data, can_mob_t::handle, pCANMOB_message0, and Union64::u8.
Referenced by can_task(), and can_task_init().
CAN Call Back when message is received.
Call Back called by can_drv.
References can_get_mob_data(), can_get_mob_dlc(), can_get_mob_id(), can_mob_free(), can_mob_t::can_msg, can_msg_t::data, can_mob_t::dlc, gpio_tgl_gpio_pin(), can_msg_t::id, message_received_on_channel0, pCANMOB_message2, can_mob_t::status, and Union64::u64.
Referenced by can_example_prepare_data(), can_example_prepare_data_to_receive(), and main().
CAN Call Back when message is transmitted.
References can_mob_free(), gpio_tgl_gpio_pin(), and message_transmitted_on_channel1.
Referenced by can_example_prepare_data_to_send().
void can_task | ( | void | ) |
CAN Task:
References BUFFER_LENGTH, can_example_prepare_data_to_receive(), can_example_prepare_data_to_send(), can_mob_t::can_msg, can_msg_t::data, i, message_received_on_channel0, message_transmitted_on_channel1, pCANMOB_message2, signal3_buf, and Union64::u8.
Referenced by main().
void can_task_init | ( | void | ) |
References can_example_prepare_data_to_receive(), can_example_prepare_data_to_send(), gpio_enable_module(), scif_gc_enable(), scif_gc_setup(), and SCIF_GCCTRL_OSC0.
Referenced by main().
volatile uint16_t adc_current_conversion |
External reference on ADC Current Conversion.
Referenced by adc_process_task(), and can_example_prepare_data_to_send().
Boolean for message transmitted on CAN channel 0.
Referenced by can_out_callback_channel0(), and can_task().
Boolean for message transmitted on CAN channel 1.
Referenced by can_out_callback_channel1(), and can_task().
can_msg_t mob_ram_ch0[NB_MOB_CHANNEL] |
Local Mob Declaration.
can_msg_t mob_ram_ch1[NB_MOB_CHANNEL] |
A_ALIGNED dsp16_t signal3_buf[BUFFER_LENGTH] |
Buffer to store ADC Conversions.
Referenced by can_task(), and gui_task().