Author: [email protected]
Date: Thu Mar 19 13:31:37 2009
New Revision: 872

Modified:
    trunk/include/peripheral/usb/usb_defs.jal
    trunk/include/peripheral/usb/usb_drv_cdc_class.jal
    trunk/test/peripheral/usb/test_usb_cdc.jal
    trunk/test/peripheral/usb/test_usb_hid_generic.jal
    trunk/test/peripheral/usb/test_usb_hid_keyboard.jal
    trunk/test/peripheral/usb/test_usb_hid_mouse.jal

Log:
put USB addresses in one bank so samples are easier to port to devices with  
256 bytes dual port memory

Modified: trunk/include/peripheral/usb/usb_defs.jal
==============================================================================
--- trunk/include/peripheral/usb/usb_defs.jal   (original)
+++ trunk/include/peripheral/usb/usb_defs.jal   Thu Mar 19 13:31:37 2009
@@ -19,8 +19,8 @@
  --


-const word USB_IN_DELIVERY_BUFFER_LOC = 0x0700
-var byte usb_delivery_buffer[ 256 ] at USB_IN_DELIVERY_BUFFER_LOC
+const word USB_IN_DELIVERY_BUFFER_LOC = 0x0478
+var byte usb_delivery_buffer[ 8 ] at USB_IN_DELIVERY_BUFFER_LOC
  var byte usb_delivery_bytes_max_send
  var byte usb_delivery_bytes_sent
  var byte usb_delivery_buffer_size

Modified: trunk/include/peripheral/usb/usb_drv_cdc_class.jal
==============================================================================
--- trunk/include/peripheral/usb/usb_drv_cdc_class.jal  (original)
+++ trunk/include/peripheral/usb/usb_drv_cdc_class.jal  Thu Mar 19 13:31:37  
2009
@@ -34,24 +34,25 @@

  -- Line coding struction that defines what (should) happen if we were  
actually
  -- USB to RS232 converter
-const word cdc_line_coding_loc = 0x04F0;
-var byte cdc_line_coding[7] at cdc_line_coding_loc
-var dword cdc_line_coding_dte_rate at cdc_line_coding_loc + 0
-var byte cdc_line_coding_stop_bits at cdc_line_coding_loc + 4 -- 0=1 stop  
bit, 1=1.5 stop bits, 2=2 stop bits
-var byte cdc_line_coding_parity at cdc_line_coding_loc + 5 -- 0=None,  
1=Odd, 2=Even, 3=Mark, 4=Space
-var byte cdc_line_coding_data_bits at cdc_line_coding_loc + 6 -- 5,6,7,8  
or 16 bits
+
+
+var byte cdc_line_coding[7]
+var dword cdc_line_coding_dte_rate at cdc_line_coding[0]
+var byte cdc_line_coding_stop_bits at cdc_line_coding[4]    -- 0=1 stop  
bit, 1=1.5 stop bits, 2=2 stop bits
+var byte cdc_line_coding_parity at cdc_line_coding[5]       -- 0=None,  
1=Odd, 2=Even, 3=Mark, 4=Space
+var byte cdc_line_coding_data_bits at cdc_line_coding[6]    -- 5,6,7,8 or  
16 bits

  var byte cdc_line_status = 0x00
  var bit last_packet_is_full = false

  -- Transmit fifo
-var byte cdc_tx_buffer[USB_CDC_TX_BUFFER_SIZE] at  USB_EP3_IN_ADDR
+var byte cdc_tx_buffer[USB_CDC_TX_BUFFER_SIZE] at  USB_CDC_TX_BUFFER_LOC
  var byte cdc_tx_wr=0
  var byte cdc_tx_rd=0


--- Receive fifo
-var byte cdc_rx_buffer[USB_CDC_RX_BUFFER_SIZE] at  0x600
+
+var byte cdc_rx_buffer[USB_CDC_RX_BUFFER_SIZE] at  USB_CDC_RX_BUFFER_LOC
  var byte cdc_rx_wr = 0
  var byte cdc_rx_rd = 0

@@ -308,7 +309,7 @@
        end if
                

-       cdc_tx_addr =  USB_EP3_IN_ADDR + cdc_tx_rd
+       cdc_tx_addr =  USB_CDC_TX_BUFFER_LOC + cdc_tx_rd
        cdc_in_addr = cdc_tx_addr

        if USB_CDC_DEBUG > 0  then

