mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 04:52:59 +01:00
boards/esp32-ttgo-t-beam: switch on GPS module
This commit is contained in:
parent
3208207ec5
commit
c30674d539
56
boards/esp32-ttgo-t-beam/board.c
Normal file
56
boards/esp32-ttgo-t-beam/board.c
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright (C) 2019 Gunar Schorcht
|
||||
*
|
||||
* This file is subject to the terms and conditions of the GNU Lesser
|
||||
* General Public License v2.1. See the file LICENSE in the top level
|
||||
* directory for more details.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup boards_esp32_ttgo-t-beam
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Board specific definitions for TTGO T-Beam board
|
||||
*
|
||||
* @author Gunar Schorcht <gunar@schorcht.net>
|
||||
*/
|
||||
|
||||
#include "board.h"
|
||||
|
||||
#if MODULE_ESP32_TTGO_T_BEAM_V1_0
|
||||
#include "periph/i2c.h"
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define AXP192_I2C_ADDR (0x34)
|
||||
#define AXP192_LDO234_DC23_CTL (0x12)
|
||||
#define AXP192_LDO3OUT_VOL (0x29)
|
||||
#define AXP192_LDO3_ON_BIT (1 << 3)
|
||||
|
||||
void board_init(void)
|
||||
{
|
||||
board_init_common();
|
||||
|
||||
#if MODULE_ESP32_TTGO_T_BEAM_V1_0
|
||||
uint8_t reg;
|
||||
|
||||
i2c_acquire(I2C_DEV(0));
|
||||
/* enable the LDO3 power control */
|
||||
i2c_read_reg(I2C_DEV(0), AXP192_I2C_ADDR, AXP192_LDO234_DC23_CTL, ®, 0);
|
||||
reg |= AXP192_LDO3_ON_BIT;
|
||||
i2c_write_reg(I2C_DEV(0), AXP192_I2C_ADDR, AXP192_LDO234_DC23_CTL, reg, 0);
|
||||
/* set the output voltage to 3V3 */
|
||||
i2c_write_reg(I2C_DEV(0), AXP192_I2C_ADDR, AXP192_LDO3OUT_VOL, 0xff, 0);
|
||||
i2c_release(I2C_DEV(0));
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /* end extern "C" */
|
||||
#endif
|
||||
|
||||
/** @} */
|
Loading…
Reference in New Issue
Block a user