Commit Graph

21 Commits

Author SHA1 Message Date
Christina Quast
6255ccca84 USB driver send standard configuration
One configuration, one Interface, two endpoints (bulk in and out)

We don't need to configure Endpoint 0 which is always the control
endpoint and configured before any descriptor requests take place.

% python usb_enum.py
Found device
  CONFIGURATION 2: 100 mA ==================================
   bLength              :    0x9 (9 bytes)
   bDescriptorType      :    0x2 Configuration
   wTotalLength         :   0x20 (32 bytes)
   bNumInterfaces       :    0x1
   bConfigurationValue  :    0x2
   iConfiguration       :    0x2 SOME
   bmAttributes         :   0x80 Bus Powered
   bMaxPower            :   0x32 (100 mA)
    INTERFACE 0: Vendor Specific ===========================
     bLength            :    0x9 (9 bytes)
     bDescriptorType    :    0x4 Interface
     bInterfaceNumber   :    0x0
     bAlternateSetting  :    0x0
     bNumEndpoints      :    0x2
     bInterfaceClass    :   0xff Vendor Specific
     bInterfaceSubClass :    0x0
     bInterfaceProtocol :    0x0
     iInterface         :    0x1 SIMTRACE~~~~~
      ENDPOINT 0x1: Bulk OUT ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :    0x1 OUT
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x0
      ENDPOINT 0x82: Bulk IN ===============================
       bLength          :    0x7 (7 bytes)
       bDescriptorType  :    0x5 Endpoint
       bEndpointAddress :   0x82 IN
       bmAttributes     :    0x2 Bulk
       wMaxPacketSize   :   0x40 (64 bytes)
       bInterval        :    0x0
2015-02-10 20:45:08 +01:00
Christina Quast
7188a126d5 Removed unused defines for USB operation in sniffer.c 2015-01-30 19:22:23 +01:00
Christina Quast
0a6025aeb6 Sniffer prints sends received data over uart0
But only when you program the chip. At some point it stops printing
the received bytes because the interrupt is not triggered anymore.
I do not know yet how and why this happens.

Even after restarting the board this state is maintained.
2015-01-30 18:10:29 +01:00
Christina Quast
ba62278b83 sniffer: Bus enables connect. between SIM and phone 2015-01-30 16:42:49 +01:00
Christina Quast
b70efc0766 Receiver interrupt enabled
Serial smartcard reader sends data which should be processed.
In the USART1 IRQ a status variable is set to show that data has
arrived, which should be checked for in the main function.
2015-01-29 18:05:32 +01:00
Christina Quast
c8bf9f112a Fixed address bug in phone_test.c main
The second argument for PIO_Configure is the list size,
which can be determined using the macro PIO_LISTSIZE.
You should pass the list (which is an array of pins) to it.
Refrain from passing the ADDRESS of the list to it, otherwise
the pin configuration is never applied and you find yourself
debugging for 3 days.

In other words:
It's working, don't touch it or it will break again!
2015-01-29 17:39:23 +01:00
Christina Quast
0ff91d0833 Fixed types for ATR buffer etc 2015-01-28 18:04:58 +01:00
Christina Quast
f7c28e0b0b phone: on reset by smartcardreader send ATR
Every time the reset line is pulled low, simtrace sends an ATR
packet over USART1.
The USART1 is slave in this configuration.
2015-01-23 20:57:52 +01:00
Christina Quast
ea103826fa test for phone I/O pin 2015-01-21 14:00:45 +01:00
Christina Quast
e8119112cb IRQ when phone RST line triggered
When the SIM card adapter, which is usually plugged into a phone,
is plugged into a CCID reader instead, the CCID reader triggers
the reset line of the RST line and therefore a PIO interrupt.
The reader then waits for an ATR from the smartcard,
which should be send next.
2015-01-20 20:15:04 +01:00
Christina Quast
30376f616a Small aestethic change in usart.c 2015-01-15 14:39:47 +01:00
Christina Quast
f03396802a Debugging of smartcard insertion interrupt
Currently the smartcard insertion interrupt is always triggered,
but when checking in PIO_ISR which pin triggered the interrupt
often times DTXD is returned (the debug transmit line which is printing
debug messages at the moment..)
2015-01-09 16:14:19 +01:00
Christina Quast
a58aa18ffd Remove legacy commands for interactive iso7816 com 2015-01-09 12:22:58 +01:00
Christina Quast
3499044e74 Atmel CCID example based main 2015-01-03 23:00:55 +01:00
Christina Quast
11e80aed9d iso7816: smartcard inserted detection partly works
Furthermore configuration of the iso7816 pins for communication
between processor and SIM card
2014-12-19 19:36:55 +01:00
Christina Quast
0f1b36f0ae Using existing atmel led routines
There is a config file called led.c in the atmel softpack source code
which provides routines for configuring, setting and clearing the LEDs.
2014-12-16 10:59:13 +01:00
Christina Quast
0aca529375 working main.c example of printf 2014-12-13 13:33:29 +01:00
Christina Quast
72ff4565f3 ret type changed to size_t 2014-12-05 15:51:43 +01:00
Christina Quast
f1192c6cad UART with stdio functions 2014-12-05 13:03:27 +01:00
Christina Quast
6219b5c63d some main file possibilities 2014-12-02 13:09:49 +01:00
Christina Quast
8be71e4e99 Makefile with libs and atmel source 2014-12-02 13:06:01 +01:00