test
Dependencies: ad5422_arduino mbed LT1446 ADS1248-1 LM35-1 Flash FT813 PGA280_ADS1259
Diff: PerifConfig.cpp
- Revision:
- 6:cfe7cb0bdb1a
- Parent:
- 5:21240fa1ee4c
- Child:
- 7:c364201bc3ed
diff -r 21240fa1ee4c -r cfe7cb0bdb1a PerifConfig.cpp --- a/PerifConfig.cpp Thu Aug 13 14:37:39 2020 +0000 +++ b/PerifConfig.cpp Fri Aug 14 14:16:03 2020 +0000 @@ -2,21 +2,18 @@ #include <stdio.h> /*Переопределение имени пинов для платы ТЭД2*/ -DigitalOut Cs(PD_2); -DigitalOut En1(D15); - -DigitalOut Adr0(D5); -DigitalOut Adr1(D6); -DigitalOut Adr2(D7); +DigitalOut Cs(PE_4); +DigitalOut En1(PE_3); -DigitalOut ads1259_pin_Start(PG_2); -DigitalOut ads1259_pin_CS(PD_2); -DigitalIn ads1259_pin_Drdy(PG_3); +DigitalOut Adr0(PF_0); +DigitalOut Adr1(PF_1); +DigitalOut Adr2(PF_2); +DigitalOut Reset(PA_7); +DigitalIn CrdyA(PF_10); -DigitalOut Reset(PG_2); -DigitalIn CrdyA(PG_3); - +//SPI TED2(PE_6,PE_5,PE_2);//MOSI,MISO,SCK +//Конец /*Плата СБ-1*/ DigitalOut SB1_SWEN(PB_13); @@ -25,17 +22,23 @@ DigitalOut SB1_SHDN(PC_6); DigitalOut PosAw(PB_15); DigitalOut PosBw(PC_7); + +DigitalOut ads1259_pin_Start(PG_2); +DigitalOut ads1259_pin_CS(PD_2); +DigitalIn ads1259_pin_Drdy(PG_3); + +SPI AD1248_SPI(PC_12, PC_11, PC_10);//MOSI,MISO,SCK /*Конец*/ //выводы для костыльного SPI для ЦАП -DigitalOut DOUT(PF_1); -//DigitalIn MISO(D12); -DigitalOut CLK(PF_2); +DigitalOut LTC1446_CS(D7); +DigitalOut LTC1446_CLK(D6); +DigitalOut LTC1446_DOUT(D5); /*Конец*/ -//MOSI,MISO,SCK -SPI TED2(PC_12, PC_11, PC_10); -//SPI AD1248_SPI(PB_5,PB_4,PB_3); + + + Serial UART(SERIAL_TX,SERIAL_RX,9600); extern PwmOut Pressure(D3); @@ -74,13 +77,13 @@ void SPI1_MasterInitMode(char mode) { - TED2.format(8,mode); - TED2.frequency(100000); + AD1248_SPI.format(8,mode); + AD1248_SPI.frequency(20000000); } /*void SPI3_MasterInitMode(char mode) { - AD1248_SPI.format(8,mode); - AD1248_SPI.frequency(2500000); + TED2.format(8,mode); + TED2.frequency(100000); }*/ void SPI1_SlaveInit() { @@ -101,14 +104,14 @@ unsigned char SPI1MasterTransferByte(unsigned char cData)//отправить и считать байт { - return (unsigned char)TED2.write(cData); + return (unsigned char)AD1248_SPI.write(cData); } /*unsigned char SPI3MasterTransferByte(unsigned char cData)//отправить и считать байт { - return (unsigned char)AD1248_SPI.write(cData); + return (unsigned char)TED2.write(cData); }*/ unsigned char SPI1MasterReadByte() { - return (unsigned char)TED2.write(0xFF); + return (unsigned char)AD1248_SPI.write(0xFF); } \ No newline at end of file