BLE_API v2.1.3

Modules | Macros
MCU Definition
Porting » MCU Porting Related

## Modules
| MCU Clock Source Definition
| Defined supported MCU clock source for user.

## Macros
#define | _USE_MCU_CLK_ MCU_CLK_SOURCE_HIRC
#define | _CHIP_M031BT 0
| Defined the MCU chip.
#define | _CHIP_M032BT 1
#define | _CHIP_SELECTION_ _CHIP_M031BT
#define | MCU_CLK_SOURCE_HXT 0
#define | MCU_CLK_SOURCE_HIRC 1
#define | MCU_CLK_SOURCE_PLL 2
#define | CPU_CLOCK_RATE 48000000u
#define | PCLK_DIV 2u
#define | InterruptDisable __disable_irq
| Different MCU may supports different interrupt definition. More...
#define | InterruptEnable __enable_irq

## Detailed Description

MCU setting definition for user configuration are listed as following.

      1. _USE_MCU_CLK_
      2. CPU_CLOCK_RATE
      3. PCLK_DIV
      4. InterruptDisable
      5. InterruptEnable

## Macro Definition Documentation

## ◆ _USE_MCU_CLK_

#define _USE_MCU_CLK_ MCU_CLK_SOURCE_HIRC

Selected the clock source from MCU clock source definition list. Selected the clock source from MCU clock source definition list

## ◆ CPU_CLOCK_RATE

#define CPU_CLOCK_RATE 48000000u

CPU clock rate

## ◆ InterruptDisable

#define InterruptDisable __disable_irq

Different MCU may supports different interrupt definition.

Note
  If it is not ARM based MCU please undefined it and re-defined InterruptDisable and InterruptEnable. Disable interrupt function definition for ARM based.

## ◆ InterruptEnable

#define InterruptEnable __enable_irq

Enable interrupt function definition for ARM based.

## ◆ MCU_CLK_SOURCE_HIRC

#define MCU_CLK_SOURCE_HIRC 1

HIRC

## ◆ MCU_CLK_SOURCE_HXT

#define MCU_CLK_SOURCE_HXT 0

HXT

## ◆ MCU_CLK_SOURCE_PLL

#define MCU_CLK_SOURCE_PLL 2

PLL

## ◆ PCLK_DIV

#define PCLK_DIV 2u

PCLK=CPU_CLOCK_RATE/PCLK_DIV. it is better to choose PCLK=8*N (24MHz or 32MHz) for SPI_clock=12M