Modified: trunk/test/peripheral/usb/test_usb_cdc.jal
==============================================================================
--- trunk/test/peripheral/usb/test_usb_cdc.jal  (original)
+++ trunk/test/peripheral/usb/test_usb_cdc.jal  Thu Mar 19 13:31:37 2009
@@ -96,33 +96,48 @@
  const bit USB_EP_DATA_CALLBACK = true
  const bit USB_CALLBACK_ON_SOF = true

+const word USB_CDC_TX_BUFFER_LOC = 0x04A0
+const byte USB_CDC_TX_BUFFER_SIZE = 0x20
+
+const word USB_CDC_RX_BUFFER_LOC = 0x0480
+const byte USB_CDC_RX_BUFFER_SIZE = 0x20
+
+
  const bit USB_EP0 = 1
  const byte USB_EP0_OUT_SIZE = 8
-const word USB_EP0_OUT_ADDR = 0x0500
+
+const word USB_EP0_OUT_ADDR = 0x0420
+
  const byte USB_EP0_IN_SIZE  = 8
-const word USB_EP0_IN_ADDR  = 0x0508
+
+const word USB_EP0_IN_ADDR  = 0x0028
+

  const bit USB_EP1 = 1
  const byte USB_EP1_OUT_SIZE = 8
-const word USB_EP1_OUT_ADDR = 0x0510
+const word USB_EP1_OUT_ADDR = 0x0430
+
  const byte USB_EP1_IN_SIZE  = 8
-const word USB_EP1_IN_ADDR  = 0x0518
+const word USB_EP1_IN_ADDR  = 0x0438
+
  var volatile byte  usb_ep1in_buf[ 8 ]

  const bit USB_EP2 = 1
  const byte USB_EP2_OUT_SIZE = 8
-const word USB_EP2_OUT_ADDR = 0x0520
+const word USB_EP2_OUT_ADDR = 0x0440
+
  const byte USB_EP2_IN_SIZE  = 8
-const word USB_EP2_IN_ADDR  = 0x0528
+const word USB_EP2_IN_ADDR  = 0x0448

  const bit USB_EP3 = 1
  const byte USB_EP3_OUT_SIZE = 8
-const word USB_EP3_OUT_ADDR = 0x0530
+const word USB_EP3_OUT_ADDR = 0x0450
  const byte USB_EP3_IN_SIZE = 8
-const word USB_EP3_IN_ADDR  = 0x0680

-const byte USB_CDC_TX_BUFFER_SIZE = 0x80
-const byte USB_CDC_RX_BUFFER_SIZE = 0x80
+
+const word USB_EP3_IN_ADDR  = USB_CDC_TX_BUFFER_LOC
+
+
  const byte USB_CDC_DATA_ENDPOINT = 3



Modified: trunk/test/peripheral/usb/test_usb_hid_generic.jal
==============================================================================
--- trunk/test/peripheral/usb/test_usb_hid_generic.jal  (original)
+++ trunk/test/peripheral/usb/test_usb_hid_generic.jal  Thu Mar 19 13:31:37  
2009
@@ -65,7 +65,7 @@

  include usb_defs

-const word USB_EP_BASE_ADDRESS = 0x0500
+const word USB_EP_BASE_ADDRESS = 0x0420

  const bit USB_EP0 = 1
  const byte USB_EP0_OUT_SIZE = 8
@@ -82,15 +82,15 @@

  const bit USB_EP2 = 0
  const byte USB_EP2_OUT_SIZE = 8
-const word USB_EP2_OUT_ADDR = 0x0520
+const word USB_EP2_OUT_ADDR = 0x0000
  const byte USB_EP2_IN_SIZE  = 8
-const word USB_EP2_IN_ADDR  = 0x0528
+const word USB_EP2_IN_ADDR  = 0x0000

  const bit USB_EP3 = 0
  const byte USB_EP3_OUT_SIZE = 8
-const word USB_EP3_OUT_ADDR = 0x0600
+const word USB_EP3_OUT_ADDR = 0x0000
  const byte USB_EP3_IN_SIZE = 8
-const word USB_EP3_IN_ADDR  = 0x0680
+const word USB_EP3_IN_ADDR  = 0x0000


  const byte HID_OUT_REPORT_SIZE = 8

Modified: trunk/test/peripheral/usb/test_usb_hid_keyboard.jal
==============================================================================
--- trunk/test/peripheral/usb/test_usb_hid_keyboard.jal (original)
+++ trunk/test/peripheral/usb/test_usb_hid_keyboard.jal Thu Mar 19 13:31:37  
2009
@@ -66,28 +66,28 @@

  const bit USB_EP0 = 1
  const byte USB_EP0_OUT_SIZE = 8
