lpc4370 LPCXPRESSO编程

lpc4370 LPCXPRESSO Programming

我有一些关于 Arduino 和 Msp430(使用嵌入式 C)的编程知识。但是,当涉及到 LPC4370 时,我无法理解从哪里开始学习。我有对上述芯片进行编程的要求,但我没有找到任何 material 来解释可用于对 LPC4370 进行编程的各种功能。 LPCopen 有很多代码,但我可以找出所使用的各种功能的实用性。如果有人可以提示从哪里开始,那将非常有帮助。 提前致谢。

我没有使用过 LPC 4370,但我有使用 lpc2148 的经验。

有几件事我会建议你:

  1. here 下载 LPCEXPRESSO IDE

  2. here

  3. 下载 LPCXPRESSO IDE GUIDE
  4. 了解如何创建项目。如何加载到硬件中。

  5. 然后学习从像 FreeRTOS 这样的 rtos 创建简单的任务

阅读this ST手册了解各种RTOS功能

这里是创建简单任务的示例程序。您可以参考,同样您可以阅读以下练习并继续。

/*
    FreeRTOS V6.1.1 - Copyright (C) 2011 Real Time Engineers Ltd.

    This file is part of the FreeRTOS distribution.

    FreeRTOS is free software; you can redistribute it and/or modify it under
    the terms of the GNU General Public License (version 2) as published by the
    Free Software Foundation AND MODIFIED BY the FreeRTOS exception.
    ***NOTE*** The exception to the GPL is included to allow you to distribute
    a combined work that includes FreeRTOS without being obliged to provide the
    source code for proprietary components outside of the FreeRTOS kernel.
    FreeRTOS is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
    more details. You should have received a copy of the GNU General Public
    License and the FreeRTOS license exception along with FreeRTOS; if not it
    can be viewed here: http://www.freertos.org/a00114.html and also obtained
    by writing to Richard Barry, contact details for whom are available on the
    FreeRTOS WEB site.

    1 tab == 4 spaces!

    http://www.FreeRTOS.org - Documentation, latest information, license and
    contact details.

    http://www.SafeRTOS.com - A version that is certified for use in safety
    critical systems.

    http://www.OpenRTOS.com - Commercial support, development, porting,
    licensing and training services.
*/




#include "FreeRTOS.h"

#include "task.h"


/* Demo includes. */
#include "basic_io.h"

/* Used as a loop counter to create a very crude delay. */
#define mainDELAY_LOOP_COUNT        ( 0xfffff )

/* The task functions. */
void vTask1( void *pvParameters );
void vTask2( void *pvParameters );

int main( void )
{
    /* Init the semi-hosting. */

    printf( "\n" );
    /* Create one of the two tasks. */
    xTaskCreate(    vTask1,     /* Pointer to the function that implements the task. */
                    "Task 1",   /* Text name for the task.  This is to facilitate debugging only. */
                    240,        /* Stack depth in words. */
                    NULL,       /* We are not using the task parameter. */
                    1,          /* This task will run at priority 1. */
                    NULL );     /* We are not using the task handle. */

    /* Create the other task in exactly the same way. */
    xTaskCreate( vTask2, "Task 2", 240, NULL, 1, NULL );

    /* Start the scheduler so our tasks start executing. */
    //

    vTaskStartScheduler();




    for( ;; );
    return 0;
}
/*-----------------------------------------------------------*/

void vTask1( void *pvParameters )
{
const char *pcTaskName = "Task 1 is running\n";
volatile unsigned long ul;

    /* As per most tasks, this task is implemented in an infinite loop. */
    for( ;; )
    {
        /* Print out the name of this task. */

        vPrintString( pcTaskName );


        /* Delay for a period. */
        for( ul = 0; ul < mainDELAY_LOOP_COUNT; ul++ )
        {
            /* This loop is just a very crude delay implementation.  There is
            nothing to do in here.  Later exercises will replace this crude
            loop with a proper delay/sleep function. */
        }
    }

    //??????delete your task
}

void vTask2( void *pvParameters )
{
const char *pcTaskName = "Task 2 is running\n";
volatile unsigned long ul;

    /* As per most tasks, this task is implemented in an infinite loop. */
    for( ;; )
    {
        /* Print out the name of this task. */
        vPrintString( pcTaskName );

        /* Delay for a period. */
        for( ul = 0; ul < mainDELAY_LOOP_COUNT; ul++ )
        {
            /* This loop is just a very crude delay implementation.  There is
            nothing to do in here.  Later exercises will replace this crude
            loop with a proper delay/sleep function. */
        }
    }
}
/*-----------------------------------------------------------*/
void vApplicationMallocFailedHook( void )
{
    /* This function will only be called if an API call to create a task, queue
    or semaphore fails because there is too little heap RAM remaining. */
    for( ;; );
}
/*-----------------------------------------------------------*/


void vApplicationWhosebugHook( xTaskHandle *pxTask, signed char *pcTaskName )
{
    /* This function will only be called if a task overflows its stack.  Note
    that stack overflow checking does slow down the context switch
    implementation. */
    for( ;; );
}
/*-----------------------------------------------------------*/


void vApplicationIdleHook( void )
{
    /* This example does not use the idle hook to perform any processing. */
}
/*-----------------------------------------------------------*/


void vApplicationTickHook( void )
{
    /* This example does not use the tick hook to perform any processing. */
}

你可以练习什么类型的例子?可以找到 here