2018-10-28 17:39:56 +01:00
|
|
|
/****************************************************************************
|
2019-08-19 17:16:08 +02:00
|
|
|
* boards/arm/stm32/nucleo-f303ze/src/stm32_bringup.c
|
2018-10-28 17:39:56 +01:00
|
|
|
*
|
2021-03-19 12:39:00 +01:00
|
|
|
* 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
|
2018-10-28 17:39:56 +01:00
|
|
|
*
|
2021-03-19 12:39:00 +01:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2018-10-28 17:39:56 +01:00
|
|
|
*
|
2021-03-19 12:39:00 +01:00
|
|
|
* 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.
|
2018-10-28 17:39:56 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#include <nuttx/config.h>
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <syslog.h>
|
|
|
|
#include <errno.h>
|
|
|
|
|
|
|
|
#include "nucleo-f303ze.h"
|
|
|
|
|
|
|
|
#ifdef CONFIG_BUTTONS
|
|
|
|
# include <nuttx/input/buttons.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Functions
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Name: stm32_bringup
|
|
|
|
*
|
|
|
|
* Description:
|
|
|
|
* Perform architecture-specific initialization
|
|
|
|
*
|
2019-02-18 22:32:00 +01:00
|
|
|
* CONFIG_BOARD_LATE_INITIALIZE=y :
|
|
|
|
* Called from board_late_initialize().
|
2018-10-28 17:39:56 +01:00
|
|
|
*
|
2021-02-15 09:36:03 +01:00
|
|
|
* CONFIG_BOARD_LATE_INITIALIZE=n && CONFIG_LIB_BOARDCTL=y &&
|
|
|
|
* CONFIG_NSH_ARCHINIT:
|
2018-10-28 17:39:56 +01:00
|
|
|
* Called from the NSH library
|
|
|
|
*
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
int stm32_bringup(void)
|
|
|
|
{
|
|
|
|
int ret = OK;
|
|
|
|
|
|
|
|
UNUSED(ret);
|
|
|
|
|
2018-11-12 16:45:55 +01:00
|
|
|
#ifdef CONFIG_ADC
|
|
|
|
/* Initialize ADC and register the ADC driver. */
|
|
|
|
|
|
|
|
ret = stm32_adc_setup();
|
|
|
|
if (ret < 0)
|
|
|
|
{
|
|
|
|
syslog(LOG_ERR, "ERROR: stm32_adc_setup failed: %d\n", ret);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-10-28 17:39:56 +01:00
|
|
|
return OK;
|
|
|
|
}
|