Beispiel #1
0
Datei: main.c Projekt: dlugaz/All
//****************************************************************************
//
//! Demonstrates the controlling of LED brightness using PWM
//!
//! \param none
//! 
//! This function  
//!    1. Pinmux the GPIOs that drive LEDs to PWM mode.
//!    2. Initializes the timer as PWM.
//!    3. Loops to continuously change the PWM value and hence brightness 
//!       of LEDs.
//!
//! \return None.
//
//****************************************************************************
void main()
{
    int iLoopCnt;

    //
    // Board Initialisation
    //
    BoardInit();
    
    //
    // Configure the pinmux settings for the peripherals exercised
    //
    PinMuxConfig();    
    
    //
    // Initialize the PWMs used for driving the LEDs
    //
    InitPWMModules();

    while(1)
    {
        //
        // RYB - Update the duty cycle of the corresponding timers.
        // This changes the brightness of the LEDs appropriately.
        // The timers used are as per LP schematics.
        //
        for(iLoopCnt = 0; iLoopCnt < 255; iLoopCnt++)
        {
            UpdateDutyCycle(TIMERA2_BASE, TIMER_B, iLoopCnt);
            UpdateDutyCycle(TIMERA3_BASE, TIMER_B, iLoopCnt);
            UpdateDutyCycle(TIMERA3_BASE, TIMER_A, iLoopCnt);
            MAP_UtilsDelay(800000);
        }
      
    }

    //
    // De-Init peripherals - will not reach here...
    //
    //DeInitPWMModules();
}
Beispiel #2
0
int main(void) {
	
	//
	// Board Initialization
	//
	BoardInit();

	//
	// Enable and configure DMA
	//
	UDMAInit();

	//Config pins
	PinMuxConfig();

	InitPWMModules();

	VStartSimpleLinkSpawnTask(SPAWN_TASK_PRIORITY);

    osi_TaskCreate(HttpServerAppTask,
                    "WebSocketApp",
                        OSI_STACK_SIZE,
                        NULL,
                        HTTP_SERVER_APP_TASK_PRIORITY,
                        NULL );

    osi_TaskCreate(TargetTask,
                    "Target",
                        OSI_STACK_SIZE,
                        NULL,
                        TARGET_TASK_PRIORITY,
                        NULL );

    osi_start();

	return 0;
}
Beispiel #3
0
//*****************************************************************************
void led_init(void)
{
    led_pinmux();
    InitPWMModules();
}