main.c

来自「是在Visual dsp++下面进行CAN通信的源代码」· C语言 代码 · 共 33 行

C
33
字号
#include "bf5xx.h"
#include "types.h"

uint8_t databuf[128];
uint8_t txbuf[8];
uint8_t state[2];


void main(void)
{
	int j = 0;
	Set_PLL(20,5);
	Init_EBIU();
	MCP2515_init();
	MCP2515_RST();
	MCP2515_READ_REG(0x00,databuf,128);
	MCP2515_Init();

	for(j=0;j<8;j++)               //生成8字节数据
	{
		txbuf[j]=j;  
	}  
	MCP2515_RX0_Init();          //初始化接收缓冲器
	MCP2515_TX0(txbuf);          //载入要发送的数据

	while(1)
	{
		MCP2515_Send_Enable(1);  //发送寄存器1发送数据允许
		MCP2515_Send_Disable(1); //发送寄存器1停止发送数据
	}
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?