00001
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050 #ifndef _CONF_CAN_EXAMPLE_H
00051 #define _CONF_CAN_EXAMPLE_H
00052
00053
00054 #include "avr32/io.h"
00055 #include "compiler.h"
00056 #include "can.h"
00057 #include "board.h"
00058
00059
00060
00061
00062 #define STDIO_USART (&AVR32_USART2)
00063 #define STDIO_USART_RX_PIN AVR32_USART2_RXD_0_1_PIN
00064 #define STDIO_USART_RX_FUNCTION AVR32_USART2_RXD_0_1_FUNCTION
00065 #define STDIO_USART_TX_PIN AVR32_USART2_TXD_0_1_PIN
00066 #define STDIO_USART_TX_FUNCTION AVR32_USART2_TXD_0_1_FUNCTION
00067 #define STDIO_USART_BAUDRATE 57600
00068 #define STDIO_USART_IRQ AVR32_USART2_IRQ
00069 #define STDIO_USART_IRQ_LEVEL AVR32_INTC_INT1
00070 #define FPBA_HZ FOSC0
00071
00072
00073
00074
00075
00076
00077 #if defined (__ICCAVR32__)
00078 can_msg_t msg_tx_sot =
00079 {
00080 0x130,
00081 0x1ff,
00082 0x0102030405060708LL,
00083 };
00084 #else
00085 can_msg_t msg_tx_sot =
00086 {
00087 {
00088 {
00089 .id = 0x130,
00090 .id_mask = 0x1ff,
00091 },
00092 },
00093 .data.u64 = 0x0102030405060708LL,
00094 };
00095 #endif
00096
00097
00098 can_mob_t appli_tx_msg = {
00099 CAN_MOB_NOT_ALLOCATED,
00100 &msg_tx_sot,
00101 8,
00102 CAN_DATA_FRAME,
00103 CAN_STATUS_NOT_COMPLETED
00104 };
00105
00106
00107
00108 #if defined (__ICCAVR32__)
00109 can_msg_t msg_rx_listening =
00110 {
00111 0,
00112 0,
00113 0x0LL,
00114 };
00115 #else
00116 can_msg_t msg_rx_listening =
00117 {
00118 {
00119 {
00120 .id = 0,
00121 .id_mask = 0,
00122 },
00123 },
00124 .data.u64 = 0x0LL,
00125 };
00126 #endif
00127
00128
00129 can_mob_t appli_rx_msg = {
00130 CAN_MOB_NOT_ALLOCATED,
00131 &msg_rx_listening,
00132 8,
00133 CAN_DATA_FRAME,
00134 CAN_STATUS_NOT_COMPLETED
00135 };
00136
00137
00138
00139 #if defined (__ICCAVR32__)
00140 can_msg_t msg_remote_rx = {
00141 0x110,
00142 0x1ff,
00143 0x55AA00000000AA55
00144 };
00145 #else
00146 can_msg_t msg_remote_rx =
00147 {
00148 {
00149 {
00150 .id = 0x110,
00151 .id_mask = 0x1ff,
00152 },
00153 },
00154 .data.u64 = 0x55AA00000000AA55,
00155 };
00156 #endif
00157
00158
00159 can_mob_t appli_remote_rx_msg = {
00160 CAN_MOB_NOT_ALLOCATED,
00161 &msg_remote_rx,
00162 8,
00163 CAN_REMOTE_FRAME,
00164 CAN_STATUS_NOT_COMPLETED
00165 };
00166
00167
00168 const char CAN_Success[] = "\n\r\
00169 === OK: UC3C CAN Communication Successed ===\n\r\
00170 \n\r";
00171
00172 const char CAN_Error[] = "\n\r\
00173 === Error: UC3C CAN Communication Error ===\n\r\
00174 \n\r";
00175
00176 const char CAN_WakeUpIRQ[] = "\n\r\
00177 === Error: UC3C CAN Wake Up IRQ Detected ===\n\r\
00178 \n\r";
00179
00180 const char CAN_BusOFFIRQ[] = "\n\r\
00181 === Error: UC3C CAN Bus OFF IRQ Detected ===\n\r\
00182 \n\r";
00183
00184 const char txt_logo_atmel[]="\r\n\
00185 _____________________________\r\n\
00186 /___ ________________________|\r\n\
00187 ___ | | ________ ____ _\r\n\
00188 / | | | | _ _ \\ | __| | |\r\n\
00189 / /| | | | | | | | | | | |__ | |\r\n\
00190 / / | | | | | | | | | | | __| | |\r\n\
00191 / /_ | | | | | | | | | | | |__ | |__\r\n\
00192 /____||_| |_| |_| |_| |_| |____| |___/\r\n\
00193 ,-----------------------------------,\r\n\
00194 1 - Transmission Mode\r\n\
00195 2 - Reception Mode\r\n\
00196 3 - Remote Reception Mode\r\n\
00197 \r\n\
00198 \n\r";
00199
00200 const char Demo_Sent_Data[] = "\n\r\
00201 -0- TxCAN @ 307: 0x133(Std.), L=8, 01-02-03-04-05-06-07-08; \n\r\
00202 \n\r";
00203
00204 const char Data_Sent_Start_or_Not[] = "\
00205 ===Start demo now? Press y or Y - start\n\r\
00206 === Press n or N - Not start\
00207 \n\r";
00208
00209 #endif // _CONF_CAN_EXAMPLE_H