A set of functions for looking up registers and bitfields by name (string) and to get and set individual bitfields and full 64-bits registers, by name.
◆ cfg_get_option()
u_long FlxCard::cfg_get_option |
( |
const char * | key, |
|
|
bool | show_options = false ) |
Reads the value of a bit field and returns its value as the value of the method.
The method is only for the registers in BAR2. For BAR0 and BAR1 register access use the bar0Address() and bar1Address() functions and map the pointer to the respective structure from FlxCard.h.
Errors In case of an error, an exception is thrown.
- Parameters
-
key | A string with the name of the bit field |
show_options | If true displays (on standard output) a list of bitfield options that match 'key' if a unique match was not found |
◆ cfg_set_option()
void FlxCard::cfg_set_option |
( |
const char * | key, |
|
|
u_long | value, |
|
|
bool | show_options = false ) |
Writes a value to a bit field. The method is only for the registers in BAR2. For BAR0 and BAR1 register access use the bar0Address() and bar1Address() functions and map the pointer to the respective structure from FlxCard.h.
Errors In case of an error, an exception is thrown.
- Parameters
-
*key | A string with the name of the register or bit field |
value | The value that is to be written to the register |
show_options | If true displays (on standard output) a list of bitfield options that match 'key', if a unique match was not found |
◆ cfg_get_reg()
u_long FlxCard::cfg_get_reg |
( |
const char * | key | ) |
|
Reads the value of a register or and returns its value as the value of the method.
The method is only for the registers in BAR2. For BAR0 and BAR1 register access use the bar0Address() and bar1Address() functions and map the pointer to the respective structure from FlxCard.h.
Errors In case of an error, an exception is thrown.
- Parameters
-
key | A string with the name of the register |
◆ cfg_set_reg()
void FlxCard::cfg_set_reg |
( |
const char * | key, |
|
|
u_long | value ) |
Writes a value to a register. The method is only for the registers in BAR2. For BAR0 and BAR1 register access use the bar0Address() and bar1Address() functions and map the pointer to the respective structure from FlxCard.h.
Errors In case of an error, an exception is thrown.
- Parameters
-
*key | A string with the name of the register or bit field |
value | The value that is to be written to the register |
◆ registers_reset()
void FlxCard::registers_reset |
( |
| ) |
|
Triggers a reset by the REGISTERS_RESET register in BAR0. This causes all registers in the BAR2 area to be reset to their power-on default values. The registers in BAR0 and BAR1 will keep their values.
◆ cfg_register()
static regmap_register_t * FlxCard::cfg_register |
( |
const char * | name | ) |
|
|
static |
Returns a pointer to a regmap_register_t
struct in the array of these structs describing all the FELIX registers. Internally used by cfg_get_reg() and cfg_set_reg().
- Parameters
-
name | The string containing the register name: is case-insensitive and '_' characters may be replaced by '-' |
◆ cfg_bitfield()
static regmap_bitfield_t * FlxCard::cfg_bitfield |
( |
const char * | name | ) |
|
|
static |
Returns a pointer to a regmap_bitfield_t
struct in the array of these structs describing all the FELIX register bitfield. Internally used by cfg_get_option() and cfg_set_option().
- Parameters
-
name | The string containing the bitfield name: is case-insensitive and '_' characters may be replaced by '-' |
◆ cfg_bitfield_options()
static std::string FlxCard::cfg_bitfield_options |
( |
const char * | name, |
|
|
bool | include_all_substr = true ) |
|
static |
Compiles and returns a string containing a list of register bitfield names that match the given name, meaning that string 'name' is either a substring of the full bitfield name or that the full bitfield name starts with 'name'. Internally used by cfg_get_option() and cfg_set_option().
- Parameters
-
name | The string with the name substring: is case-insensitive and '_' characters may be replaced by '-' |
include_all_substr | If false only bitfield names that start with the given substring are returned, if true names are returned that contain the substring anywhere in their name |