Design
Design Approach
Design Overview
Layers
Primarily there are 3 layers
Application
Middleware
HAL
Middleware is the value addition that RAPIDSEA is going to bring to the customer. Will be prefixed with rs_
Application is generally the one user is going to develop on top of the middleware layer. Also there will a large collection of application logic that could be leveraged by auto-codegen tool like Flint and leverage the RAPIDSEA.
HAL should technically a bare minimal part that will be modifiable based on the underlying hardware. Will be prefixed with rs_hal_
.
Usage
The higher layer functions of the RAPIDSEA typically utilize the underlying interface/module in the following way
Open the module/interface using its open function while passing the configuration structure (can be Read only via const) and a run time instance structure (read/write)
A handle is returned from the open call, if it is successful
Perform operation using the returned handle.
Finally close the instance using the close call associated with the module.
For example, to work with the serial port, following can be done:
const rs_uart_config_t uart0_config = { .. .. .. };
rs_uart_instance_t uart0_inst;
rs_handle_t handle;
handle = rs_serial_open(rs_uart_instance_t *ptr_instance, rs_uart_config_t *ptr_config);
rs_serial_read(handle, "Hello", 5, 1000);
rs_serial_port_close (handle);
Some of the points to be noted are:
The open call always have the run time instance as first argument and configuration data as the second argument
The memory associated with run time instance is owned by the module and must not be used for other purposes till it is closed.
The handle has to be released to free up the memory.
Modules
Interfaces
Interfaces supported by RAPIDSEA are
Devices
Devices supported by RAPIDSEA are
Device Drivers