We have hosted the application n32g430 lib in order to run this application in our online workstations with Wine or directly.


Quick description about n32g430 lib:

Nationstech N32G430 MCU library/startup code.

Use:

// set FLASH iCache, prefetch, latency
flash_icache(1);
flash_pref(1);
flash_lat(3);

// set AHB/APB1/APB2 dividers
ahb_div(AHB_DIV_1);
apb1_div(APB1_DIV_4);
apb2_div(APB2_DIV_2);

// start PLL
pll_on(0,0, 0, 16);
sclk_sel(SCLK_PLL);

// enable peripherals clocks
ahb_on(AHB_GPIOA | AHB_ADC | AHB_CRC);
apb1_on(APB1_TIM2);
apb2_on(APB2_AFIO | APB2_USART1);

// configure pin mode/type/speed/pullup/output
pin_mo(GPIOA,0, MO_OUT);
pin_ot(GPIOA,0, OT_PP);
pin_sr(GPIOA,0, SR_HI,DRV_12MA);
pin_pu(GPIOA,0, PU_NO);
pin_wr(GPIOA,0, 1);


// configure ADC
adc_on(ADC_HCLK_DIV2, ADC_PLL_DIV2, 0,ADC_CLK1M_DIV8);
adc_cal(0,1); // calibrate
adc_iref_on(1); // reference
adc_trig(1, ADC_TRIG_SOFT); // trigger source
adc_cont(0); // single conversion
adc_chn(1); // channel
adc_stime(0, ADC_28_5); // cample time
adc_start(0); // start conversion
while(!adc_ready()); // wait
uint16_t adc = adc_rd(); // read.

Features:
  • arm
  • n32g430
  • n32
  • startup



.

Page navigation:

©2024. Winfy. All Rights Reserved.

By OD Group OU – Registry code: 1609791 -VAT number: EE102345621.