-const word USB_EP0_OUT_ADDR = 0x0500
+const word USB_EP0_OUT_ADDR = 0x0420
  const byte USB_EP0_IN_SIZE  = USB_EP0_OUT_SIZE
-const word USB_EP0_IN_ADDR  = 0x0508
+const word USB_EP0_IN_ADDR  = 0x0428

  const bit USB_EP1 = 1
  const byte USB_EP1_OUT_SIZE = 8
-const word USB_EP1_OUT_ADDR = 0x0510
+const word USB_EP1_OUT_ADDR = 0x0430
  const byte USB_EP1_IN_SIZE  = 8
-const word USB_EP1_IN_ADDR  = 0x0518
+const word USB_EP1_IN_ADDR  = 0x0438
  var volatile byte  usb_ep1in_buf[ 8 ]

  const bit USB_EP2 = 0
  const byte USB_EP2_OUT_SIZE = 8
-const word USB_EP2_OUT_ADDR = 0x0520
+const word USB_EP2_OUT_ADDR = 0x0000
  const byte USB_EP2_IN_SIZE  = 8
-const word USB_EP2_IN_ADDR  = 0x0528
+const word USB_EP2_IN_ADDR  = 0x0000

  const bit USB_EP3 = 0
  const byte USB_EP3_OUT_SIZE = 8
-const word USB_EP3_OUT_ADDR = 0x0600
+const word USB_EP3_OUT_ADDR = 0x0000
  const byte USB_EP3_IN_SIZE = 8
-const word USB_EP3_IN_ADDR  = 0x0680
+const word USB_EP3_IN_ADDR  = 0x0000

  const bit USB_CALLBACK_ON_CLASS_CTRL          = true
  const bit USB_CALLBACK_ON_DEVICE_CONFIGURED = false

Modified: trunk/test/peripheral/usb/test_usb_hid_mouse.jal
==============================================================================
--- trunk/test/peripheral/usb/test_usb_hid_mouse.jal    (original)
+++ trunk/test/peripheral/usb/test_usb_hid_mouse.jal    Thu Mar 19 13:31:37  
2009
@@ -70,28 +70,28 @@

  const bit USB_EP0 = 1
  const byte USB_EP0_OUT_SIZE = 8
-const word USB_EP0_OUT_ADDR = 0x0500
+const word USB_EP0_OUT_ADDR = 0x0420
  const byte USB_EP0_IN_SIZE  = 8
-const word USB_EP0_IN_ADDR  = 0x0508
+const word USB_EP0_IN_ADDR  = 0x0428

  const bit USB_EP1 = 1
  const byte USB_EP1_OUT_SIZE = 8
-const word USB_EP1_OUT_ADDR = 0x0510
+const word USB_EP1_OUT_ADDR = 0x0430
  const byte USB_EP1_IN_SIZE  = 8
-const word USB_EP1_IN_ADDR  = 0x0518
+const word USB_EP1_IN_ADDR  = 0x0438
  var volatile byte  usb_ep1in_buf[ 8 ]

  const bit USB_EP2 = 0
  const byte USB_EP2_OUT_SIZE = 8
-const word USB_EP2_OUT_ADDR = 0x0520
+const word USB_EP2_OUT_ADDR = 0x0000
  const byte USB_EP2_IN_SIZE  = 8
-const word USB_EP2_IN_ADDR  = 0x0528
+const word USB_EP2_IN_ADDR  = 0x0000

  const bit USB_EP3 = 0
  const byte USB_EP3_OUT_SIZE = 8
-const word USB_EP3_OUT_ADDR = 0x0600
+const word USB_EP3_OUT_ADDR = 0x0000
  const byte USB_EP3_IN_SIZE = 8
-const word USB_EP3_IN_ADDR  = 0x0680
+const word USB_EP3_IN_ADDR  = 0x0000



@@ -381,8 +381,8 @@
                                                
                        if( movement_length > 16 ) then
                                data_buffer[0] = 0
-                               data_buffer[1] = dir_table[vector & 0x07] -- 
X-Vector
-                               data_buffer[2] = dir_table[(vector+2) & 0x07] 
-- Y-Vector
+                               data_buffer[1] = byte( dir_table[vector & 0x07] 
) -- X-Vector
+                               data_buffer[2] = byte( dir_table[(vector+2) & 
0x07] ) -- Y-Vector
                                vector = vector+1
                                movement_length = 0
                        end if

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to