Lcd companion boards support (VKLCD50RTA & VKLCD70RT)
What is this ?
This is a demo program using Renesas RGA library & USB Camera to demonstrate VK-RZ/A1H's companion boards workability.
Supported companion Boards:
VKLCD50RTA
VKLCD70RT
How to Configure ?
You can choose which display is installed by altering the lcd_panel.h file
Leave the active one & comment out the others:
#define LCD_VDC5_CH0_PANEL LCD_CH0_PANEL_VKLCD50RTA //#define LCD_VDC5_CH0_PANEL LCD_CH0_PANEL_VKLCD70RT
You can alter the whole demo with your pictures if you like:
How to compile ?
- The Demo can be compiled in 3 modes:
- I. Execution from the internal 10-MB on-chip SRAM.
- II. Execution from the on-board serial FALSH in dual (32-MB) mode.
- After import in the online compiler just leave only the VKRZA1H_DOUBLE.sct & delete all others linker files in the TOOLCHAIN_ARM_STD folder.
- Drag & drop the result binary in MBED disk, (previously inited in double flash mode)
- III. Execution from the on-board serial FALSH in single (16-MB) mode.
- After import in the online compiler just leave only the VKRZA1H_SINGLE.sct & delete all others linker files in the TOOLCHAIN_ARM_STD folder.
- Drag & drop the result binary in MBED disk, (previously inited in single flash mode )
Quick presentation:
Other demos ?
More demos you can find on our FTP
USB/USBHost/USBHALHost.h@0:6435b67ad23c, 2017-02-16 (annotated)
- Committer:
- tvendov
- Date:
- Thu Feb 16 10:23:48 2017 +0000
- Revision:
- 0:6435b67ad23c
Initial lcd support (VKLCD50RTA & VKLCD70RT companion boards)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
tvendov | 0:6435b67ad23c | 1 | /* mbed USBHost Library |
tvendov | 0:6435b67ad23c | 2 | * Copyright (c) 2006-2013 ARM Limited |
tvendov | 0:6435b67ad23c | 3 | * |
tvendov | 0:6435b67ad23c | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
tvendov | 0:6435b67ad23c | 5 | * you may not use this file except in compliance with the License. |
tvendov | 0:6435b67ad23c | 6 | * You may obtain a copy of the License at |
tvendov | 0:6435b67ad23c | 7 | * |
tvendov | 0:6435b67ad23c | 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
tvendov | 0:6435b67ad23c | 9 | * |
tvendov | 0:6435b67ad23c | 10 | * Unless required by applicable law or agreed to in writing, software |
tvendov | 0:6435b67ad23c | 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
tvendov | 0:6435b67ad23c | 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
tvendov | 0:6435b67ad23c | 13 | * See the License for the specific language governing permissions and |
tvendov | 0:6435b67ad23c | 14 | * limitations under the License. |
tvendov | 0:6435b67ad23c | 15 | */ |
tvendov | 0:6435b67ad23c | 16 | |
tvendov | 0:6435b67ad23c | 17 | #ifndef USBHALHOST_H |
tvendov | 0:6435b67ad23c | 18 | #define USBHALHOST_H |
tvendov | 0:6435b67ad23c | 19 | |
tvendov | 0:6435b67ad23c | 20 | #include "USBHostTypes.h" |
tvendov | 0:6435b67ad23c | 21 | #include "USBHostConf.h" |
tvendov | 0:6435b67ad23c | 22 | |
tvendov | 0:6435b67ad23c | 23 | class USBHostHub; |
tvendov | 0:6435b67ad23c | 24 | |
tvendov | 0:6435b67ad23c | 25 | /** |
tvendov | 0:6435b67ad23c | 26 | * USBHALHost class |
tvendov | 0:6435b67ad23c | 27 | */ |
tvendov | 0:6435b67ad23c | 28 | class USBHALHost { |
tvendov | 0:6435b67ad23c | 29 | protected: |
tvendov | 0:6435b67ad23c | 30 | |
tvendov | 0:6435b67ad23c | 31 | /** |
tvendov | 0:6435b67ad23c | 32 | * Constructor |
tvendov | 0:6435b67ad23c | 33 | * init variables and memory where will be stored HCCA, ED and TD |
tvendov | 0:6435b67ad23c | 34 | */ |
tvendov | 0:6435b67ad23c | 35 | USBHALHost(); |
tvendov | 0:6435b67ad23c | 36 | |
tvendov | 0:6435b67ad23c | 37 | /** |
tvendov | 0:6435b67ad23c | 38 | * Initialize host controller. Enable USB interrupts. This part is not in the constructor because, |
tvendov | 0:6435b67ad23c | 39 | * this function calls a virtual method if a device is already connected |
tvendov | 0:6435b67ad23c | 40 | */ |
tvendov | 0:6435b67ad23c | 41 | void init(); |
tvendov | 0:6435b67ad23c | 42 | |
tvendov | 0:6435b67ad23c | 43 | /** |
tvendov | 0:6435b67ad23c | 44 | * reset the root hub |
tvendov | 0:6435b67ad23c | 45 | */ |
tvendov | 0:6435b67ad23c | 46 | void resetRootHub(); |
tvendov | 0:6435b67ad23c | 47 | |
tvendov | 0:6435b67ad23c | 48 | /** |
tvendov | 0:6435b67ad23c | 49 | * return the value contained in the control HEAD ED register |
tvendov | 0:6435b67ad23c | 50 | * |
tvendov | 0:6435b67ad23c | 51 | * @returns address of the control Head ED |
tvendov | 0:6435b67ad23c | 52 | */ |
tvendov | 0:6435b67ad23c | 53 | uint32_t controlHeadED(); |
tvendov | 0:6435b67ad23c | 54 | |
tvendov | 0:6435b67ad23c | 55 | /** |
tvendov | 0:6435b67ad23c | 56 | * return the value contained in the bulk HEAD ED register |
tvendov | 0:6435b67ad23c | 57 | * |
tvendov | 0:6435b67ad23c | 58 | * @returns address of the bulk head ED |
tvendov | 0:6435b67ad23c | 59 | */ |
tvendov | 0:6435b67ad23c | 60 | uint32_t bulkHeadED(); |
tvendov | 0:6435b67ad23c | 61 | |
tvendov | 0:6435b67ad23c | 62 | /** |
tvendov | 0:6435b67ad23c | 63 | * return the value of the head interrupt ED contained in the HCCA |
tvendov | 0:6435b67ad23c | 64 | * |
tvendov | 0:6435b67ad23c | 65 | * @returns address of the head interrupt ED contained in the HCCA |
tvendov | 0:6435b67ad23c | 66 | */ |
tvendov | 0:6435b67ad23c | 67 | uint32_t interruptHeadED(); |
tvendov | 0:6435b67ad23c | 68 | |
tvendov | 0:6435b67ad23c | 69 | /** |
tvendov | 0:6435b67ad23c | 70 | * Update the head ED for control transfers |
tvendov | 0:6435b67ad23c | 71 | */ |
tvendov | 0:6435b67ad23c | 72 | void updateControlHeadED(uint32_t addr); |
tvendov | 0:6435b67ad23c | 73 | |
tvendov | 0:6435b67ad23c | 74 | /** |
tvendov | 0:6435b67ad23c | 75 | * Update the head ED for bulk transfers |
tvendov | 0:6435b67ad23c | 76 | */ |
tvendov | 0:6435b67ad23c | 77 | void updateBulkHeadED(uint32_t addr); |
tvendov | 0:6435b67ad23c | 78 | |
tvendov | 0:6435b67ad23c | 79 | /** |
tvendov | 0:6435b67ad23c | 80 | * Update the head ED for interrupt transfers |
tvendov | 0:6435b67ad23c | 81 | */ |
tvendov | 0:6435b67ad23c | 82 | void updateInterruptHeadED(uint32_t addr); |
tvendov | 0:6435b67ad23c | 83 | |
tvendov | 0:6435b67ad23c | 84 | /** |
tvendov | 0:6435b67ad23c | 85 | * Enable List for the specified endpoint type |
tvendov | 0:6435b67ad23c | 86 | * |
tvendov | 0:6435b67ad23c | 87 | * @param type enable the list of ENDPOINT_TYPE type |
tvendov | 0:6435b67ad23c | 88 | */ |
tvendov | 0:6435b67ad23c | 89 | void enableList(ENDPOINT_TYPE type); |
tvendov | 0:6435b67ad23c | 90 | |
tvendov | 0:6435b67ad23c | 91 | /** |
tvendov | 0:6435b67ad23c | 92 | * Disable List for the specified endpoint type |
tvendov | 0:6435b67ad23c | 93 | * |
tvendov | 0:6435b67ad23c | 94 | * @param type disable the list of ENDPOINT_TYPE type |
tvendov | 0:6435b67ad23c | 95 | */ |
tvendov | 0:6435b67ad23c | 96 | bool disableList(ENDPOINT_TYPE type); |
tvendov | 0:6435b67ad23c | 97 | |
tvendov | 0:6435b67ad23c | 98 | /** |
tvendov | 0:6435b67ad23c | 99 | * Virtual method called when a device has been connected |
tvendov | 0:6435b67ad23c | 100 | * |
tvendov | 0:6435b67ad23c | 101 | * @param hub hub number of the device |
tvendov | 0:6435b67ad23c | 102 | * @param port port number of the device |
tvendov | 0:6435b67ad23c | 103 | * @param lowSpeed 1 if low speed, 0 otherwise |
tvendov | 0:6435b67ad23c | 104 | * @param hub_parent reference to the hub where the device is connected (NULL if the hub parent is the root hub) |
tvendov | 0:6435b67ad23c | 105 | */ |
tvendov | 0:6435b67ad23c | 106 | virtual void deviceConnected(int hub, int port, bool lowSpeed, USBHostHub * hub_parent = NULL) = 0; |
tvendov | 0:6435b67ad23c | 107 | |
tvendov | 0:6435b67ad23c | 108 | /** |
tvendov | 0:6435b67ad23c | 109 | * Virtual method called when a device has been disconnected |
tvendov | 0:6435b67ad23c | 110 | * |
tvendov | 0:6435b67ad23c | 111 | * @param hub hub number of the device |
tvendov | 0:6435b67ad23c | 112 | * @param port port number of the device |
tvendov | 0:6435b67ad23c | 113 | * @param hub_parent reference to the hub where the device is connected (NULL if the hub parent is the root hub) |
tvendov | 0:6435b67ad23c | 114 | * @param addr list of the TDs which have been completed to dequeue freed TDs |
tvendov | 0:6435b67ad23c | 115 | */ |
tvendov | 0:6435b67ad23c | 116 | virtual void deviceDisconnected(int hub, int port, USBHostHub * hub_parent, volatile uint32_t addr) = 0; |
tvendov | 0:6435b67ad23c | 117 | |
tvendov | 0:6435b67ad23c | 118 | /** |
tvendov | 0:6435b67ad23c | 119 | * Virtual method called when a transfer has been completed |
tvendov | 0:6435b67ad23c | 120 | * |
tvendov | 0:6435b67ad23c | 121 | * @param addr list of the TDs which have been completed |
tvendov | 0:6435b67ad23c | 122 | */ |
tvendov | 0:6435b67ad23c | 123 | virtual void transferCompleted(volatile uint32_t addr) = 0; |
tvendov | 0:6435b67ad23c | 124 | |
tvendov | 0:6435b67ad23c | 125 | /** |
tvendov | 0:6435b67ad23c | 126 | * Find a memory section for a new ED |
tvendov | 0:6435b67ad23c | 127 | * |
tvendov | 0:6435b67ad23c | 128 | * @returns the address of the new ED |
tvendov | 0:6435b67ad23c | 129 | */ |
tvendov | 0:6435b67ad23c | 130 | volatile uint8_t * getED(); |
tvendov | 0:6435b67ad23c | 131 | |
tvendov | 0:6435b67ad23c | 132 | /** |
tvendov | 0:6435b67ad23c | 133 | * Find a memory section for a new TD |
tvendov | 0:6435b67ad23c | 134 | * |
tvendov | 0:6435b67ad23c | 135 | * @returns the address of the new TD |
tvendov | 0:6435b67ad23c | 136 | */ |
tvendov | 0:6435b67ad23c | 137 | volatile uint8_t * getTD(); |
tvendov | 0:6435b67ad23c | 138 | #if(1) /* Isochronous */ |
tvendov | 0:6435b67ad23c | 139 | bool isTD(volatile uint8_t* td); |
tvendov | 0:6435b67ad23c | 140 | #endif |
tvendov | 0:6435b67ad23c | 141 | |
tvendov | 0:6435b67ad23c | 142 | /** |
tvendov | 0:6435b67ad23c | 143 | * Release a previous memory section reserved for an ED |
tvendov | 0:6435b67ad23c | 144 | * |
tvendov | 0:6435b67ad23c | 145 | * @param ed address of the ED |
tvendov | 0:6435b67ad23c | 146 | */ |
tvendov | 0:6435b67ad23c | 147 | void freeED(volatile uint8_t * ed); |
tvendov | 0:6435b67ad23c | 148 | |
tvendov | 0:6435b67ad23c | 149 | /** |
tvendov | 0:6435b67ad23c | 150 | * Release a previous memory section reserved for an TD |
tvendov | 0:6435b67ad23c | 151 | * |
tvendov | 0:6435b67ad23c | 152 | * @param td address of the TD |
tvendov | 0:6435b67ad23c | 153 | */ |
tvendov | 0:6435b67ad23c | 154 | void freeTD(volatile uint8_t * td); |
tvendov | 0:6435b67ad23c | 155 | |
tvendov | 0:6435b67ad23c | 156 | private: |
tvendov | 0:6435b67ad23c | 157 | static void _usbisr(void); |
tvendov | 0:6435b67ad23c | 158 | void UsbIrqhandler(); |
tvendov | 0:6435b67ad23c | 159 | |
tvendov | 0:6435b67ad23c | 160 | void memInit(); |
tvendov | 0:6435b67ad23c | 161 | |
tvendov | 0:6435b67ad23c | 162 | HCCA volatile * usb_hcca; //256 bytes aligned |
tvendov | 0:6435b67ad23c | 163 | uint8_t volatile * usb_edBuf; //4 bytes aligned |
tvendov | 0:6435b67ad23c | 164 | uint8_t volatile * usb_tdBuf; //4 bytes aligned |
tvendov | 0:6435b67ad23c | 165 | |
tvendov | 0:6435b67ad23c | 166 | static USBHALHost * instHost; |
tvendov | 0:6435b67ad23c | 167 | |
tvendov | 0:6435b67ad23c | 168 | bool volatile edBufAlloc[MAX_ENDPOINT]; |
tvendov | 0:6435b67ad23c | 169 | bool volatile tdBufAlloc[MAX_TD]; |
tvendov | 0:6435b67ad23c | 170 | }; |
tvendov | 0:6435b67ad23c | 171 | |
tvendov | 0:6435b67ad23c | 172 | #endif |