Esempio n. 1
0
/*---------------------------------------------------------------------------*
 * Routine:  UEZGUI_EXP_DK_ProximitySensor_Require
 *---------------------------------------------------------------------------*
 * Description:
 *      Enable the EXP_DK Proximity Sensor -- a VCNL4010-GS08.
 *---------------------------------------------------------------------------*/
void UEZGUI_EXP_DK_ProximitySensor_Require(void)
{
    DEVICE_CREATE_ONCE();

    // Currently, there is no driver for the VCNL4010-GS08.
    // Manual readings of I2C have been performed, but nothing more.

    // In order to use this, it must use EXPDK_I2C-B provided by the I2C Mux
    UEZGUI_EXP_DK_I2CMux_Require();

    // TODO: Make a proximity driver appear on this!
}
Esempio n. 2
0
/*---------------------------------------------------------------------------*
 * Routine:
 *---------------------------------------------------------------------------*
 * Description:
 *      Setup the I2C GPIO LEDs on EXPDK_I2C-A
 *---------------------------------------------------------------------------*/
void UEZGUI_EXP_DK_LED_Require(void)
{
    T_uezDeviceWorkspace *p_led0;
    T_uezDevice i2c;
    T_uezDeviceWorkspace *p_i2c;

    DEVICE_CREATE_ONCE();
    UEZGUI_EXP_DK_I2CMux_Require();
    // In order to use this, it must use EXPDK_I2C-A provided by the I2C Mux
    UEZDeviceTableFind("EXPDK_I2C-A", &i2c);
    UEZDeviceTableGetWorkspace(i2c, (T_uezDeviceWorkspace **)&p_i2c);

    UEZDeviceTableRegister(
        "LEDBank0",
        (T_uezDeviceInterface *)&LEDBank_NXP_PCA9551_Interface,
        0,
        &p_led0);
    LED_NXP_PCA9551_Configure(p_led0, (DEVICE_I2C_BUS **)p_i2c, 0xC0>>1);
}
Esempio n. 3
0
/*---------------------------------------------------------------------------*
* Routine:  uEZPlatformStartup
*---------------------------------------------------------------------------*
* Description:
*      When uEZ starts, a special Startup task is created and called.
*      This task brings up the all the hardware, reports any problems,
*      starts the main task, and then exits.
*---------------------------------------------------------------------------*/
TUInt32 uEZPlatformStartup(T_uezTask aMyTask, void *aParameters)
{
#if FREERTOS_PLUS_TRACE //LPC1788 only as of uEZ v2.04
     TUInt32 traceAddressInMemory = 0;
#endif
     
     UEZPlatform_Standard_Require();
     UEZPlatform_Timer2_Require();
     UEZPlatform_DAC0_Require();
     SUIInitialize(SIMPLEUI_DOUBLE_SIZED_ICONS, EFalse, EFalse); // SWIM not flipped
     G_expdkDetected = UEZGUI_EXP_DK_Detect();
     
     if (G_expdkDetected) { // Add EXP_DK Features we want
#if UEZGUI_EXP_DK_FCT_TEST
     // no command console so functional test can run
     // Setup standard UART without console
     UEZGUI_EXP_DK_RS232_Require(UEZ_CONSOLE_WRITE_BUFFER_SIZE, 
                                     UEZ_CONSOLE_READ_BUFFER_SIZE);
#else
     UEZGUI_EXP_DK_I2S_Require();
#endif

#if UEZ_ENABLE_WIRED_NETWORK
          UEZGUI_EXP_DK_EMAC_Require();
#endif
          UEZGUI_EXP_DK_I2CMux_Require();
          UEZGUI_EXP_DK_Button_Require();
          UEZGUI_EXP_DK_LED_Require();
          UEZGUI_EXP_DK_LightSensor_Require();
          UEZGUI_EXP_DK_ProximitySensor_Require();
          
#if (UEZ_PROCESSOR==NXP_LPC1788)
          UEZGUI_EXP_DK_SDCard_MCI_Require(1); //currently only supported on LPC1788
#endif
          UEZGUI_EXP_DK_FullDuplex_RS485_Require(UEZ_CONSOLE_WRITE_BUFFER_SIZE,
                                                 UEZ_CONSOLE_READ_BUFFER_SIZE);
          UEZGUI_EXP_DK_CAN_Require();
          
          UEZPlatform_DAC0_Require();
          UEZPlatform_Timer2_Require(); // Needed by Video player
          UEZDACWAVConfig("Timer2");
          UEZGUI_EXP_DK_AudioMixer_Require();
     } else {          
          UEZPlatform_SDCard_Drive_Require(1);
     }
     
#if UEZ_ENABLE_USB_HOST_STACK
     #if USB_PORT_B_HOST_DETECT_ENABLED
     if (G_expdkDetected) {
          G_usbIsDevice = UEZGUI_EXP_DK_USB_Host_Port_B_Detect();
     } else {
          G_usbIsDevice = UEZPlatform_Host_Port_B_Detect();
     }
     if (G_usbIsDevice) {       // High for a device
      #if UEZ_ENABLE_USB_DEVICE_STACK
          UEZPlatform_USBDevice_Require();
      #endif
          UEZPlatform_USBHost_PortA_Require();
          UEZPlatform_USBFlash_Drive_Require(0);
     } else {                   // Low for a host
          UEZPlatform_USBHost_PortB_Require();
          UEZPlatform_USBFlash_Drive_Require(0);
     }
     #else
          #if UEZ_ENABLE_USB_DEVICE_STACK
                UEZPlatform_USBDevice_Require();
          #endif
          UEZPlatform_USBHost_PortA_Require();
          UEZPlatform_USBFlash_Drive_Require(0);
     #endif
#else 
    #if UEZ_ENABLE_USB_DEVICE_STACK
        UEZPlatform_USBDevice_Require();
    #endif
        UEZTaskDelay(500);//ensure the host task has itiilaized before continuing.
#endif
     
     // Network needed?
#if UEZ_ENABLE_WIRED_NETWORK
     UEZPlatform_WiredNetwork0_Require();
#endif
     
#if UEZ_ENABLE_WIRELESS_NETWORK
#if UEZ_WIRELESS_PROGRAM_MODE
     UEZPlatform_WiFiProgramMode();
#endif
     UEZPlatform_WirelessNetwork0_Require();
#endif
     
#if FREERTOS_PLUS_TRACE //LPC1788 only as of uEZ v2.04
     uiTraceStart();
     vTraceStartStatusMonitor();
     
     traceAddressInMemory = (TUInt32)vTraceGetTraceBuffer();
     printf("%x", traceAddressInMemory);
#endif
     
#if ENABLE_UEZ_BUTTON
     UEZPlatform_ButtonBoard_Require();
#endif
     
     // Create a main task (not running yet)
     UEZTaskCreate((T_uezTaskFunction)MainTask, "Main", MAIN_TASK_STACK_SIZE, 0,
                   UEZ_PRIORITY_NORMAL, &G_mainTask);
     
     // Done with this task, fall out
     return 0;
}