Forum > Embedded - ARM

What libraries to write?

(1/1)

devport:
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  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---beginUART_Init(9600);UART_Send('This is example'); UART_Send('ADC value :'+IntToStr(ADC_Get(CHANNEL_1));end; 
OR


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---var UART : TUART; ADC: TADC;beginUART.Init(9600);UART.Send('From object');UART.Send('ADC val '+IntToStr(ADC.Get(CHANNEL_1));end;  
this is not a big difference, or maybe some other suggestions?

MiR:
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:
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.

Navigation

[0] Message Index

Go to full version