From 9f95ff5b6ba01db09552b84a0ab79607060a2666 Mon Sep 17 00:00:00 2001 From: Ali Labbene Date: Wed, 11 Dec 2019 08:59:21 +0100 Subject: Official ARM version: v5.4.0 Add CMSIS V5.4.0, please refer to index.html available under \docs folder. Note: content of \CMSIS\Core\Include has been copied under \Include to keep the same structure used in existing projects, and thus avoid projects mass update Note: the following components have been removed from ARM original delivery (as not used in ST packages) - CMSIS_EW2018.pdf - .gitattributes - .gitignore - \Device - \CMSIS - \CoreValidation - \DAP - \Documentation - \DoxyGen - \Driver - \Pack - \RTOS\CMSIS_RTOS_Tutorial.pdf - \RTOS\RTX - \RTOS\Template - \RTOS2\RTX - \Utilities - All ARM/GCC projects files are deleted from \DSP, \RTOS and \RTOS2 Change-Id: Ia026c3f0f0d016627a4fb5a9032852c33d24b4d3 --- docs/Core_A/html/using_CMSIS.html | 185 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 docs/Core_A/html/using_CMSIS.html (limited to 'docs/Core_A/html/using_CMSIS.html') diff --git a/docs/Core_A/html/using_CMSIS.html b/docs/Core_A/html/using_CMSIS.html new file mode 100644 index 0000000..397e885 --- /dev/null +++ b/docs/Core_A/html/using_CMSIS.html @@ -0,0 +1,185 @@ + + + + + +Basic CMSIS Example +CMSIS-Core (Cortex-A): Basic CMSIS Example + + + + + + + + + + + + + + +
+
+ + + + + + + +
+
CMSIS-Core (Cortex-A) +  Version 1.1.2 +
+
CMSIS-Core support for Cortex-A processor-based devices
+
+
+ +
+
    + +
+
+ + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
Basic CMSIS Example
+
+
+

A typical example for using the CMSIS layer is provided below. The example is based on an unspecific Cortex-A9 Device.

+
#include <ARMCA9.h> // File name depends on device used
+
+
static const uint32_t TICK_RATE_HZ = 1000U;
+
+
uint32_t volatile msTicks; // Counter for millisecond Interval
+
+
static void SysTick_Handler( void )
+
{
+
msTicks++; // Increment Counter
+
}
+
+
// We use the Private Tiemer (PTIM) of the Cortex-A9 FVP Model here.
+
// In general the available Timers are highly vendor specific for Cortex-A processors.
+
void private_timer_init(void) {
+
+
PTIM_SetLoadValue ((SystemCoreClock/TICK_RATE_HZ) - 1U);
+ +
+
/* Install SysTick_Handler as the interrupt function for PTIM */
+ +
+
/* Determine number of implemented priority bits */
+ +
+
/* Set lowest priority -1 */
+ +
+
/* Enable IRQ */
+
IRQ_Enable ((IRQn_ID_t)PrivTimer_IRQn);
+
}
+
+
/* Delay execution for given amount of ticks */
+
void Delay(uint32_t ticks) {
+
uint32_t tgtTicks = msTicks + ticks; // target tick count to delay execution to
+
while (msTicks == tgtTicks) {
+
__WFE (); // Power-Down until next Event/Interrupt
+
}
+
}
+
+
/* main function */
+
int main(void)
+
{
+
/* Initialize device HAL here */
+
private_timer_init();
+
+
static uint8_t ledState = 0;
+
+
/* Infinite loop */
+
while (1)
+
{
+
/* Add application code here */
+
ledState = !ledState;
+
Delay(500);
+
}
+
}
+
+
+ + + + -- cgit