I want to create my library for lpc2478 controller using LPC24xx.h file how I can create library

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

I want to create my library for lpc2478 controller using LPC24xx.h file how I can create library

457件の閲覧回数
VijayaJangam1
Contributor II

I want to create my library for lpc2478 controller using LPC24xx.h file how I can create library for different Peripherals  like GPIO, ADC, DAC, PWM, UART, SPI, I2C, Interrupt, set different Clocks PLL, Crystal use how can create the  code for My own board library Include my used pins for set their operations and create my own System.h and System.c file and in my main.c program use only that functions give me one roadmap and guidence 

Thank You... 

0 件の賞賛
返信
1 返信

173件の閲覧回数
Harry_Zhang
NXP Employee
NXP Employee

Hi @VijayaJangam1 

The LPC24xx.h file already defines the peripheral registers.
Your library will wrap these registers into functions/macros that are easy to use and board-specific.
You can organize your project like this:
 
/BoardLib
   |-- inc/
   | |-- system.h
   | |-- gpio.h
   | |-- uart.h
   | |-- spi.h
   | |-- i2c.h
   | |-- adc.h
   | |-- pwm.h
   | |-- clock.h
   |
   |-- src/
         |-- system.c
         |-- gpio.c
         |-- uart.c
         |-- spi.c
         |-- i2c.c
         |-- adc.c
         |-- pwm.c
         |-- clock.c

 

And then Compile src/*.c into a static library (libboard.a) using your toolchain.

Link it with your main.c.

BR

Harry