Skip to content

Commit d12ab65

Browse files
committed
Update README file support new devices info
1 parent 53df044 commit d12ab65

1 file changed

Lines changed: 42 additions & 12 deletions

File tree

README.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ hal/newdev
2626
hal/newdev/minbasecli_newdev.cpp
2727
```
2828

29+
**Note:** Use any of the other device support implementation of minbasecli_X.h/cpp files as example to edit.
30+
2931
2. Include new device support sources in "minbasecli.h" using an existing global define that allows to know wich device/framework is being compiled (this define should exists in some way in device framework, otherwise, you need to pass it to the compiler at build time, i.e. using -DMY_NEW_DEV for gcc compiler):
3032

3133
```c++
@@ -34,61 +36,89 @@ hal/newdev
3436

3537
/* Use Specific HAL for build system */
3638

37-
#if defined(ARDUINO)
39+
#if defined(__linux__)
40+
#include "hal/linux/minbasecli_linux.h"
41+
#define MINBASECLI_HAL MINBASECLI_LINUX
42+
#elif defined(_WIN32) || defined(_WIN64)
43+
#include "hal/windows/minbasecli_windows.h"
44+
#define MINBASECLI_HAL MINBASECLI_WINDOWS
45+
#elif defined(ARDUINO)
3846
#include "hal/arduino/minbasecli_arduino.h"
47+
#define MINBASECLI_HAL MINBASECLI_ARDUINO
48+
#elif defined(__AVR)
49+
#include "hal/avr/minbasecli_avr.h"
50+
#define MINBASECLI_HAL MINBASECLI_AVR
3951
#elif defined(ESP_PLATFORM)
4052
#include "hal/espidf/minbasecli_espidf.h"
53+
#define MINBASECLI_HAL MINBASECLI_ESPIDF
4154
#elif defined(MY_NEW_DEV) // This has been include
4255
#include "hal/pico/minbasecli_newdev.h" // This has been include
43-
#elif defined(__linux__)
44-
#include "hal/linux/minbasecli_linux.h"
45-
#elif defined(_WIN32) || defined(_WIN64)
46-
#include "hal/windows/minbasecli_windows.h"
56+
#define MINBASECLI_HAL MINBASECLI_NEWDEV // This has been include
4757
#else
4858
#warning "minbasecli - Unsupported device/system."
59+
#define HAL_NONE
4960
#include "hal/none/minbasecli_none.h"
61+
#define MINBASECLI_HAL MINBASECLI_NONE
5062
#endif
5163

5264
/* ... */
5365

5466
```
5567

56-
3. Implement low level functionalities to control interface of the CLI in the **hal_*()** private methods (*hal_iface_available(), hal_iface_read(), hal_iface_print(), etc.*) of "minbasecli_newdev.cpp" file:
68+
3. Implement low level layer functionalities to control interface of the CLI in the **minbasecli_newdev.h/cpp** files:
5769

5870
```c++
5971

6072
/* ... */
6173

62-
uint32_t MINBASECLI::hal_millis()
74+
bool MINBASECLI_NEWDEV::hal_setup(const uint32_t baud_rate)
6375
{
64-
// Specific device/framework return system tick milliseconds
76+
// Specific device/framework interface initialization
6577
// should be written here
6678
}
6779

68-
void MINBASECLI::hal_iface_print(const char* str)
80+
bool MINBASECLI_NEWDEV::hal_setup(void* iface, const uint32_t baud_rate)
81+
{
82+
// Specific device/framework interface initialization
83+
// should be written here
84+
}
85+
86+
void MINBASECLI_NEWDEV::hal_iface_print(const char* str)
6987
{
7088
// Specific device/framework interface print text
7189
// should be written here
7290
}
7391

74-
void MINBASECLI::hal_iface_println(const char* str)
92+
void MINBASECLI_NEWDEV::hal_iface_println(const char* str)
7593
{
7694
// Specific device/framework interface print text line
7795
// should be written here
7896
}
7997

80-
size_t MINBASECLI::hal_iface_available()
98+
size_t MINBASECLI_NEWDEV::hal_iface_available()
8199
{
82100
// Specific device/framework return num bytes received from interface
83101
// should be written here
84102
}
85103

86-
uint8_t MINBASECLI::hal_iface_read(void)
104+
uint8_t MINBASECLI_NEWDEV::hal_iface_read(void)
87105
{
88106
// Specific device/framework interface read and return incoming bytes
89107
// should be written here
90108
}
91109

110+
uint32_t MINBASECLI_NEWDEV::hal_millis_init()
111+
{
112+
// Specific device/framework system tick count initialization
113+
// should be written here
114+
}
115+
116+
uint32_t MINBASECLI_NEWDEV::hal_millis()
117+
{
118+
// Specific device/framework return system tick milliseconds
119+
// should be written here
120+
}
121+
92122
/* ... */
93123

94124
```

0 commit comments

Comments
 (0)