boards/esp32: allow board specific initialization
This commit is contained in:
parent
69f6cace31
commit
624c6f24ca
@ -30,7 +30,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void board_init(void)
|
void board_init_common(void)
|
||||||
{
|
{
|
||||||
#ifdef LED0_PIN
|
#ifdef LED0_PIN
|
||||||
gpio_init (LED0_PIN, GPIO_OUT);
|
gpio_init (LED0_PIN, GPIO_OUT);
|
||||||
|
|||||||
@ -147,13 +147,11 @@ extern mtd_dev_t *mtd0;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize board specific hardware
|
* @brief Initialize the hardware that is common for all ESP32 boards.
|
||||||
*
|
*
|
||||||
* Since all features of ESP32 boards are provided by the SOC, almost all
|
* This function has to be called from the board specific `board_init` function.
|
||||||
* initializations are done during the CPU initialization that is called from
|
|
||||||
* boot loader.
|
|
||||||
*/
|
*/
|
||||||
void board_init (void);
|
void board_init_common(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Print the board configuration in a human readable format
|
* @brief Print the board configuration in a human readable format
|
||||||
@ -164,6 +162,22 @@ void print_board_config (void);
|
|||||||
} /* end extern "C" */
|
} /* end extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#else /* ESP32_IDF_CODE */
|
||||||
|
|
||||||
|
#ifndef DOXYGEN
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* declaration of `board_init_common` is required when compiling vendor code */
|
||||||
|
extern void board_init_common(void);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* DOXYGEN */
|
||||||
#endif /* ESP32_IDF_CODE */
|
#endif /* ESP32_IDF_CODE */
|
||||||
#endif /* BOARD_COMMON_H */
|
#endif /* BOARD_COMMON_H */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
@ -58,5 +58,13 @@
|
|||||||
/* include definitions for optional hardware modules */
|
/* include definitions for optional hardware modules */
|
||||||
#include "board_modules.h"
|
#include "board_modules.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the board specific hardware
|
||||||
|
*/
|
||||||
|
static inline void board_init(void) {
|
||||||
|
/* there is nothing special to initialize on this board */
|
||||||
|
board_init_common();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* BOARD_H */
|
#endif /* BOARD_H */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
@ -98,6 +98,14 @@ extern "C" {
|
|||||||
/* include common board definitions as last step */
|
/* include common board definitions as last step */
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the board specific hardware
|
||||||
|
*/
|
||||||
|
static inline void board_init(void) {
|
||||||
|
/* there is nothing special to initialize on this board */
|
||||||
|
board_init_common();
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
} /* end extern "C" */
|
} /* end extern "C" */
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -1 +1,5 @@
|
|||||||
|
ifneq (,$(filter esp32_ttgo_t_beam_v1_0,$(USEMODULE)))
|
||||||
|
FEATURES_REQUIRED += periph_i2c
|
||||||
|
endif
|
||||||
|
|
||||||
include $(RIOTBOARD)/common/esp32/Makefile.dep
|
include $(RIOTBOARD)/common/esp32/Makefile.dep
|
||||||
|
|||||||
@ -79,5 +79,10 @@
|
|||||||
/* include common board definitions as last step */
|
/* include common board definitions as last step */
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the board specific hardware
|
||||||
|
*/
|
||||||
|
void board_init(void);
|
||||||
|
|
||||||
#endif /* BOARD_H */
|
#endif /* BOARD_H */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
@ -80,5 +80,13 @@
|
|||||||
/* include common board definitions as last step */
|
/* include common board definitions as last step */
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the board specific hardware
|
||||||
|
*/
|
||||||
|
static inline void board_init(void) {
|
||||||
|
/* there is nothing special to initialize on this board */
|
||||||
|
board_init_common();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* BOARD_H */
|
#endif /* BOARD_H */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
@ -64,5 +64,13 @@
|
|||||||
/* include common board definitions as last step */
|
/* include common board definitions as last step */
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the board specific hardware
|
||||||
|
*/
|
||||||
|
static inline void board_init(void) {
|
||||||
|
/* there is nothing special to initialize on this board */
|
||||||
|
board_init_common();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* BOARD_H */
|
#endif /* BOARD_H */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
@ -108,5 +108,13 @@
|
|||||||
/* include common board definitions as last step */
|
/* include common board definitions as last step */
|
||||||
#include "board_common.h"
|
#include "board_common.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Initialize the board specific hardware
|
||||||
|
*/
|
||||||
|
static inline void board_init(void) {
|
||||||
|
/* there is nothing special to initialize on this board */
|
||||||
|
board_init_common();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* BOARD_H */
|
#endif /* BOARD_H */
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user