andrzej-kaczmarek commented on a change in pull request #841: URL: https://github.com/apache/mynewt-nimble/pull/841#discussion_r451145870
########## File path: nimble/drivers/nrf5340/src/ble_phy.c ########## @@ -0,0 +1,2001 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#include <stdint.h> +#include <string.h> +#include <assert.h> +#include <syscfg/syscfg.h> +#include <os/os.h> +#include <nimble/ble.h> +#include <nimble/nimble_opt.h> +#include <nimble/nimble_npl.h> +#include <controller/ble_phy.h> + +#include <ble/xcvr.h> +#include <controller/ble_phy_trace.h> +#include <controller/ble_ll.h> +#include <mcu/nrf5340_net_clock.h> +#include <mcu/cmsis_nvic.h> + +/* + * NOTE: This code uses 1-6 DPPI channels so care should be taken when using + * DPPI somewhere else. + * TODO maybe we could reduce number of used channels if we reuse same channel + * for mutually exclusive events but for now make it simpler to debug. + */ + +#define DPPI_CH_TIMER0_EVENTS_COMPARE_0 DPPIC_CHEN_CH0_Pos +#define DPPI_CH_TIMER0_EVENTS_COMPARE_3 DPPIC_CHEN_CH1_Pos +#define DPPI_CH_RADIO_EVENTS_END DPPIC_CHEN_CH2_Pos +#define DPPI_CH_RADIO_EVENTS_BCMATCH DPPIC_CHEN_CH3_Pos +#define DPPI_CH_RADIO_EVENTS_ADDRESS DPPIC_CHEN_CH4_Pos +#define DPPI_CH_RTC0_EVENTS_COMPARE_0 DPPIC_CHEN_CH5_Pos Review comment: it just does not make sense to use those symbols as a channel number (i.e. field value in some other register) - `DPPIC_CHEN_CH5_Pos` is a position of `CH5` field in `DPPIC->CHEN` register so the only reason it has the same value as channel number is because there are 32 fields there numbered 0..31 :) ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
