port_init.c~
来自「使用cs5512做的电子秤,精度0.002kg」· C~ 代码 · 共 33 行
C~
33 行
#include <config.h>
void Port_Init(void) //端口配置
{
DDRA=0xff;
PORTA=0x00;
DDRB=0xff;
PORTB=0x00;
/********************************************
#define RAM_ADRESS PORTB.1 //地址使能
#define RAM_WRITTEN PORTB.2 //写信号子
#define POWER_EN PORTB.0 //电源使能
#define light PORTB.4 //背光控制
#define RAM_EN PORTB.5 //使能信号
********************************************/
DDRC=0xff; //lcd数据端口
PORTC=0x00;
/********************************************
#define CS5512_SDO PIND.0
#define CS5512_SCLK PORTD.1
#define CS5512_CS PORTD.3
*******************************************/
//1111 1011
// PORTD.4入,学习按键
// DDRD=0xee;
// PORTD=0x11;
DDRD=0xfe;
PORTD=0x00;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?