uTrack
|
Support for treating the Yachbot as a USB device of some kind, currently only mass storage (MSC). More...
#include "uTrack.h"
#include "utHAL.h"
#include "utUSB.h"
#include "File_Config.h"
#include "LPC23xx.h"
#include <rl_usb.h>
#include "usb_lib.c"
Macros | |
#define | TIME_BETWEEN_PRINTS 2000 |
Functions | |
bool | utUSB_Notify (UT_DeviceMessage state) |
void | utUSB_Setup (void) |
void | utUSB_Connect (void) |
void | utUSB_Disconnect (void) |
void | utUSB_RequestMountNextConnection (bool request) |
bool | utUSB_IsPluggedIn (void) |
void | utUSB_UserEjected (void) |
bool | utUSB_StackShouldBeUp (void) |
Variables | |
FAT_VI * | mc0 |
Media_INFO | info |
Support for treating the Yachbot as a USB device of some kind, currently only mass storage (MSC).
This software module can be configured to mount the SD card over USB provided the file system has been unmounted or disabled, and can also control charge via USB (specifically the current drawn by the charge chip).
Device classes other than MSC
Non-specialised runtime support.
#define TIME_BETWEEN_PRINTS 2000 |
Checks to see if the USB module expects the stack to be up.
void utUSB_Connect | ( | void | ) |
Attempt to launch the USB stack in MSC mode. Setting up the memory card can fail. If configured to do so, the USB will also request more current from the charge chip so that the unit charges properly.
void utUSB_Disconnect | ( | void | ) |
Disconnect the USB stack.
bool utUSB_IsPluggedIn | ( | void | ) |
Check whether the USB is plugged in, using the VBUS line, which should be high iff there is a powered entity on the other end.
bool utUSB_Notify | ( | UT_DeviceMessage | state | ) |
The Notify function passes a message to the software module, informing it of expected module state. It returns a value that is considered a response to a query about the specified state.
state | A state message. |
void utUSB_RequestMountNextConnection | ( | bool | request | ) |
Request that the USB stack attempt to mount the file system the next time it is plugged in within this power cycle.
request | Whether to mount or not. |
void utUSB_Setup | ( | void | ) |
Do the necessary configuration required before running the USB stack.
void utUSB_UserEjected | ( | void | ) |
Tells the USB module that the user wants to remove the device. This sets a timer to forcibly drop the USB connection if the correct command sequence for doing so has not been processed (or has failed).