Recent

Author Topic: What libraries to write?  (Read 1205 times)

devport

  • New Member
  • *
  • Posts: 26
What libraries to write?
« on: December 17, 2019, 07:41:38 pm »
I'm going to write ARM libraries.
I wonder what form they should take.
Whether to be HAL libraries (my current style) or create structures (objects). Building objects creates an additional problem in the amount of additional bytes to hex (~ 250B).
Below is the coding style of e.g. peripherals.

Code: Pascal  [Select][+][-]
  1. begin
  2. UART_Init(9600);
  3. UART_Send('This is example');
  4.  
  5. UART_Send('ADC value :'+IntToStr(ADC_Get(CHANNEL_1));
  6. end;
  7.  

OR

Code: Pascal  [Select][+][-]
  1. var
  2.  UART : TUART;
  3.  ADC: TADC;
  4. begin
  5. UART.Init(9600);
  6. UART.Send('From object');
  7. UART.Send('ADC val '+IntToStr(ADC.Get(CHANNEL_1));
  8. end;
  9.  
  10.  

this is not a big difference, or maybe some other suggestions?

MiR

  • Full Member
  • ***
  • Posts: 246
Re: What libraries to write?
« Reply #1 on: December 17, 2019, 08:00:39 pm »
Both approaches have their pros and cons, i went with option b, the good thing is that you can use record helpers and friends to make the code look good to the end user.

Why not join forces, i have already done quite some work on a framework, I would be happy to integrate code from others for areas currently not covered and for better support of external modules.
If you are interested then please look here:

https://github.com/michael-ring/mbf


devport

  • New Member
  • *
  • Posts: 26
Re: What libraries to write?
« Reply #2 on: December 18, 2019, 09:05:57 pm »
I am too weak a programmer to participate in such a project. But I have to try to understand your approach to writing. I understand that I will write LPC11xx module equivalents and make them available for integration with your project.

Personally, however, I prefer a less object-oriented approach to writing libraries.
As soon as time allows, I will explore the Framework

Greetings.

 

TinyPortal © 2005-2018