Code Organization
Directory Structure
RAPIDSEA is organized as follows
inc : Include Directory
hal : Hardware specific port
arch : architecture specific (arm, x86 etc.)
bsp : Board support Package (iMxRT1170 EVK, RH850 AICv2 etc.)
mach : SoC/MCU/MPU (STM32, RH850D1M1A etc.)
rapidsea : Common Code base that can be used for any app development
components : Functionalities and Major implementations
modules : Logical and functional implementations such as ring buffers, stepper motor managers, LED managers
protocols : Formal implementation of standards such as Modbus, USB classes etc.
system : Core functionalities such as OS, File systems, etc.
utils : Utility functions such a number/string manipulations, conversions etc.
devices : Drivers for various external devices such as accelerometers, GPS etc.
rtc : RTC implementation for various devices such as rtc_dallas.h, rtc_rh850.h etc.
external : Third part sources without breaking the original directory structure
platform : APIs for accessing underlying devices/interfaces such as I2C, accelerometer etc. To be implemented via devices. e.g. rs_rtc.h
hal : HAL signature files to be implemented by the lower level hardware port. Files prefixed with rs_hal e.g. rs_hal_can.h, rs_hal_rtc.h
rs_config.h : To select components as necessary
rs_hal.h : To include target specific HAL files
rs_lib.h : Al large header to include all others
src : Source Directory
hal : Hardware specific port. As inc
rapidsea : Common Code base that can be used for any app development. As inc
docs : Documentation
build : Build directories as well as workspace
apps : Demo or final applications
Headers
To reduce the number of include paths to be included, use only the main include paths in the project. In the source files or the main headers (rs_hal.h, rs_lib.h) include via the full path. For e.g. in rs_lib.h use
#include <components\system\os\rs_os.h>
#include <components\protocols\modbus\modbus.h>
Conventions
Handle Usage:
Handles are used only for the low level drivers.
Modules should use the structure pointers directly as they are not highly-abstracted and are being used by App developers directly. This also improves performance.