本文整理汇总了C++中pmic_init函数的典型用法代码示例。如果您正苦于以下问题:C++ pmic_init函数的具体用法?C++ pmic_init怎么用?C++ pmic_init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pmic_init函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: bluetooth_init
void bluetooth_init(void)
{
ioport_set_pin_dir(BT_TX,IOPORT_DIR_OUTPUT);
static usart_serial_options_t usart_options = {
.baudrate = 115200,
.charlength = USART_CHSIZE_8BIT_gc,
.paritytype = USART_PMODE_DISABLED_gc,
.stopbits = false
};
usart_serial_init(BLUETOOTH, &usart_options);
#ifdef PRINTF_BLUETOOTH
// setup our stdio stream
stdout = &mystdout;
stdin = &mystdout;
#endif
}
void bluetooth_init_interrupt(void)
{
pmic_init();
pmic_set_scheduling(PMIC_SCH_ROUND_ROBIN);
USARTD0.CTRLA = USART_RXCINTLVL_HI_gc;
cpu_irq_enable();
}
示例2: main
/**
* \brief Main function.
*
* Initializes the board, and runs the application in an infinite loop.
*/
int main(void)
{
/* hardware initialization */
sysclk_init();
board_init();
pmic_init();
timer_init();
rs485_init();
led_init();
adc_init();
#ifdef CONF_BOARD_ENABLE_RS485_XPLAINED
// Enable display backlight
gpio_set_pin_high(NHD_C12832A1Z_BACKLIGHT);
#endif
// Workaround for known issue: Enable RTC32 sysclk
sysclk_enable_module(SYSCLK_PORT_GEN, SYSCLK_RTC);
while (RTC32.SYNCCTRL & RTC32_SYNCBUSY_bm) {
// Wait for RTC32 sysclk to become stable
}
cpu_irq_enable();
/* application initialization */
rs485_baud_rate_set(38400);
bacnet_init();
/* run forever - timed tasks */
timer_callback(bacnet_task_timed, 5);
for (;;) {
bacnet_task();
led_task();
}
}
示例3: board_init
int board_init(void)
{
/* address of boot parameters */
gd->bd->bi_boot_params = PHYS_SDRAM + 0x100;
setup_i2c(0, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info1);
setup_i2c(1, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info_loc);
setup_i2c(2, CONFIG_SYS_I2C_SPEED, 0x7f, &i2c_pad_info3);
#if defined(CONFIG_VIDEO_IPUV3)
setup_display();
#endif
#ifdef CONFIG_TDX_CMD_IMX_MFGR
(void) pmic_init();
#endif
#ifdef CONFIG_SATA
setup_sata();
#endif
setup_iomux_gpio();
return 0;
}
示例4: bootblock_mainboard_init
void bootblock_mainboard_init(void)
{
set_clock_sources();
/* Set up the pads required to load romstage. */
soc_configure_pads(padcfgs, ARRAY_SIZE(padcfgs));
soc_configure_funits(funits, ARRAY_SIZE(funits));
/* PMIC */
i2c_init(I2CPWR_BUS);
pmic_init(I2CPWR_BUS);
/* TPM */
i2c_init(I2C3_BUS);
/* EC */
i2c_init(I2C2_BUS);
/*
* Set power detect override for GPIO, audio & sdmmc3 rails.
* GPIO rail override is required to put it into 1.8V mode.
*/
pmc_override_pwr_det(PMC_GPIO_RAIL_AO_MASK | PMC_AUDIO_RAIL_AO_MASK |
PMC_SDMMC3_RAIL_AO_MASK, PMC_GPIO_RAIL_AO_DISABLE |
PMC_AUDIO_RAIL_AO_DISABLE |
PMC_SDMMC3_RAIL_AO_DISABLE);
}
示例5: main
int main (void)
{
sysclk_init();
pmic_init();
port_init();
tc_init();
wdt_set_timeout_period(WDT_TIMEOUT_PERIOD_32CLK);
wdt_enable();
usart_init();
spi_init();
char str[200];
uint8_t count ;
count = sprintf(str,"RESET");
for (uint8_t i=0;i<count;i++)
usart_putchar(&USARTE0,str[i]);
nrf_init(Address);
sei();
for (uint8_t i=0;i<Max_Robot;i++)
{
Robot_D_tmp[2][i].RID=12;
}
while (1)
{
}
}
示例6: exynos_power_init
int exynos_power_init(void)
{
pmic_init(0);
pmic_init_max77686();
return 0;
}
示例7: main
/**
* \brief Run low power demo
*
* This function initializes the XMEGA to the least power consuming state,
* before initializing the sleep manager interrupts on switchports.
* The device is then put to sleep, and the sleep mode is configured by the
* interrupt routines.
*/
int main(void)
{
board_init();
sysclk_init();
lowpower_init();
/* Initialize the sleep manager. */
sleepmgr_init();
/* Enable interrupts from switchports on
* low level to sense all interrupts */
pmic_init();
SWITCHPORT0.INTCTRL = SWITCHPORT_INT_LEVEL;
SWITCHPORT1.INTCTRL = SWITCHPORT_INT_LEVEL;
SWITCHPORT0.INT0MASK = SWITCHMASK0;
SWITCHPORT1.INT0MASK = SWITCHMASK1;
ioport_configure_port_pin(&SWITCHPORT0,
SWITCHMASK0, IOPORT_LEVEL | IOPORT_PULL_UP);
ioport_configure_port_pin(&SWITCHPORT1,
SWITCHMASK1, IOPORT_LEVEL | IOPORT_PULL_UP);
cpu_irq_enable();
/* Start in active mode */
sleepmgr_lock_mode(SLEEPMGR_ACTIVE);
/* Go to sleep, sleep modes are configured by interrupt routines. */
while (1) {
sleepmgr_enter_sleep();
}
}
示例8: power_init
void power_init(void)
{
unsigned int val;
struct pmic *p;
pmic_init();
p = get_pmic();
/* Set VDDA to 1.25V */
pmic_reg_read(p, REG_SW_2, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_25;
pmic_reg_write(p, REG_SW_2, val);
/*
* Need increase VCC and VDDA to 1.3V
* according to MX53 IC TO2 datasheet.
*/
if (is_soc_rev(CHIP_REV_2_0) == 0) {
/* Set VCC to 1.3V for TO2 */
pmic_reg_read(p, REG_SW_1, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_30;
pmic_reg_write(p, REG_SW_1, val);
/* Set VDDA to 1.3V for TO2 */
pmic_reg_read(p, REG_SW_2, &val);
val &= ~SWX_OUT_MASK;
val |= SWX_OUT_1_30;
pmic_reg_write(p, REG_SW_2, val);
}
}
示例9: v2x_board_init
/* This function is meant to contain board-specific initialization code
* for, e.g., the I/O pins. The initialization can rely on application-
* specific board configuration, found in conf_board.h.
*/
void v2x_board_init(void)
{
irq_initialize_vectors();
pmic_init();
sysclk_init(); //configure clock sources for core and USB
sleepmgr_init(); // Initialize the sleep manager
ioport_init(); //Initializes the IOPORT service
pin_init(); //whole chip pin init, modes and initial conditions
spi_start(); //start SPI driver
PWR_init(); //sets SR to default states - holds power up
cpu_irq_enable();
eeprom_init(); //verifies eeprom safe for use
menu_init(); //loads menu settings
time_init(); //starts the RTC
button_init(); //init button stuffs
ACL_init(); //configures, but does not start sampling
GSM_usart_init(); //starts direct serial channel to the SIM module
CAN_uart_start(); //starts direct serial channel to the ELM module
canbus_serial_routing(AVR_ROUTING); //cause the serial 3-state buffer to route the serial path from the ELM to the FTDI
udc_start(); //start stack and vbus monitoring
PWR_hub_start(); //connect the hub to the computer
//autostart all systems
delay_ms(500);
GSM_modem_init();
CAN_elm_init();
ACL_set_sample_on();
PWR_host_start();
}
示例10: board_late_init
int board_late_init(void)
{
#ifdef CONFIG_CMD_BMODE
add_board_boot_modes(board_boot_modes);
#endif
#ifdef CONFIG_VIDEO_IPUV3
/* We need at least 200ms between power on and backlight on
* as per specifications from CHI MEI */
mdelay(250);
/* enable backlight PWM 1 */
pwm_init(0, 0, 0);
/* duty cycle 5000000ns, period: 5000000ns */
pwm_config(0, 5000000, 5000000);
/* Backlight Power */
gpio_direction_output(LVDS_BACKLIGHT_GP, 1);
pwm_enable(0);
#endif
/* board specific pmic init */
pmic_init();
return 0;
}
示例11: main
int main(void)
{
pmic_init();
board_init();
sysclk_init();
sleepmgr_init();
cpu_irq_enable();
#if (BOARD == XMEGA_A3BU_XPLAINED)
/* The status LED must be used as LED2, so we turn off
* the green led which is in the same packaging. */
ioport_set_pin_high(LED3_GPIO);
#endif
/*
* Unmask clock for TIMER_EXAMPLE
*/
tc_enable(&TIMER_EXAMPLE);
/*
* Configure interrupts callback functions for TIMER_EXAMPLE
* overflow interrupt, CCA interrupt and CCB interrupt
*/
tc_set_overflow_interrupt_callback(&TIMER_EXAMPLE,
example_ovf_interrupt_callback);
tc_set_cca_interrupt_callback(&TIMER_EXAMPLE,
example_cca_interrupt_callback);
tc_set_ccb_interrupt_callback(&TIMER_EXAMPLE,
example_ccb_interrupt_callback);
/*
* Configure TC in normal mode, configure period, CCA and CCB
* Enable both CCA and CCB channels
*/
tc_set_wgm(&TIMER_EXAMPLE, TC_WG_NORMAL);
tc_write_period(&TIMER_EXAMPLE, TIMER_EXAMPLE_PERIOD);
tc_write_cc(&TIMER_EXAMPLE, TC_CCA, TIMER_EXAMPLE_PERIOD / 2);
tc_write_cc(&TIMER_EXAMPLE, TC_CCB, TIMER_EXAMPLE_PERIOD / 4);
tc_enable_cc_channels(&TIMER_EXAMPLE,(enum tc_cc_channel_mask_enable_t)(TC_CCAEN | TC_CCBEN));
/*
* Enable TC interrupts (overflow, CCA and CCB)
*/
tc_set_overflow_interrupt_level(&TIMER_EXAMPLE, TC_INT_LVL_LO);
tc_set_cca_interrupt_level(&TIMER_EXAMPLE, TC_INT_LVL_LO);
tc_set_ccb_interrupt_level(&TIMER_EXAMPLE, TC_INT_LVL_LO);
/*
* Run TIMER_EXAMPLE at TIMER_EXAMPLE_PERIOD(31250Hz) resolution
*/
tc_set_resolution(&TIMER_EXAMPLE, TIMER_EXAMPLE_PERIOD);
do {
/* Go to sleep, everything is handled by interrupts. */
sleepmgr_enter_sleep();
} while (1);
}
示例12: power_init_board
int power_init_board(void)
{
int ret;
ret = pmic_init(I2C_5);
if (ret)
return ret;
return 0;
}
示例13: main
/**
* \brief Main application routine
* - Initializes the board and LCD display
* - Initialize ADC ,to read ADC offset and configure for oversampling
* - If number of sample Reached to total number of oversample required,
* call function to start process on oversampled ADC readings
*/
int main( void )
{
/*
* Initialize basic features for the AVR XMEGA family.
* - PMIC is needed to enable all interrupt levels.
* - Board init for setting up GPIO and board specific features.
* - Sysclk init for configuring clock speed and turning off unused
* peripherals.
* - Sleepmgr init for setting up the basics for the sleep manager,
*/
board_init();
sysclk_init();
pmic_init();
sleepmgr_init();
/* Initialize ST7565R controller and LCD display */
gfx_mono_init();
/* Display headings on LCD for oversampled result */
gfx_mono_draw_string("Oversampled", 0, 0, &sysfont);
/* Display headings on LCD for normal result */
gfx_mono_draw_string("Normal", 80, 0, &sysfont);
/* Initialize ADC ,to read ADC offset and configure ADC for oversampling
**/
init_adc();
/* Enable global interrupt */
cpu_irq_enable();
/* Switch ON LCD back light */
ioport_set_pin_high(NHD_C12832A1Z_BACKLIGHT);
/* Set LCD contrast */
st7565r_set_contrast(ST7565R_DISPLAY_CONTRAST_MIN);
/* Continuous Execution Loop */
while (1) {
/*
* Check if number of sample reached to total Number of
* oversample required by checking status of
* adc_oversampled_flag
*/
if (adc_oversampled_flag == true) {
/* Reset the adc_oversampled_flag */
adc_oversampled_flag = false;
/* Process all received ADC samples and calculate analog
* input */
adc_oversampled();
}
}
}
示例14: bootblock_mainboard_init
void bootblock_mainboard_init(void)
{
set_clock_sources();
/* Set up controllers and pads to load romstage. */
soc_configure_funits(funits, ARRAY_SIZE(funits));
soc_configure_pads(padcfgs, ARRAY_SIZE(padcfgs));
i2c_init(I2CPWR_BUS);
pmic_init(I2CPWR_BUS);
}
示例15: power_init
static int power_init(void)
{
unsigned int val;
int ret = -1;
struct pmic *p;
if (!i2c_probe(CONFIG_SYS_DIALOG_PMIC_I2C_ADDR)) {
pmic_dialog_init();
p = get_pmic();
/* Set VDDA to 1.25V */
val = DA9052_BUCKCORE_BCOREEN | DA_BUCKCORE_VBCORE_1_250V;
ret = pmic_reg_write(p, DA9053_BUCKCORE_REG, val);
ret |= pmic_reg_read(p, DA9053_SUPPLY_REG, &val);
val |= DA9052_SUPPLY_VBCOREGO;
ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, val);
/* Set Vcc peripheral to 1.30V */
ret |= pmic_reg_write(p, DA9053_BUCKPRO_REG, 0x62);
ret |= pmic_reg_write(p, DA9053_SUPPLY_REG, 0x62);
}
if (!i2c_probe(CONFIG_SYS_FSL_PMIC_I2C_ADDR)) {
pmic_init();
p = get_pmic();
/* Set VDDGP to 1.25V for 1GHz on SW1 */
pmic_reg_read(p, REG_SW_0, &val);
val = (val & ~SWx_VOLT_MASK_MC34708) | SWx_1_250V_MC34708;
ret = pmic_reg_write(p, REG_SW_0, val);
/* Set VCC as 1.30V on SW2 */
pmic_reg_read(p, REG_SW_1, &val);
val = (val & ~SWx_VOLT_MASK_MC34708) | SWx_1_300V_MC34708;
ret |= pmic_reg_write(p, REG_SW_1, val);
/* Set global reset timer to 4s */
pmic_reg_read(p, REG_POWER_CTL2, &val);
val = (val & ~TIMER_MASK_MC34708) | TIMER_4S_MC34708;
ret |= pmic_reg_write(p, REG_POWER_CTL2, val);
/* Set VUSBSEL and VUSBEN for USB PHY supply*/
pmic_reg_read(p, REG_MODE_0, &val);
val |= (VUSBSEL_MC34708 | VUSBEN_MC34708);
ret |= pmic_reg_write(p, REG_MODE_0, val);
/* Set SWBST to 5V in auto mode */
val = SWBST_AUTO;
ret |= pmic_reg_write(p, SWBST_CTRL, val);
}
return ret;
}