Exemplo n.º 1
0
void TestOne() {
    char a, b;
    u8 n;
   
    while(UARTDataAvailable()<2);
    a = UARTReadData();
    b = UARTReadData();
    n=(a-'0')*10+(b-'0');

    TestASIC(n);
}
Exemplo n.º 2
0
void CS_Test() {
    char a,b;
    u8 n;

    while(UARTDataAvailable()<2);
   
    a = UARTReadData();  
    b = UARTReadData();
    n=(a-'0')*10+(b-'0');
    UARTWriteLine("Chip Select:");
    UARTWriteInt(n,2);
    CloseASIC();
    OpenASIC(n);
   
}
Exemplo n.º 3
0
void main()
{
  int c;
  printf("Hello World\r\n");

  for(;;)
  {
    c = UARTReadData();
    if ( c >= 0 )
    {
      blink();
      printf("%c\r\n", c);
    }
  }
}
Exemplo n.º 4
0
int _read (int fd, char *ptr, int len)
{
  /* Read "len" of char to "ptr" from file id "fd"f
   * Return number of char read.
   * Need implementing with UART here. */
  int i = 0;
  while( i < len)
  {
    while ( UARTIsDataAvailable() == 0 )
      ;
    ptr[i] = UARTReadData();;
    i++;
  }
  return len;
}
Exemplo n.º 5
0
void main(void) {
    u8 i = 0;
    char c;
    MCU_INIT();
    LED=0;

    while (1) {
        if(UARTDataAvailable()>0) c = UARTReadData();
        switch (c) {
            case 'h':
                Menu();
                break;
            case 's':
                SHA256_Test();
                Menu();
                break;
            case 'c':
                CS_Test();
                Menu();
                break;
            case 'C':
                CS_All_Test();
                Menu();
                break;
            case 't':
                TestOne();
                Menu();
                break;
            case 'T':
                TestAll();
                Menu();
                break;
        }
        c=0;
    }

}