Skip to content
Snippets Groups Projects
Select Git revision
  • 45f6d33fa625e2c4f4f5d26e9862bc7f8d67c0f0
  • master default protected
  • rahix/user-space-ctx
  • schneider/iaq-python
  • schneider/ble-mini-demo
  • schneider/ble-ecg-stream-visu
  • schneider/mp-exception-print
  • schneider/sleep-display
  • schneider/deepsleep4
  • schneider/deepsleep2
  • schneider/deepsleep
  • schneider/ble-central
  • rahix/bluetooth-app-favorite
  • schneider/v1.17-changelog
  • schneider/ancs
  • schneider/png
  • schneider/freertos-list-debug
  • schneider/212-reset-hardware-when-entering-repl
  • schneider/bonding-fail-if-full
  • schneider/ble-fixes-2020-3
  • schneider/spo2-playground
  • v1.18
  • v1.17
  • v1.16
  • v1.15
  • v1.14
  • v1.13
  • v1.12
  • v1.11
  • v1.10
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
41 results

stack.c

Blame
  • Forked from card10 / firmware
    Source project has a limited visibility.
    stack.c 5.65 KiB
    /*************************************************************************************************/
    /*!
     *  \file
     *
     *  \brief  Stack initialization
     *
     *  Copyright (c) 2016-2017 ARM Ltd. All Rights Reserved.
     *  ARM Ltd. confidential and proprietary.
     *
     *  IMPORTANT.  Your use of this file is governed by a Software License Agreement
     *  ("Agreement") that must be accepted in order to download or otherwise receive a
     *  copy of this file.  You may not use or copy this file for any purpose other than
     *  as described in the Agreement.  If you do not agree to all of the terms of the
     *  Agreement do not use this file and delete all copies in your possession or control;
     *  if you do not have a copy of the Agreement, you must contact ARM Ltd. prior
     *  to any use, copying or further distribution of this software.
     */
    /*************************************************************************************************/
    
    /*
     * This file initializes the different components of the whole BLE stack. This inlucdes link level,
     * HCI, security, etc...
     *
     * This file has been copied from lib/sdk/Applications/EvKitExamples/BLE_fit/stack_fit.c
     *
     * NOTE: Different stack_*.c files in the SDK initialize different components. We have to
     * be very carefull to intitialize all needed components here. Think e.g. SecRandInit() ...
     *
     * Many components are related to the role of the device. Different components need to be
     * initialized for central and peripheral roles.
     */
    /* clang-format off */
    /* clang-formet turned off for easier diffing against orginal file */
    #include <stdio.h>
    #include <string.h>
    #include "wsf_types.h"
    #include "wsf_os.h"
    #include "util/bstream.h"
    #include "ble_api.h"
    #include "hci_handler.h"
    #include "dm_handler.h"
    #include "l2c_handler.h"
    #include "att_handler.h"
    #include "smp_handler.h"
    #include "l2c_api.h"
    #include "att_api.h"
    #include "smp_api.h"
    #include "app_api.h"
    #include "svc_dis.h"
    #include "svc_core.h"
    #include "sec_api.h"
    #include "ll_init_api.h"
    
    /* TODO: card10: Where does this number come from? Is there any documentation? */
    #define LL_IMPL_REV             0x2303
    
    /* TODO: card10: Where does this number come from? Is there any documentation? */
    #define LL_MEMORY_FOOTPRINT     0xC152
    
    uint8_t LlMem[LL_MEMORY_FOOTPRINT];
    
    const LlRtCfg_t _ll_cfg = {
        /* Device */
        /*compId*/                  LL_COMP_ID_ARM,
        /*implRev*/                 LL_IMPL_REV,
        /*btVer*/                   LL_VER_BT_CORE_SPEC_5_0,
        /*_align32 */               0, // padding for alignment
    
        /* Advertiser */
        /*maxAdvSets*/              4, // 4 Extended Advertising Sets