In HDL languages, you can define generics. These are values that are assumed by default, but can be overridden. In VHDL, this may look like this:
ENTITY spi_master IS
GENERIC(
data_length : INTEGER := 16); --data length in bits
PORT(
...