##// END OF EJS Templates
More cleanup, added subdirectories inside include dir, cleaned include tree,...
More cleanup, added subdirectories inside include dir, cleaned include tree, Doxygen configured, started doxygen documentation.

File last commit:

r58:dcfec4f56803 dev_alexis
r72:6ad096835359 dev_alexis
Show More
main.c
115 lines | 2.5 KiB | text/x-c | CLexer
New version totaly integrated to Qt through custom sdk build!...
r47 #include <stdio.h>
#include <gpio.h>
#include <uart.h>
#include <stm32f4xx.h>
#include <bsp.h>
#include <core.h>
#include <spi.h>
void ads1278readOut(spi_t spidev,int32_t* data)
{
gpioset(ADC_FSYNC);
Started SSD2119 driver based on ili9328 driver....
r58 //delay_100us(1);
for(volatile int i=0;i<50;i++);
New version totaly integrated to Qt through custom sdk build!...
r47 gpioclr(ADC_FSYNC);
for(int i=0;i<8;i++)
{
data[i]=spigetw(spidev)<<16;
data[i]+=spigetw(spidev)<<8;
data[i]+=spigetw(spidev);
if((data[i]&(1<<23)))data[i]-=(1<<24);
}
}
void pushData(int32_t* data)
{
Started SSD2119 driver based on ili9328 driver....
r58 // printf("%f\t%f\t%f\n",(6.0/(8*1000*1000)) *data[0],(6.0/(8*1000*1000))*data[1],(6.0/(8*1000*1000))*data[2]);
printf("%f\n",(6.0/(16*1000*1000)) *data[0]);
}
void pushData2(int32_t* data)
{
char buffer[29];
buffer[0] = 0xa5;
buffer[1] = 0x0f;
buffer[2] = 0x00;
buffer[27] = 0xf0;
buffer[28] = 0x5a;
for(int i=0;i<8;i++)
{
buffer[(i*3)+3] = (char)data[i]>>16;
buffer[(i*3)+4] = (char)data[i]>>8;
buffer[(i*3)+5] = (char)data[i];
}
uartputnc(uart1,buffer,29);
New version totaly integrated to Qt through custom sdk build!...
r47 }
Started SSD2119 driver based on ili9328 driver....
r58 void sample()
{
int32_t data[8];
data[0]=0x712345;
char buffer[2+1+3+2];
buffer[0] = 0xa5;
buffer[1] = 0x0f;
buffer[2] = 0x00;
buffer[2+1+3] = 0xf0;
buffer[2+1+4] = 0x5a;
while(1)
{
//uartputnc(uart1,buffer,3);
uartputc(uart1,0xa5);
uartputc(uart1,0x0f);
uartputc(uart1,0x01);
uartputc(uart1,25);
for(int i=0;i<8;i++)
{
//ads1278readOut(spi1,data);
uartputc(uart1,(char)0x1);//(data[0])>>16);
uartputc(uart1,(char)0x2);//(data[0]>>8));
uartputc(uart1,(char)0x3);//(data[0]>>0));
}
uartputc(uart1,0xf0);
uartputc(uart1,0x5a);
}
}
New version totaly integrated to Qt through custom sdk build!...
r47
int main()
{
int32_t data[8];
Started SSD2119 driver based on ili9328 driver....
r58 char test=0;
for(int i=0;i<500;i++)
{
ads1278readOut(spi1,data);
delay_100us(10);
}
sample();
//while(1)
//{
// uartputc(uart1,test++);
//}
New version totaly integrated to Qt through custom sdk build!...
r47
Started SSD2119 driver based on ili9328 driver....
r58 // while(1)
// {
// ads1278readOut(spi1,data);
// gpioclr(LED2);
// //delay_100us(100);
//// for(volatile int i=0;i<100;i++);
// pushData(data);
// gpioset(LED2);
// //delay_100us(100);
// }
New version totaly integrated to Qt through custom sdk build!...
r47 }
Started SSD2119 driver based on ili9328 driver....
r58