本文整理汇总了C++中clock_setup函数的典型用法代码示例。如果您正苦于以下问题:C++ clock_setup函数的具体用法?C++ clock_setup怎么用?C++ clock_setup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了clock_setup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: stmmac_setup
static int stmmac_setup(void)
{
clock_setup(SYSCFG_CLOCK_CFG);
/* Set >RMII mode */
STM32_SYSCFG->pmc |= SYSCFG_PMC_MII_RMII_SEL;
clock_setup(STMMAC_CLOCK_CFG);
return 0;
}
开发者ID:eballetbo,项目名称:u-boot,代码行数:9,代码来源:stm32f746-disco.c
示例2: main
int main(void)
{
clock_setup();
gpio_setup();
hal_tick_init();
debug_usart_setup();
bluetooth_setup();
// start with BTstack init - especially configure HCI Transport
btstack_memory_init();
run_loop_init(RUN_LOOP_EMBEDDED);
// init HCI
hci_transport_t * transport = hci_transport_h4_dma_instance();
bt_control_t * control = bt_control_cc256x_instance();
remote_device_db_t * remote_db = (remote_device_db_t *) &remote_device_db_memory;
hci_init(transport, (void*) &hci_uart_config_cc256x, control, remote_db);
// enable eHCILL
bt_control_cc256x_enable_ehcill(1);
// hand over to btstack embedded code
btstack_main();
// go
run_loop_execute();
return 0;
}
开发者ID:Mechelix,项目名称:btstack,代码行数:29,代码来源:main.c
示例3: main
int main(void)
{
int i;
struct color colors[COLOR_COUNT];
clock_setup();
gpio_setup();
reset_colors(colors, COLOR_COUNT);
init_colors(colors, COLOR_COUNT);
while (1) {
gpio_toggle(GPIOC, GPIO12); /* LED on/off */
send_colors(colors, COLOR_COUNT);
step_colors(colors, COLOR_COUNT);
for (i = 0; i < 1000000; i++) /* Wait a bit. */
__asm__("nop");
}
return 0;
}
开发者ID:BuFran,项目名称:libopencm3-examples,代码行数:25,代码来源:led_stripe.c
示例4: board_eth_enable
int board_eth_enable(void)
{
stv0991_pinmux_config(ETH_GPIOB_10_31_C_0_4);
clock_setup(ETH_CLOCK_CFG);
enable_eth_phy();
return 0;
}
开发者ID:OpenNoah,项目名称:u-boot,代码行数:7,代码来源:stv0991.c
示例5: main
int main(void)
{
clock_setup();
usart_clock_setup();
gpio_setup();
usart_setup();
printf("\r\nstarting i2c scan.\r\n");
int i, j;
for (i = 1; i < 0x80; i++) {
i2c_init();
msleep(50);
for (j = 0; j < 0x100; j++) {
int data; // = 0;
data = i2c_read(I2C3, i, j);
if (data > -1) {
if (data) {
printf("device on address 0x%02X : reg = 0x%02X with data == 0x%02X\r\n", i, j, data);
}
} else {
printf("errerr!!\r\n");
break;
}
//i2c_send_stop(I2C3);
}
i2c_deinit();
msleep(50);
}
printf("scan ended!\r\n");
return 0;
}
开发者ID:brabo,项目名称:stm32f4-i2c-scan,代码行数:32,代码来源:i2c-scan.c
示例6: main
int main(void)
{
int i, j = 0, c = 0;
clock_setup();
gpio_setup();
usart_setup();
/* Blink the LED (PE10) on the board with every transmitted byte. */
while (1) {
gpio_toggle(GPIO_PE10); /* LED on/off */
usart_send_blocking(USART1, c + '0'); /* USART1: Send byte. */
usart_send_blocking(USART2, c + '0'); /* USART2: Send byte. */
usart_send_blocking(USART3, c + '0'); /* USART3: Send byte. */
c = (c == 9) ? 0 : c + 1; /* Increment c. */
if ((j++ % 80) == 0) { /* Newline after line full. */
usart_send_blocking(USART1, '\r');
usart_send_blocking(USART1, '\n');
usart_send_blocking(USART2, '\r');
usart_send_blocking(USART2, '\n');
usart_send_blocking(USART3, '\r');
usart_send_blocking(USART3, '\n');
}
for (i = 0; i < 800000; i++) /* Wait a bit. */
__asm__ ("nop");
}
return 0;
}
开发者ID:tyoshid,项目名称:libopenstm32l1,代码行数:29,代码来源:usart.c
示例7: main
int main(void)
{
uint16_t printer_data = 0xff;
clock_setup();
gpio_setup();
mco_setup();
usart_setup();
spi_setup();
//timer_setup();
systick_setup(SYSTICK_FREQ);
print("Hello from STM32F0\n");
// StepperMotor engine(GPIOA, M1,M2,M3,M4);
//gpio_port_write(GPIOA,0);
// gpio_set(GPIOA,GPIO1);
//engine.step(100);
while (1) {
printer_send(printer_data);
engine.step(1);
delay(200);
//engine.step(1);
/*
for(i = 0; i < sizeof(steps)/sizeof(steps[0]);i++) {
gpio_port_write(GPIOA,steps[i]);
delay(3);
}
*/
};
}
开发者ID:MrSpock,项目名称:stm32f0-libopencm3-template,代码行数:29,代码来源:main.cpp
示例8: uart_setup_gpio
int uart_setup_gpio(void)
{
int i;
int rv = 0;
clock_setup(GPIO_A_CLOCK_CFG);
clock_setup(GPIO_B_CLOCK_CFG);
for (i = 0; i < ARRAY_SIZE(usart_gpio); i++) {
rv = stm32_gpio_config(&usart_gpio[i], &gpio_ctl_usart);
if (rv)
goto out;
}
out:
return rv;
}
开发者ID:SunnyBrother,项目名称:u-boot-at91,代码行数:16,代码来源:stm32f746-disco.c
示例9: main
int main(void)
{
int i;
int j = 0;
clock_setup();
usart_setup();
printf("hi guys!\n");
adc_setup();
/* green led for ticking */
gpio_mode_setup(LED_DISCO_GREEN_PORT, GPIO_MODE_OUTPUT, GPIO_PUPD_NONE,
LED_DISCO_GREEN_PIN);
while (1) {
//uint16_t input_adc0 = read_adc_naiive(0);
//uint16_t target = input_adc0 / 2;
//uint16_t input_adc1 = ((uint16_t)((read_adc_naiive(18) - 760) / 25) + 25);
int i;
for (i = 0; i < 0x13; i++) {
uint16_t input_adc1 = read_adc_naiive(i);
printf("tick: %d: adc1_%02X=%d\n", j++, i, input_adc1);
}
uint32_t reg = ADC_CCR;
printf("reg = 0x%08X\r\n", reg);
/* LED on/off */
gpio_toggle(LED_DISCO_GREEN_PORT, LED_DISCO_GREEN_PIN);
for (i = 0; i < 1000000; i++) { /* Wait a bit. */
__asm__("NOP");
}
}
return 0;
}
开发者ID:brabo,项目名称:disco,代码行数:35,代码来源:adc-temp.c
示例10: main
int main(void)
{
int i;
clock_setup();
button_setup();
gpio_setup();
/* Blink the LED (PD12) on the board. */
while (1) {
gpio_toggle(GPIOD, GPIO12);
/* Upon button press, blink more slowly. */
if (gpio_get(GPIOA, GPIO0)) {
for (i = 0; i < 3000000; i++) { /* Wait a bit. */
__asm__("nop");
}
}
for (i = 0; i < 3000000; i++) { /* Wait a bit. */
__asm__("nop");
}
}
return 0;
}
开发者ID:ChuckM,项目名称:libopencm3-examples,代码行数:26,代码来源:button.c
示例11: main
int main()
{
init_gpio_led();
set_clock_on_mco();
clock_setup();
while (1) {
//led_blue(1);
//delay_us(100);
//led_blue(0);
//delay_ms(1);
//delay_ms(1000);
//led_green(1);
//delay_ms(50);
//led_green(0);
//delay_ms(1000);
GPIOC->ODR |= (1 << LED_BLUE);
delay_us(1);
GPIOC->ODR &= ~(1 << LED_BLUE);
delay_us(1);
//send_command(0, 0, 0);
//delay_ms(180);
}
return 0;
}
开发者ID:JavaWarrior,项目名称:stm32-test,代码行数:29,代码来源:main.c
示例12: main
int main(void)
{
#if defined(BOOTLOADER8K)
SCB_VTOR = (uint32_t) 0x08002000;
#endif
int i;
clock_setup();
gpio_setup();
/* Blink the LED on the board. */
while (1) {
gpio_toggle(LED_GPIO, LED_PIN);
/* Upon button press, blink more slowly. */
if (gpio_get(BUTTON_GPIO, BUTTON_PIN)) {
for (i = 0; i < 2000000; i++) { /* Wait a bit. */
__asm__("nop");
}
}
for (i = 0; i < 2000000; i++) { /* Wait a bit. */
__asm__("nop");
}
}
return 0;
}
开发者ID:flabbergast,项目名称:libopencm3-ex,代码行数:29,代码来源:button.c
示例13: setup_devices
static int setup_devices() {
// Basic prerequisites for everything else
miu_setup();
power_setup();
clock_setup();
// Need interrupts for everything afterwards
interrupt_setup();
// gpio_setup(); // Not yet
// For scheduling/sleeping niceties
timer_setup();
event_setup();
#ifndef CONFIG_IPHONE_4
wdt_setup();
#endif
// Other devices
usb_shutdown();
#ifndef CONFIG_IPHONE_4
uart_setup();
i2c_setup();
dma_setup();
spi_setup();
#endif
return 0;
}
开发者ID:adityadx,项目名称:openiBoot,代码行数:32,代码来源:openiboot.c
示例14: main
int main(void)
{
int i;
clock_setup();
gpio_setup();
button_setup();
/* Blink the LED (PC9) on the board. */
while (1) {
gpio_toggle(GPIOC, GPIO9);
/* Upon button press, blink more slowly. */
exti_line_state = GPIOA_IDR;
if ((exti_line_state & (1 << 0)) != 0) {
for (i = 0; i < 800000; i++) /* Wait a bit. */
__asm__("nop");
}
for (i = 0; i < 800000; i++) /* Wait a bit. */
__asm__("nop");
}
return 0;
}
开发者ID:SnoreCopter,项目名称:libopencm3-examples,代码行数:25,代码来源:button.c
示例15: platform_init
void platform_init()
{
arm_setup();
mmu_setup();
tasks_setup();
// Basic prerequisites for everything else
miu_setup();
power_setup();
clock_setup();
// Need interrupts for everything afterwards
interrupt_setup();
gpio_setup();
// For scheduling/sleeping niceties
timer_setup();
event_setup();
// Other devices
usb_shutdown();
uart_setup();
i2c_setup();
// DMA currently fucks up. Need to check why. -- Bluerise
// dma_setup();
LeaveCriticalSection();
framebuffer_hook(); // TODO: Remove once LCD implemented -- Ricky26
framebuffer_setdisplaytext(TRUE);
}
开发者ID:boydcase31,项目名称:openiBoot,代码行数:34,代码来源:a4.c
示例16: main
int main(void)
{
int i, j;
clock_setup();
gpio_setup();
usart_setup();
printf("\nStandard I/O Example.\n");
/* Blink the LED (PD12) on the board with every transmitted byte. */
while (1) {
int delay = 0;
char local_buf[32];
gpio_toggle(GPIOA, GPIO5); /* LED on/off */
do {
printf("Enter the delay constant for blink : ");
fflush(stdout);
fgets(local_buf, 32, stdin);
delay = atoi(local_buf);
if (delay <= 0) {
printf("Error: expected a delay > 0\n");
}
} while (delay <= 0);
printf("Blinking with a delay of %d\n", delay);
for (j = 0; j < 1000; j++) {
gpio_toggle(GPIOA, GPIO5);
for (i = 0; i < delay; i++) { /* Wait a bit. */
__asm__("NOP");
}
}
}
return 0;
}
开发者ID:insane-adding-machines,项目名称:unicore-mx-examples,代码行数:35,代码来源:usart-stdio.c
示例17: main
int main(void)
{
clock_setup();
gpio_setup();
usart_setup();
i2c_setup();
/*uint8_t data[1]={(0x4 << ACC_CTRL_REG1_A_ODR_SHIFT) | ACC_CTRL_REG1_A_XEN};*/
uint8_t data[1]={0x97};
write_i2c(I2C1, I2C_ACC_ADDR, ACC_CTRL_REG1_A, 1, data);
data[0]=0x08;
write_i2c(I2C1, I2C_ACC_ADDR, ACC_CTRL_REG4_A, 1, data);
uint16_t acc_x;
while (1) {
read_i2c(I2C1, I2C_ACC_ADDR, ACC_STATUS, 1, data);
/*my_usart_print_int(USART2, data[0]);*/
read_i2c(I2C1, I2C_ACC_ADDR, ACC_OUT_X_L_A, 1, data);
acc_x=data[0];
read_i2c(I2C1, I2C_ACC_ADDR, ACC_OUT_X_H_A, 1, data);
acc_x|=(data[0] << 8);
my_usart_print_int(USART2, (int16_t) acc_x);
//int i;
//for (i = 0; i < 800000; i++) /* Wait a bit. */
// __asm__("nop");
}
return 0;
}
开发者ID:BuFran,项目名称:libopencm3-examples,代码行数:29,代码来源:i2c.c
示例18: main
int main(void)
{
int counter = 0;
float fcounter = 0.0;
double dcounter = 0.0;
clock_setup();
gpio_setup();
usart_setup();
/*
* Write Hello World, an integer, float and double all over
* again while incrementing the numbers.
*/
while (1) {
gpio_toggle(GPIOC, GPIO12);
printf("Hello World! %i %f %f\r\n", counter, fcounter,
dcounter);
counter++;
fcounter += 0.01;
dcounter += 0.01;
}
return 0;
}
开发者ID:CNCBASHER,项目名称:libopencm3,代码行数:25,代码来源:usart_printf.c
示例19: main
int main(void)
{
int counter = 0;
uint16_t rx_value = 0x42;
clock_setup();
gpio_setup();
usart_setup();
spi_setup();
/* Blink the LED (PA8) on the board with every transmitted byte. */
while (1) {
/* LED on/off */
gpio_toggle(GPIOA, GPIO8);
/* printf the value that SPI should send */
printf("Counter: %i SPI Sent Byte: %i", counter, (uint8_t) counter);
/* blocking send of the byte out SPI1 */
spi_send(SPI1, (uint8_t) counter);
/* Read the byte that just came in (use a loopback between MISO and MOSI
* to get the same byte back)
*/
rx_value = spi_read(SPI1);
/* printf the byte just received */
printf(" SPI Received Byte: %i\r\n", rx_value);
counter++;
}
return 0;
}
开发者ID:BuFran,项目名称:libopencm3-examples,代码行数:33,代码来源:spi.c
示例20: clock_init
/*
* Initialize the reference clocks.
*/
void clock_init(void)
{
static u32 apbahb_presc_tbl[] = {0, 0, 0, 0, 1, 2, 3, 4,
1, 2, 3, 4, 6, 7, 8, 9};
u32 tmp, presc, pllvco, pllp, pllm;
/*
* Set clocks to cfg, which is differs from the poweron default
*/
clock_setup();
clock_val[CLOCK_SYSCLK] = 0;
clock_val[CLOCK_HCLK] = 0;
clock_val[CLOCK_PCLK1] = 0;
clock_val[CLOCK_PCLK2] = 0;
/*
* Set SYSTICK. Divider "8" is the SOC hardcoded.
*/
clock_val[CLOCK_SYSTICK] = 0;
return;
}
开发者ID:airgrzybek,项目名称:u-boot_stm32f10x,代码行数:31,代码来源:clock.c
注:本文中的clock_setup函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论