Skip to content

Xpu.c

Function reg_read(u32 reg)

reg_read: The function of reg_read is to read a 32-bit value from a specified register address.

parameters: The parameters of this Function. · parameter1: reg - This is a 32-bit unsigned integer that represents the offset of the register from the base address.

Code Description: The reg_read function is defined as a static inline function, which means it is intended to be used only within the file it is defined in and can be optimized by the compiler for performance. The function takes a single parameter, reg, which specifies the offset of the register to be read. The function computes the effective address by adding the provided register offset to a predefined base address (base_addr). It then calls the ioread32 function, which is responsible for reading a 32-bit value from the computed address. The result of this read operation is returned as the output of the reg_read function.

The use of ioread32 indicates that this function is likely intended for reading from memory-mapped I/O registers, which is common in device driver development. The base_addr variable should be defined elsewhere in the code, representing the starting address of the memory-mapped I/O region.

Note: It is important to ensure that the base_addr is correctly initialized before calling this function to avoid undefined behavior. Additionally, the reg parameter should be within the valid range of offsets for the specific hardware being interfaced with.

Output Example: If base_addr is set to 0x1000 and reg is 0x04, the function call reg_read(0x04) would effectively read the value from the memory address 0x1004 and return it as a 32-bit unsigned integer.

graph TD
    A[Start reg_read function] --> B[Receive register address]
    B --> C[Calculate effective address by adding base address]
    C --> D[Read value from calculated address using ioread32]
    D --> E[Return read value]
    E --> F[End reg_read function]

Function reg_write(u32 reg, u32 value)

reg_write: The function of reg_write is to write a 32-bit value to a specified hardware register.

parameters: The parameters of this Function. · parameter1: u32 reg - This parameter represents the offset of the register to which the value will be written. · parameter2: u32 value - This parameter is the 32-bit value that will be written to the specified register.

Code Description: The reg_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes two parameters: 'reg', which specifies the register offset, and 'value', which is the data to be written. Inside the function, the iowrite32 function is called, which is responsible for performing the actual write operation to the hardware. The write operation is performed by adding the base address (base_addr) of the device's memory-mapped I/O region to the register offset (reg) and then writing the value to that calculated address. This operation is crucial for interacting with hardware components, as it allows the software to configure or control the behavior of the hardware by writing specific values to its registers.

Note: It is important to ensure that the base_addr is correctly initialized and points to the appropriate memory-mapped I/O region before calling this function. Additionally, care should be taken to use the correct register offsets and values to avoid unintended behavior in the hardware.

graph TD
    A[Start reg_write function] --> B[Receive register address reg]
    B --> C[Receive value to write]
    C --> D[Calculate address by adding base_addr and reg]
    D --> E[Write value to calculated address using iowrite32]
    E --> F[End reg_write function]

Function XPU_REG_MULTI_RST_write(u32 Data)

XPU_REG_MULTI_RST_write: The function of XPU_REG_MULTI_RST_write is to write a specified value to the XPU multi-reset register.

parameters: The parameters of this Function. · Data: This parameter is of type u32 and represents the value to be written to the XPU multi-reset register.

Code Description: The XPU_REG_MULTI_RST_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and can be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer (u32). Inside the function, the reg_write function is called with two arguments: XPU_REG_MULTI_RST_ADDR and Data.

XPU_REG_MULTI_RST_ADDR is a predefined constant that specifies the memory address of the XPU multi-reset register. The reg_write function is responsible for writing the value of Data to this address. This operation is typically used in hardware programming to control the state of the multi-reset feature of the XPU (eXtended Processing Unit), allowing for the resetting of multiple components or functionalities within the XPU architecture.

Note: It is important to ensure that the value passed to the Data parameter is valid and appropriate for the intended reset operation, as incorrect values may lead to unintended behavior or system instability. Additionally, since this function directly interacts with hardware registers, it should be used with caution and typically requires appropriate permissions or context within the system.

graph TD
    A[Start] --> B[Call XPU_REG_MULTI_RST_write with Data]
    B --> C[Execute reg_write function]
    C --> D[Write Data to XPU_REG_MULTI_RST_ADDR]
    D --> E[End]

Function XPU_REG_MULTI_RST_read(void)

XPU_REG_MULTI_RST_read: The function of XPU_REG_MULTI_RST_read is to read the value from the XPU_REG_MULTI_RST register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The XPU_REG_MULTI_RST_read function is defined as a static inline function that returns a 32-bit unsigned integer (u32). The function performs a read operation from a specific hardware register identified by the address XPU_REG_MULTI_RST_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the register's value. By using the inline keyword, the compiler may optimize the function call, potentially replacing it with the actual code at the call site to improve performance. This function does not take any parameters and directly returns the value read from the register.

Note: It is important to ensure that the XPU_REG_MULTI_RST_ADDR is correctly defined and accessible in the context where this function is used. Additionally, the reg_read function should be implemented to handle the specific requirements of reading from the hardware register, including any necessary synchronization or access control.

Output Example: A possible return value of the function could be a 32-bit integer, such as 0x00000001, indicating the current state or configuration of the XPU_REG_MULTI_RST register.

graph TD
    A[Start] --> B[Call XPU_REG_MULTI_RST_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_MULTI_RST_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return result from XPU_REG_MULTI_RST_read]
    F --> G[End]

Function XPU_REG_SRC_SEL_write(u32 Data)

XPU_REG_SRC_SEL_write: The function of XPU_REG_SRC_SEL_write is to write a specified value to the XPU source selection register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer (u32) that represents the value to be written to the register.

Code Description: The XPU_REG_SRC_SEL_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer. The primary operation of this function is to call the reg_write function, passing two arguments: the address of the XPU source selection register (XPU_REG_SRC_SEL_ADDR) and the value contained in Data. This operation effectively updates the register with the new value provided, allowing for configuration or control of the XPU's source selection functionality.

Note: It is important to ensure that the value passed to the function is valid and appropriate for the intended operation, as writing incorrect values to hardware registers can lead to undefined behavior or system instability. Additionally, since this function is marked as static inline, it is recommended to include it in performance-critical paths where frequent register writes are necessary.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_SRC_SEL_ADDR]
    D --> E[End]

Function XPU_REG_SRC_SEL_read(void)

XPU_REG_SRC_SEL_read: The function of XPU_REG_SRC_SEL_read is to read the value from the XPU_REG_SRC_SEL register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The XPU_REG_SRC_SEL_read function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function returns a 32-bit unsigned integer (u32) that represents the value read from a specific hardware register. The function calls reg_read with the address of the XPU_REG_SRC_SEL register, denoted by XPU_REG_SRC_SEL_ADDR. The reg_read function is responsible for accessing the hardware register at the specified address and returning its current value. This function is typically used in scenarios where the current state or configuration of the XPU_REG_SRC_SEL register is required for further processing or decision-making in the software.

Note: It is important to ensure that the XPU_REG_SRC_SEL_ADDR is correctly defined and points to a valid memory-mapped register. Improper usage may lead to undefined behavior or incorrect values being read.

Output Example: A possible return value of the function could be 0x00000001, indicating that the register currently holds the value representing a specific configuration or state of the XPU.

graph TD
    A[Start] --> B[Call XPU_REG_SRC_SEL_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_SRC_SEL_ADDR]
    D --> E[Return value from reg_read]
    E --> F[End]

Function XPU_REG_RECV_ACK_COUNT_TOP0_write(u32 Data)

XPU_REG_RECV_ACK_COUNT_TOP0_write: The function of XPU_REG_RECV_ACK_COUNT_TOP0_write is to write a specified value to the XPU register that tracks the acknowledgment count for the top channel.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer (u32) that represents the value to be written to the register.

Code Description: The XPU_REG_RECV_ACK_COUNT_TOP0_write function is defined as a static inline function, which means it is intended to be used only within the file where it is defined and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer. The function performs a write operation to a specific hardware register identified by the constant XPU_REG_RECV_ACK_COUNT_TOP0_ADDR. This is achieved by calling the reg_write function, passing in the address of the register and the value to be written. The purpose of this function is to update the acknowledgment count for the top channel in the XPU (eXtended Processing Unit) hardware, which is essential for managing data flow and ensuring that the system correctly tracks received acknowledgments.

Note: It is important to ensure that the value passed to the function is valid and appropriate for the register being written to, as incorrect values may lead to undefined behavior or hardware malfunctions. Additionally, this function should be used in contexts where direct register manipulation is permitted and safe, typically within low-level driver code.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_RECV_ACK_COUNT_TOP0_ADDR]
    D --> E[End]

Function XPU_REG_RECV_ACK_COUNT_TOP0_read(void)

XPU_REG_RECV_ACK_COUNT_TOP0_read: The function of XPU_REG_RECV_ACK_COUNT_TOP0_read is to read the value from the XPU_REG_RECV_ACK_COUNT_TOP0 register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_RECV_ACK_COUNT_TOP0_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_RECV_ACK_COUNT_TOP0_ADDR. The function calls another function, reg_read, passing the register address as an argument. The reg_read function is responsible for accessing the hardware register and retrieving its current value. The use of the static inline keyword suggests that this function is intended for performance optimization, allowing the compiler to replace calls to this function with the actual code, thereby reducing function call overhead.

Note: It is important to ensure that the XPU_REG_RECV_ACK_COUNT_TOP0_ADDR is correctly defined and accessible within the context where this function is used. Additionally, this function should be called in a context where reading from the hardware register is safe and appropriate, as improper access may lead to undefined behavior or system instability.

Output Example: A possible return value of this function could be a 32-bit unsigned integer, such as 0x0000000A, which represents the current acknowledgment count from the XPU_REG_RECV_ACK_COUNT_TOP0 register.

graph TD
    A[Start] --> B[Call XPU_REG_RECV_ACK_COUNT_TOP0_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_RECV_ACK_COUNT_TOP0_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_RECV_ACK_COUNT_TOP0_read]
    F --> G[End]

Function XPU_REG_RECV_ACK_COUNT_TOP1_write(u32 Data)

XPU_REG_RECV_ACK_COUNT_TOP1_write: The function of XPU_REG_RECV_ACK_COUNT_TOP1_write is to write a specified value to the XPU_REG_RECV_ACK_COUNT_TOP1 register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer (u32) that represents the value to be written to the register.

Code Description: The XPU_REG_RECV_ACK_COUNT_TOP1_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is expected to be a 32-bit unsigned integer. Inside the function, the reg_write function is called with two arguments: the address of the XPU_REG_RECV_ACK_COUNT_TOP1 register (denoted by XPU_REG_RECV_ACK_COUNT_TOP1_ADDR) and the Data value. This operation writes the Data value directly to the specified register address, effectively updating the register with the new value.

Note: It is important to ensure that the value passed to the function is valid and appropriate for the intended operation, as writing incorrect values to hardware registers can lead to undefined behavior or system instability. Additionally, since this function is defined as inline, it may be inlined at the call site, which can improve performance but may increase code size if used excessively.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_RECV_ACK_COUNT_TOP1_ADDR]
    D --> E[End]

Function XPU_REG_RECV_ACK_COUNT_TOP1_read(void)

XPU_REG_RECV_ACK_COUNT_TOP1_read: The function of XPU_REG_RECV_ACK_COUNT_TOP1_read is to read the value from the register that counts the acknowledgment signals received by the XPU.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_RECV_ACK_COUNT_TOP1_read is defined as a static inline function, which means it is intended to be used only within the file it is defined in and can be optimized by the compiler for performance. The function returns a 32-bit unsigned integer (u32) value. Inside the function, it calls another function, reg_read, passing it the address of the register XPU_REG_RECV_ACK_COUNT_TOP1_ADDR. This address is presumably defined elsewhere in the code and points to the specific hardware register that holds the acknowledgment count. The reg_read function is responsible for accessing the hardware register and retrieving its current value. The return value of XPU_REG_RECV_ACK_COUNT_TOP1_read is the value read from this register, which indicates the number of acknowledgment signals that have been received by the XPU.

Note: It is important to ensure that the register address XPU_REG_RECV_ACK_COUNT_TOP1_ADDR is correctly defined and accessible before calling this function. Additionally, since this function interacts with hardware, it should be called in an appropriate context where the system state is valid for reading register values.

Output Example: A possible return value from the function could be 0x00000005, indicating that five acknowledgment signals have been received by the XPU.

graph TD
    A[Start] --> B[Call XPU_REG_RECV_ACK_COUNT_TOP1_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_RECV_ACK_COUNT_TOP1_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_RECV_ACK_COUNT_TOP1_read]
    F --> G[End]

Function XPU_REG_SEND_ACK_WAIT_TOP_write(u32 Data)

XPU_REG_SEND_ACK_WAIT_TOP_write: The function of XPU_REG_SEND_ACK_WAIT_TOP_write is to write a specified data value to the XPU_REG_SEND_ACK_WAIT_TOP register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer (u32) that represents the value to be written to the register.

Code Description: The function XPU_REG_SEND_ACK_WAIT_TOP_write is defined as a static inline function, which means it is intended to be used only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is of type u32. Inside the function, the reg_write function is called with two arguments: the address of the XPU_REG_SEND_ACK_WAIT_TOP register (denoted by XPU_REG_SEND_ACK_WAIT_TOP_ADDR) and the Data value. This operation effectively writes the provided Data value to the specified register address, allowing for configuration or control of the hardware associated with that register.

Note: It is important to ensure that the Data value being written is valid and appropriate for the specific register being accessed. Improper values may lead to undefined behavior or hardware malfunctions. Additionally, since this function is defined as inline, it is recommended to use it in performance-critical sections of code where register access is frequent.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_SEND_ACK_WAIT_TOP_ADDR]
    D --> E[End]

Function XPU_REG_SEND_ACK_WAIT_TOP_read(void)

XPU_REG_SEND_ACK_WAIT_TOP_read: The function of XPU_REG_SEND_ACK_WAIT_TOP_read is to read the value from the XPU_REG_SEND_ACK_WAIT_TOP register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_SEND_ACK_WAIT_TOP_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). The function performs a read operation from a specific hardware register identified by the address XPU_REG_SEND_ACK_WAIT_TOP_ADDR. This is accomplished by calling the reg_read function, which is assumed to handle the low-level details of accessing the hardware register. The use of the static inline keyword suggests that this function is intended for performance optimization, allowing the compiler to replace calls to this function with the actual code, thereby reducing function call overhead. Since the function does not take any parameters, it directly accesses the register address defined elsewhere in the code.

Note: It is important to ensure that the register address XPU_REG_SEND_ACK_WAIT_TOP_ADDR is correctly defined and accessible in the context where this function is used. Additionally, the function should be used in a context where reading from the register is appropriate, as it may have implications on the state of the hardware.

Output Example: A possible return value of this function could be a 32-bit integer such as 0x00000001, which represents the current value stored in the XPU_REG_SEND_ACK_WAIT_TOP register at the time of the read operation.

graph TD
    A[Start] --> B[Call XPU_REG_SEND_ACK_WAIT_TOP_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_SEND_ACK_WAIT_TOP_ADDR]
    D --> E[Return value from reg_read]
    E --> F[End]

Function XPU_REG_FILTER_FLAG_write(u32 Data)

XPU_REG_FILTER_FLAG_write: The function of XPU_REG_FILTER_FLAG_write is to write a specified value to the XPU register filter flag address.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer (u32) that represents the value to be written to the register.

Code Description: The XPU_REG_FILTER_FLAG_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer. The primary operation performed by this function is to call the reg_write function, passing it two arguments: the address of the XPU register filter flag (XPU_REG_FILTER_FLAG_ADDR) and the value of Data. This operation effectively writes the value of Data to the specified register address, allowing for configuration or control of the XPU's filter flag settings.

Note: It is important to ensure that the value passed to the function is valid and appropriate for the register being modified. Improper values may lead to undefined behavior or incorrect operation of the XPU. Additionally, since this function is static inline, it should be included in the compilation unit where it is needed to avoid linkage issues.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_FILTER_FLAG_ADDR]
    D --> E[End]

Function XPU_REG_FILTER_FLAG_read(void)

XPU_REG_FILTER_FLAG_read: The function of XPU_REG_FILTER_FLAG_read is to read the value from the XPU_REG_FILTER_FLAG register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_FILTER_FLAG_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_FILTER_FLAG_ADDR. The function utilizes the reg_read function to access the register's value. The use of the static inline specifier suggests that this function is intended for performance optimization, allowing the compiler to replace calls to this function with the actual code, thereby reducing function call overhead. The return value of this function is the current state or configuration of the XPU_REG_FILTER_FLAG register, which is essential for understanding the status of the XPU filtering mechanism.

Note: It is important to ensure that the XPU_REG_FILTER_FLAG_ADDR is correctly defined and accessible within the context of the hardware being interfaced with. Additionally, this function should be called in an environment where register access is permitted to avoid any unintended behavior.

Output Example: A possible return value of this function could be 0x00000001, indicating that a specific filter flag is set in the XPU_REG_FILTER_FLAG register.

graph TD
    A[Start] --> B[Call XPU_REG_FILTER_FLAG_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_FILTER_FLAG_ADDR]
    D --> E[Return value]
    E --> F[End]

Function XPU_REG_CTS_TO_RTS_CONFIG_write(u32 Data)

XPU_REG_CTS_TO_RTS_CONFIG_write: The function of XPU_REG_CTS_TO_RTS_CONFIG_write is to write a specified value to the CTS to RTS configuration register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer that represents the value to be written to the register.

Code Description: The function XPU_REG_CTS_TO_RTS_CONFIG_write is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer. This parameter is used to specify the value that will be written to the register located at the address defined by XPU_REG_CTS_TO_RTS_CONFIG_ADDR. The actual writing operation is performed by the reg_write function, which takes two arguments: the address of the register and the data to be written. This function is crucial for configuring the behavior of the CTS (Clear To Send) to RTS (Request To Send) signaling in the XPU (External Peripheral Unit) context.

Note: It is important to ensure that the value passed to this function is valid and appropriate for the specific configuration of the XPU. Improper values may lead to incorrect behavior of the communication interface. Additionally, since this function is static inline, it may not be accessible from other files, which is intended to limit its scope and enhance performance.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_CTS_TO_RTS_CONFIG_ADDR]
    D --> E[End]

Function XPU_REG_CTS_TO_RTS_CONFIG_read(void)

XPU_REG_CTS_TO_RTS_CONFIG_read: The function of XPU_REG_CTS_TO_RTS_CONFIG_read is to read the value from the XPU_REG_CTS_TO_RTS_CONFIG register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_CTS_TO_RTS_CONFIG_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_CTS_TO_RTS_CONFIG_ADDR. The function utilizes the reg_read function to access the value stored at this address. By being defined as static inline, it suggests that this function is intended to be used only within the file it is defined in, and the compiler may choose to embed the function's code directly at the call site to optimize performance.

Note: It is important to ensure that the XPU_REG_CTS_TO_RTS_CONFIG_ADDR is correctly defined and accessible within the context of this function. Additionally, the reg_read function must be properly implemented to handle the reading of hardware registers, as improper access may lead to undefined behavior or system instability.

Output Example: A possible return value of the function could be a 32-bit integer such as 0x00000001, which represents the current configuration state of the CTS to RTS settings in the XPU hardware.

graph TD
    A[Start] --> B[Call XPU_REG_CTS_TO_RTS_CONFIG_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_CTS_TO_RTS_CONFIG_ADDR]
    D --> E[Return value]
    E --> F[End]

Function XPU_REG_MAC_ADDR_LOW_write(u32 Data)

XPU_REG_MAC_ADDR_LOW_write: The function of XPU_REG_MAC_ADDR_LOW_write is to write a specified value to the MAC address low register of the XPU.

parameters: The parameters of this Function. · Data: This parameter is of type u32 and represents the value to be written to the MAC address low register.

Code Description: The XPU_REG_MAC_ADDR_LOW_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer (u32). Inside the function, the reg_write function is called with two arguments: XPU_REG_MAC_ADDR_LOW_ADDR and Data. Here, XPU_REG_MAC_ADDR_LOW_ADDR is a predefined constant that specifies the address of the MAC address low register in the XPU's memory-mapped I/O space. The reg_write function is responsible for writing the value of Data to the specified address. This operation is crucial for configuring the MAC address of the XPU, as it allows the low part of the MAC address to be set.

Note: It is important to ensure that the value passed to the Data parameter is valid and conforms to the expected format for a MAC address. Writing incorrect values may lead to improper functioning of the XPU's network interface. Additionally, since this function is static inline, it may be inlined by the compiler, which can improve performance but may also increase the size of the compiled code if used extensively.

graph TD
    A[Start] --> B[Call XPU_REG_MAC_ADDR_LOW_write function]
    B --> C[Receive Data parameter]
    C --> D[Execute reg_write function]
    D --> E[Write Data to XPU_REG_MAC_ADDR_LOW_ADDR]
    E --> F[End]

Function XPU_REG_MAC_ADDR_LOW_read(void)

XPU_REG_MAC_ADDR_LOW_read: The function of XPU_REG_MAC_ADDR_LOW_read is to read the lower part of the MAC address from a specific hardware register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The XPU_REG_MAC_ADDR_LOW_read function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function returns a value of type u32, which is typically a 32-bit unsigned integer.

Inside the function, it calls another function named reg_read, passing it the constant XPU_REG_MAC_ADDR_LOW_ADDR. This constant represents the address of the hardware register that holds the lower part of the MAC address. The reg_read function is responsible for accessing the specified register and retrieving its current value. The value returned by reg_read is then returned by the XPU_REG_MAC_ADDR_LOW_read function.

This function is essential for obtaining the lower 32 bits of the MAC address, which is often used in network configurations and communications.

Note: It is important to ensure that the hardware is properly initialized and that the address XPU_REG_MAC_ADDR_LOW_ADDR is valid before calling this function to avoid undefined behavior or incorrect values.

Output Example: A possible return value of the function could be 0x12345678, which represents the lower part of a MAC address in hexadecimal format.

graph TD
    A[Start] --> B[Call XPU_REG_MAC_ADDR_LOW_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_MAC_ADDR_LOW_ADDR]
    D --> E[Return value from reg_read]
    E --> F[End]

Function XPU_REG_MAC_ADDR_HIGH_write(u32 Data)

XPU_REG_MAC_ADDR_HIGH_write: The function of XPU_REG_MAC_ADDR_HIGH_write is to write a specified value to the high part of the MAC address register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer (u32) that represents the value to be written to the MAC address register.

Code Description: The XPU_REG_MAC_ADDR_HIGH_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is of type u32. This parameter is expected to contain the value that will be written to the high part of the MAC address register.

The function executes a single operation: it calls the reg_write function, passing two arguments. The first argument is the address of the MAC address register, specifically XPU_REG_MAC_ADDR_HIGH_ADDR, which is a predefined constant that indicates the memory-mapped address of the register. The second argument is the Data parameter, which contains the value to be written to that address.

This function is crucial for configuring the MAC address in systems that utilize the XPU hardware, ensuring that the high part of the MAC address is set correctly for network communication.

Note: It is important to ensure that the value passed to the function is valid and appropriate for the MAC address format. Additionally, this function should be used in contexts where direct register manipulation is permitted, as improper use may lead to undefined behavior or system instability.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_MAC_ADDR_HIGH_ADDR]
    D --> E[End]

Function XPU_REG_MAC_ADDR_HIGH_read(void)

XPU_REG_MAC_ADDR_HIGH_read: The function of XPU_REG_MAC_ADDR_HIGH_read is to read the value from the MAC address high register of the XPU.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_MAC_ADDR_HIGH_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the constant XPU_REG_MAC_ADDR_HIGH_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the value stored at the address specified by XPU_REG_MAC_ADDR_HIGH_ADDR. This operation is typically used in embedded systems or low-level hardware programming to retrieve configuration or status information from a device's registers.

The use of the static inline qualifier suggests that this function is intended for performance optimization, allowing the compiler to replace calls to this function with the actual code, thereby reducing function call overhead. The absence of parameters indicates that this function does not require any input values and directly accesses the hardware register.

Note: It is important to ensure that the XPU_REG_MAC_ADDR_HIGH_ADDR is correctly defined and points to a valid memory-mapped register before calling this function. Additionally, this function should be used in a context where the hardware is properly initialized to avoid reading invalid or undefined values.

Output Example: A possible return value of this function could be a 32-bit unsigned integer such as 0x12345678, representing the high part of the MAC address stored in the corresponding register.

graph TD
    A[Start] --> B[Call XPU_REG_MAC_ADDR_HIGH_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_MAC_ADDR_HIGH_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_MAC_ADDR_HIGH_read]
    F --> G[End]

Function XPU_REG_BSSID_FILTER_LOW_write(u32 Data)

XPU_REG_BSSID_FILTER_LOW_write: The function of XPU_REG_BSSID_FILTER_LOW_write is to write a specified value to the BSSID filter low register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer that represents the value to be written to the BSSID filter low register.

Code Description: The XPU_REG_BSSID_FILTER_LOW_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer. This parameter is used to specify the value that will be written to the BSSID filter low register.

Inside the function, the reg_write function is called with two arguments: XPU_REG_BSSID_FILTER_LOW_ADDR and Data. XPU_REG_BSSID_FILTER_LOW_ADDR is a constant that represents the memory address of the BSSID filter low register. The reg_write function is responsible for performing the actual write operation to the specified address with the provided data.

This function is typically used in scenarios where there is a need to configure or update the BSSID filter settings in a hardware component, such as a wireless communication module. By writing to this register, the system can control which BSSIDs (Basic Service Set Identifiers) are allowed or filtered based on the provided data.

Note: It is important to ensure that the value passed to the function is valid and appropriate for the specific hardware implementation. Improper values may lead to unexpected behavior or hardware malfunctions. Additionally, since this function is static inline, it is recommended to include it in performance-critical sections of code where the overhead of a function call should be minimized.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_BSSID_FILTER_LOW_ADDR]
    D --> E[End]

Function XPU_REG_BSSID_FILTER_LOW_read(void)

XPU_REG_BSSID_FILTER_LOW_read: The function of XPU_REG_BSSID_FILTER_LOW_read is to read the value from the BSSID filter low register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_BSSID_FILTER_LOW_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the constant XPU_REG_BSSID_FILTER_LOW_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the value stored at the address specified by XPU_REG_BSSID_FILTER_LOW_ADDR. This operation is typically used in low-level hardware programming to retrieve configuration or status information from a device's register.

The use of the static inline specifier suggests that this function is intended for performance optimization, allowing the compiler to replace calls to this function with the actual code, thus eliminating the overhead of a function call. This is particularly useful in performance-critical applications where register access is frequent.

Note: It is important to ensure that the XPU_REG_BSSID_FILTER_LOW_ADDR is correctly defined and points to a valid register in the hardware. Improper usage may lead to undefined behavior or incorrect data being read.

Output Example: A possible return value of this function could be a 32-bit unsigned integer, such as 0x00000001, which represents the current state or configuration of the BSSID filter low register.

graph TD
    A[Start] --> B[Call XPU_REG_BSSID_FILTER_LOW_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_BSSID_FILTER_LOW_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_BSSID_FILTER_LOW_read]
    F --> G[End]

Function XPU_REG_BSSID_FILTER_HIGH_write(u32 Data)

XPU_REG_BSSID_FILTER_HIGH_write: The function of XPU_REG_BSSID_FILTER_HIGH_write is to write a specified value to the BSSID filter high register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer that represents the value to be written to the BSSID filter high register.

Code Description: The function XPU_REG_BSSID_FILTER_HIGH_write is defined as a static inline function, which means it is intended for use only within the file where it is defined and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is of type u32 (unsigned 32-bit integer). Inside the function, the reg_write function is called with two arguments: the address of the BSSID filter high register (XPU_REG_BSSID_FILTER_HIGH_ADDR) and the Data value. This operation effectively writes the provided Data value to the specified register address, allowing for configuration or control of the BSSID filter high settings in the system.

Note: It is important to ensure that the Data value being written is valid and appropriate for the register to avoid unintended behavior. Additionally, since this function is static inline, it should be used in contexts where performance is critical, as it may reduce function call overhead.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_BSSID_FILTER_HIGH_ADDR]
    D --> E[End]

Function XPU_REG_BSSID_FILTER_HIGH_read(void)

XPU_REG_BSSID_FILTER_HIGH_read: The function of XPU_REG_BSSID_FILTER_HIGH_read is to read the value from the BSSID filter high register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_BSSID_FILTER_HIGH_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_BSSID_FILTER_HIGH_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the value stored at this register address. The inline nature of the function suggests that it is intended for performance optimization, allowing the compiler to insert the function's code directly at the point of invocation, thereby reducing the overhead of a function call.

The XPU_REG_BSSID_FILTER_HIGH_ADDR is likely a constant that represents the memory-mapped address of the BSSID filter high register in the XPU (eXtensible Processing Unit) hardware. This register is used to filter BSSID (Basic Service Set Identifier) information, which is crucial in wireless communication for identifying specific networks.

Note: It is important to ensure that the hardware is properly initialized before calling this function to avoid reading invalid data. Additionally, the function does not perform any error checking; thus, users should be aware of the potential for undefined behavior if the register address is incorrect or if the hardware is not accessible.

Output Example: A possible return value of this function could be a 32-bit unsigned integer, such as 0x00000001, which represents the current value stored in the BSSID filter high register.

graph TD
    A[Start] --> B[Call XPU_REG_BSSID_FILTER_HIGH_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_BSSID_FILTER_HIGH_ADDR]
    D --> E[Return value from reg_read]
    E --> F[End]

Function XPU_REG_BAND_CHANNEL_write(u32 Data)

XPU_REG_BAND_CHANNEL_write: The function of XPU_REG_BAND_CHANNEL_write is to write a specified value to the XPU_REG_BAND_CHANNEL register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer (u32) that represents the value to be written to the register.

Code Description: The XPU_REG_BAND_CHANNEL_write function is defined as a static inline function, which means it is intended to be used only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer. Inside the function, the reg_write function is called with two arguments: XPU_REG_BAND_CHANNEL_ADDR and Data.

XPU_REG_BAND_CHANNEL_ADDR is a predefined constant that represents the memory address of the XPU_REG_BAND_CHANNEL register. The reg_write function is responsible for performing the actual write operation to the specified address with the provided data value. This function effectively allows the user to set or modify the value of the XPU_REG_BAND_CHANNEL register, which is likely used for configuring or controlling specific functionalities of the XPU hardware.

Note: It is important to ensure that the value passed to the function is valid for the intended operation on the XPU_REG_BAND_CHANNEL register. Additionally, this function should be used in a context where the XPU hardware is properly initialized and ready to accept register writes to avoid unintended behavior.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_BAND_CHANNEL_ADDR]
    D --> E[End]

Function XPU_REG_BAND_CHANNEL_read(void)

XPU_REG_BAND_CHANNEL_read: The function of XPU_REG_BAND_CHANNEL_read is to read the value from the XPU_REG_BAND_CHANNEL register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_BAND_CHANNEL_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the constant XPU_REG_BAND_CHANNEL_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the value stored at the address specified by XPU_REG_BAND_CHANNEL_ADDR. The use of the static inline keyword suggests that this function is intended to be used in a performance-sensitive context, allowing the compiler to optimize the function call by potentially inlining the code directly at the call site.

Note: It is important to ensure that the XPU_REG_BAND_CHANNEL_ADDR is correctly defined and accessible within the scope of this function. Additionally, the reg_read function should be properly implemented to handle the specific requirements of reading from the hardware register, including any necessary synchronization or error handling.

Output Example: A possible return value of the function could be a 32-bit unsigned integer such as 0x0000001A, which represents the data read from the XPU_REG_BAND_CHANNEL register.

graph TD
    A[Start] --> B[Call XPU_REG_BAND_CHANNEL_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_BAND_CHANNEL_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_BAND_CHANNEL_read]
    F --> G[End]

Function XPU_REG_DIFS_ADVANCE_write(u32 Data)

XPU_REG_DIFS_ADVANCE_write: The function of XPU_REG_DIFS_ADVANCE_write is to write a specified value to the XPU_REG_DIFS_ADVANCE register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer value that will be written to the XPU_REG_DIFS_ADVANCE register.

Code Description: The XPU_REG_DIFS_ADVANCE_write function is defined as a static inline function, which means it is intended to be used only within the file where it is defined and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is of type u32 (unsigned 32-bit integer).

Inside the function, the reg_write function is called with two arguments: the address of the XPU_REG_DIFS_ADVANCE register (denoted by XPU_REG_DIFS_ADVANCE_ADDR) and the Data value. The reg_write function is responsible for performing the actual write operation to the specified register address. By passing the Data parameter, this function allows the user to set the value of the XPU_REG_DIFS_ADVANCE register to the desired state.

This function is crucial for configuring or controlling the behavior of the XPU hardware by directly manipulating the register values.

Note: When using this function, ensure that the Data value being written is valid and appropriate for the specific use case, as writing incorrect values to hardware registers can lead to undefined behavior or system instability.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_DIFS_ADVANCE_ADDR]
    D --> E[End]

Function XPU_REG_DIFS_ADVANCE_read(void)

XPU_REG_DIFS_ADVANCE_read: The function of XPU_REG_DIFS_ADVANCE_read is to read the value from the XPU_REG_DIFS_ADVANCE hardware register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The XPU_REG_DIFS_ADVANCE_read function is defined as a static inline function that returns a 32-bit unsigned integer (u32). The function performs a read operation from a specific hardware register identified by the address XPU_REG_DIFS_ADVANCE_ADDR. The function utilizes the reg_read function, which is assumed to be defined elsewhere in the codebase, to access the value stored at the specified register address. By being defined as inline, this function is intended to be expanded in place at the point of call, which can improve performance by eliminating the overhead of a function call.

Note: It is important to ensure that the XPU_REG_DIFS_ADVANCE_ADDR is correctly defined and accessible in the context where this function is used. Additionally, this function should be used in a context where reading from the hardware register is appropriate, as it may affect the state of the device or system.

Output Example: A possible return value of the function could be a 32-bit integer such as 0x00000001, which represents the current value stored in the XPU_REG_DIFS_ADVANCE register.

graph TD
    A[Start] --> B[Call XPU_REG_DIFS_ADVANCE_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_DIFS_ADVANCE_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_DIFS_ADVANCE_read]
    F --> G[End]

Function XPU_REG_FORCE_IDLE_MISC_write(u32 Data)

XPU_REG_FORCE_IDLE_MISC_write: The function of XPU_REG_FORCE_IDLE_MISC_write is to write a specified value to the XPU_REG_FORCE_IDLE_MISC register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer that represents the value to be written to the register.

Code Description: The XPU_REG_FORCE_IDLE_MISC_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is of type u32 (unsigned 32-bit integer). The primary operation performed by this function is to call the reg_write function, passing it two arguments: the address of the XPU_REG_FORCE_IDLE_MISC register (denoted as XPU_REG_FORCE_IDLE_MISC_ADDR) and the Data value. This operation effectively writes the provided Data value to the specified register address, allowing for control over the XPU's idle state behavior.

Note: It is important to ensure that the Data value being written is valid and appropriate for the intended operation of the XPU. Improper values may lead to undefined behavior or incorrect operation of the hardware. Additionally, since this function is static inline, it may not be visible outside of the file, which is a design choice to limit its scope and potential misuse.

graph TD
    A[Start] --> B[Call XPU_REG_FORCE_IDLE_MISC_write with Data]
    B --> C[Execute reg_write with XPU_REG_FORCE_IDLE_MISC_ADDR and Data]
    C --> D[End]

Function XPU_REG_FORCE_IDLE_MISC_read(void)

XPU_REG_FORCE_IDLE_MISC_read: The function of XPU_REG_FORCE_IDLE_MISC_read is to read the value from the XPU_REG_FORCE_IDLE_MISC register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_FORCE_IDLE_MISC_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_FORCE_IDLE_MISC_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the register's value. By marking the function as static inline, it suggests that this function is intended for use only within the file it is defined in, and the compiler may optimize its calls by inlining the function code directly at the call site, reducing the overhead of a function call.

Note: It is important to ensure that the XPU_REG_FORCE_IDLE_MISC_ADDR is correctly defined and accessible in the context where this function is used. Additionally, care should be taken when reading from hardware registers, as the state of the hardware may affect the returned value.

Output Example: A possible return value of this function could be a 32-bit integer such as 0x00000001, which represents the current state of the XPU_REG_FORCE_IDLE_MISC register at the time of the read operation.

graph TD
    A[Start] --> B[Call XPU_REG_FORCE_IDLE_MISC_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_FORCE_IDLE_MISC_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_FORCE_IDLE_MISC_read]
    F --> G[End]

Function XPU_REG_TSF_RUNTIME_VAL_LOW_read(void)

XPU_REG_TSF_RUNTIME_VAL_LOW_read: The function of XPU_REG_TSF_RUNTIME_VAL_LOW_read is to read the value from the XPU_REG_TSF_RUNTIME_VAL_LOW register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_TSF_RUNTIME_VAL_LOW_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the constant XPU_REG_TSF_RUNTIME_VAL_LOW_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the value stored at the address specified by XPU_REG_TSF_RUNTIME_VAL_LOW_ADDR. This operation is typically used in low-level programming to interact with hardware components, allowing the software to retrieve the current value of the specified register.

Note: It is important to ensure that the XPU_REG_TSF_RUNTIME_VAL_LOW_ADDR is correctly defined and points to a valid memory-mapped register. Improper access to hardware registers can lead to undefined behavior or system instability.

Output Example: A possible return value of the function could be a 32-bit integer such as 0x0000001A, which represents the current value read from the XPU_REG_TSF_RUNTIME_VAL_LOW register.

graph TD
    A[Start] --> B[Call XPU_REG_TSF_RUNTIME_VAL_LOW_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_TSF_RUNTIME_VAL_LOW_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_TSF_RUNTIME_VAL_LOW_read]
    F --> G[End]

Function XPU_REG_TSF_RUNTIME_VAL_HIGH_read(void)

XPU_REG_TSF_RUNTIME_VAL_HIGH_read: The function of XPU_REG_TSF_RUNTIME_VAL_HIGH_read is to read the value from the XPU_REG_TSF_RUNTIME_VAL_HIGH register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_TSF_RUNTIME_VAL_HIGH_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_TSF_RUNTIME_VAL_HIGH_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the register's value. By marking the function as static inline, it suggests that the function is intended for use only within the file it is defined in, and the compiler may optimize its calls by replacing the function call with the actual code, thereby reducing function call overhead.

Note: It is important to ensure that the register address XPU_REG_TSF_RUNTIME_VAL_HIGH_ADDR is correctly defined and accessible in the context where this function is used. Additionally, care should be taken when using this function in a multi-threaded environment, as concurrent reads may lead to inconsistent values if the register is being modified by other processes.

Output Example: A possible return value of this function could be a 32-bit unsigned integer such as 0x0000001A, which represents the current high value of the runtime timestamp from the specified register.

graph TD
    A[Start] --> B[Call XPU_REG_TSF_RUNTIME_VAL_HIGH_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_TSF_RUNTIME_VAL_HIGH_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_TSF_RUNTIME_VAL_HIGH_read]
    F --> G[End]

Function XPU_REG_TSF_LOAD_VAL_LOW_write(u32 value)

XPU_REG_TSF_LOAD_VAL_LOW_write: The function of XPU_REG_TSF_LOAD_VAL_LOW_write is to write a specified value to the XPU register that holds the low part of the timestamp load value.

parameters: The parameters of this Function. · value: This is a 32-bit unsigned integer (u32) that represents the value to be written to the XPU register.

Code Description: The XPU_REG_TSF_LOAD_VAL_LOW_write function is defined as a static inline function, which means it is intended to be used only within the file where it is defined and can be optimized by the compiler for performance. The function takes a single parameter, 'value', which is of type u32. Inside the function, the reg_write function is called with two arguments: the address of the XPU register (XPU_REG_TSF_LOAD_VAL_LOW_ADDR) and the value to be written. This operation effectively updates the register with the provided value, allowing for the low part of the timestamp load value to be set or modified as needed.

Note: It is important to ensure that the value being written is appropriate for the register's intended use and that the register address (XPU_REG_TSF_LOAD_VAL_LOW_ADDR) is correctly defined in the context of the system. Improper use may lead to unexpected behavior in the XPU's operation.

graph TD
    A[Start] --> B[Call XPU_REG_TSF_LOAD_VAL_LOW_write with value]
    B --> C[Execute reg_write function]
    C --> D[Write value to XPU_REG_TSF_LOAD_VAL_LOW_ADDR]
    D --> E[End]

Function XPU_REG_TSF_LOAD_VAL_HIGH_write(u32 value)

XPU_REG_TSF_LOAD_VAL_HIGH_write: The function of XPU_REG_TSF_LOAD_VAL_HIGH_write is to write a specified value to the XPU_REG_TSF_LOAD_VAL_HIGH register.

parameters: The parameters of this Function. · value: The 32-bit unsigned integer value to be written to the register.

Code Description: The XPU_REG_TSF_LOAD_VAL_HIGH_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, 'value', which is of type u32 (unsigned 32-bit integer). The primary operation performed by this function is to call the reg_write function, passing in two arguments: the address of the XPU_REG_TSF_LOAD_VAL_HIGH register (denoted as XPU_REG_TSF_LOAD_VAL_HIGH_ADDR) and the value to be written. This operation effectively updates the specified register with the provided value, allowing for configuration or control of the associated hardware component.

Note: It is important to ensure that the value being written is appropriate for the register's intended use, as writing incorrect values may lead to undefined behavior or hardware malfunctions. Additionally, since this function is static inline, it is recommended to include it in performance-critical sections of code where register manipulation is required.

graph TD
    A[Start] --> B[Call XPU_REG_TSF_LOAD_VAL_HIGH_write function]
    B --> C[Receive input value]
    C --> D[Execute reg_write function]
    D --> E[Write value to XPU_REG_TSF_LOAD_VAL_HIGH_ADDR]
    E --> F[End]

Function XPU_REG_TSF_LOAD_VAL_write(u32 high_value, u32 low_value)

XPU_REG_TSF_LOAD_VAL_write: The function of XPU_REG_TSF_LOAD_VAL_write is to write a combined high and low value to the XPU timestamp load register.

parameters: The parameters of this Function. · parameter1: high_value - The upper 32 bits of the value to be written to the timestamp load register. · parameter2: low_value - The lower 32 bits of the value to be written to the timestamp load register.

Code Description: The XPU_REG_TSF_LOAD_VAL_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes two parameters: high_value and low_value, both of which are of type u32 (unsigned 32-bit integer).

The function performs the following operations: 1. It first calls the XPU_REG_TSF_LOAD_VAL_LOW_write function, passing low_value as an argument. This operation writes the lower part of the timestamp value to the corresponding low register. 2. Next, it writes to the high register twice. The first call to XPU_REG_TSF_LOAD_VAL_HIGH_write includes a bitwise OR operation with the high_value and the constant 0x80000000. This operation sets the most significant bit (MSB) of the high_value to 1, indicating that the high part of the timestamp is being written. 3. The second call to XPU_REG_TSF_LOAD_VAL_HIGH_write writes the high_value with the MSB cleared (using a bitwise AND operation with the negation of 0x80000000). This effectively writes the remaining bits of the high_value to the high register without the MSB set.

This sequence of operations ensures that the timestamp value is correctly loaded into the respective registers, with proper handling of the most significant bit.

Note: It is important to ensure that the values passed to this function are within the expected range for the timestamp registers. Additionally, the order of operations is crucial; the low value must be written before the high value to maintain the integrity of the timestamp data.

graph TD
    A[Start] --> B[Call XPU_REG_TSF_LOAD_VAL_write]
    B --> C[Write low_value to XPU_REG_TSF_LOAD_VAL_LOW]
    C --> D[Calculate high_value with msb high]
    D --> E[Write high_value with msb high to XPU_REG_TSF_LOAD_VAL_HIGH]
    E --> F[Calculate high_value with msb low]
    F --> G[Write high_value with msb low to XPU_REG_TSF_LOAD_VAL_HIGH]
    G --> H[End]

Function XPU_REG_LBT_TH_write(u32 value)

XPU_REG_LBT_TH_write: The function of XPU_REG_LBT_TH_write is to write a specified value to the XPU register for LBT threshold configuration.

parameters: The parameters of this Function. · value: This is a 32-bit unsigned integer (u32) that represents the value to be written to the XPU register.

Code Description: The XPU_REG_LBT_TH_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, 'value', which is of type u32. Inside the function, the reg_write function is called with two arguments: XPU_REG_LBT_TH_ADDR and value. Here, XPU_REG_LBT_TH_ADDR is a predefined constant that represents the address of the XPU register where the LBT threshold value is to be written. The reg_write function is responsible for performing the actual write operation to the specified register address with the provided value. This function is crucial for configuring the LBT threshold in the XPU hardware, allowing for adjustments to be made based on the requirements of the system.

Note: It is important to ensure that the value being written is within the acceptable range for the LBT threshold to avoid undefined behavior or hardware malfunctions. Additionally, this function should be used in contexts where register access is permitted and safe, as improper usage could lead to system instability.

graph TD
    A[Start] --> B[Call XPU_REG_LBT_TH_write with value]
    B --> C[Execute reg_write function]
    C --> D[Write value to XPU_REG_LBT_TH_ADDR]
    D --> E[End]

Function XPU_REG_RSSI_DB_CFG_read(void)

XPU_REG_RSSI_DB_CFG_read: The function of XPU_REG_RSSI_DB_CFG_read is to read the value from the RSSI (Received Signal Strength Indicator) database configuration register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_RSSI_DB_CFG_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_RSSI_DB_CFG_ADDR. The function utilizes the reg_read function to access the value stored at this address. The use of the static inline keyword suggests that this function is intended for performance optimization, allowing the compiler to replace calls to this function with the actual code, thus reducing function call overhead. This function does not take any parameters and directly returns the value read from the register, which is crucial for applications that need to monitor or configure the RSSI settings in a system.

Note: It is important to ensure that the XPU_REG_RSSI_DB_CFG_ADDR is correctly defined and accessible in the context where this function is used. Additionally, the reg_read function must be implemented correctly to handle the hardware-specific details of reading from the register.

Output Example: A possible return value of the function could be a 32-bit integer such as 0x0000001A, which represents the current configuration value of the RSSI database register.

graph TD
    A[Start] --> B[Call XPU_REG_RSSI_DB_CFG_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_RSSI_DB_CFG_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_RSSI_DB_CFG_read]
    F --> G[End]

Function XPU_REG_RSSI_DB_CFG_write(u32 Data)

XPU_REG_RSSI_DB_CFG_write: The function of XPU_REG_RSSI_DB_CFG_write is to write a specified value to the RSSI (Received Signal Strength Indicator) database configuration register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer that represents the value to be written to the RSSI database configuration register.

Code Description: The function XPU_REG_RSSI_DB_CFG_write is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer. This value is intended to configure the RSSI database settings in the hardware register.

Inside the function, the reg_write function is called with two arguments: XPU_REG_RSSI_DB_CFG_ADDR and Data. The XPU_REG_RSSI_DB_CFG_ADDR is a predefined constant that represents the memory address of the RSSI database configuration register. The reg_write function is responsible for writing the provided Data value to the specified register address. This operation is crucial for setting up the hardware to correctly interpret the signal strength data.

The use of static inline suggests that this function is optimized for performance, allowing it to be called frequently without the overhead of a traditional function call. This is particularly important in low-level hardware programming, where efficiency is key.

Note: When using this function, ensure that the Data parameter is set to a valid value that the hardware can accept. Writing incorrect values to the register may lead to undefined behavior or hardware malfunctions. Additionally, this function should only be called when the system is in a state that allows for register configuration.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_RSSI_DB_CFG_ADDR]
    D --> E[End]

Function XPU_REG_LBT_TH_read(void)

XPU_REG_LBT_TH_read: The function of XPU_REG_LBT_TH_read is to read the value from the XPU register LBT_TH.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_LBT_TH_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the constant XPU_REG_LBT_TH_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the value stored at the address specified by XPU_REG_LBT_TH_ADDR. The use of the static inline specifier suggests that this function is intended for performance optimization, allowing the compiler to replace calls to this function with the actual code, thus reducing function call overhead.

Note: It is important to ensure that the XPU_REG_LBT_TH_ADDR is correctly defined and accessible in the context where this function is used. Additionally, since this function interacts with hardware registers, it should be called in an appropriate context where the hardware is initialized and ready for communication.

Output Example: A possible return value of this function could be a 32-bit integer such as 0x0000001A, representing the data read from the XPU register LBT_TH.

graph TD
    A[Start] --> B[Call XPU_REG_LBT_TH_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_LBT_TH_ADDR]
    D --> E[Return value from reg_read]
    E --> F[End]

Function XPU_REG_CSMA_DEBUG_write(u32 value)

XPU_REG_CSMA_DEBUG_write: The function of XPU_REG_CSMA_DEBUG_write is to write a specified value to the CSMA debug register.

parameters: The parameters of this Function. · value: This is a 32-bit unsigned integer (u32) that represents the value to be written to the CSMA debug register.

Code Description: The XPU_REG_CSMA_DEBUG_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and can be optimized by the compiler for performance. The function takes a single parameter, 'value', which is of type u32. Inside the function, the reg_write function is called with two arguments: XPU_REG_CSMA_DEBUG_ADDR and value. Here, XPU_REG_CSMA_DEBUG_ADDR is a predefined constant that represents the memory address of the CSMA debug register. The reg_write function is responsible for performing the actual write operation to the specified address with the provided value. This function is crucial for configuring or updating the state of the CSMA debug register in the system.

Note: It is important to ensure that the value being written is appropriate for the CSMA debug register, as incorrect values may lead to undefined behavior or system instability. Additionally, since this function is defined as inline, it is recommended to use it in performance-critical sections of code where the overhead of a function call should be minimized.

graph TD
    A[Start] --> B[Call XPU_REG_CSMA_DEBUG_write with value]
    B --> C[Execute reg_write function]
    C --> D[Write value to XPU_REG_CSMA_DEBUG_ADDR]
    D --> E[End]

Function XPU_REG_CSMA_DEBUG_read(void)

XPU_REG_CSMA_DEBUG_read: The function of XPU_REG_CSMA_DEBUG_read is to read the value from the CSMA debug register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The XPU_REG_CSMA_DEBUG_read function is defined as a static inline function that returns a 32-bit unsigned integer (u32). The function performs a read operation from a specific hardware register identified by the address XPU_REG_CSMA_DEBUG_ADDR. The function utilizes the reg_read function to access the register's value. By being defined as inline, this function is intended to be expanded in place at the point of call, which can enhance performance by eliminating the overhead of a function call. The return value represents the current state or configuration of the CSMA debug register, which is typically used for debugging purposes in the context of XPU (eXtended Processing Unit) operations.

Note: It is important to ensure that the XPU_REG_CSMA_DEBUG_ADDR is correctly defined and accessible in the context where this function is used. Additionally, the reg_read function should be implemented correctly to handle the hardware-specific details of reading from the register.

Output Example: A possible return value of the function could be 0x00000001, indicating a specific state or configuration of the CSMA debug register.

graph TD
    A[Start] --> B[Call XPU_REG_CSMA_DEBUG_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_CSMA_DEBUG_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_CSMA_DEBUG_read]
    F --> G[End]

Function XPU_REG_CSMA_CFG_write(u32 value)

XPU_REG_CSMA_CFG_write: The function of XPU_REG_CSMA_CFG_write is to write a specified value to the CSMA configuration register.

parameters: The parameters of this Function. · value: The 32-bit unsigned integer that represents the value to be written to the CSMA configuration register.

Code Description: The XPU_REG_CSMA_CFG_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. This function takes a single parameter, 'value', which is of type u32 (unsigned 32-bit integer). The function performs a write operation to a specific hardware register identified by the constant XPU_REG_CSMA_CFG_ADDR. The actual writing is accomplished through the reg_write function, which is presumably defined elsewhere in the codebase. This operation is crucial for configuring the CSMA (Carrier Sense Multiple Access) settings of the XPU (eXtended Processing Unit) hardware, allowing for proper management of data transmission in a network environment.

Note: It is important to ensure that the value being written is valid and appropriate for the CSMA configuration to avoid unintended behavior in the hardware. Additionally, since this function is static inline, it should be used in contexts where performance is critical, as it may reduce function call overhead.

graph TD
    A[Start] --> B[Call XPU_REG_CSMA_CFG_write with value]
    B --> C[Execute reg_write function]
    C --> D[Write value to XPU_REG_CSMA_CFG_ADDR]
    D --> E[End]

Function XPU_REG_CSMA_CFG_read(void)

XPU_REG_CSMA_CFG_read: The function of XPU_REG_CSMA_CFG_read is to read the value from the CSMA configuration register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The XPU_REG_CSMA_CFG_read function is defined as a static inline function that returns a 32-bit unsigned integer (u32). The function performs a read operation from a specific hardware register identified by the address XPU_REG_CSMA_CFG_ADDR. The function utilizes the reg_read function, which is assumed to be defined elsewhere in the codebase, to access the register at the specified address. The return value of this function is the data retrieved from the CSMA configuration register, which is typically used in the context of configuring or monitoring the Carrier Sense Multiple Access (CSMA) protocol settings in a communication system.

Note: It is important to ensure that the XPU_REG_CSMA_CFG_ADDR is correctly defined and accessible in the context where this function is called. Additionally, since this function is marked as static inline, it is intended for use within the same compilation unit, and its inlining may optimize performance by eliminating function call overhead.

Output Example: A possible return value of the function could be a 32-bit integer such as 0x00000001, which may represent a specific configuration state of the CSMA register.

graph TD
    A[Start] --> B[Call XPU_REG_CSMA_CFG_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_CSMA_CFG_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_CSMA_CFG_read]
    F --> G[End]

Function XPU_REG_SLICE_COUNT_TOTAL_write(u32 value)

XPU_REG_SLICE_COUNT_TOTAL_write: The function of XPU_REG_SLICE_COUNT_TOTAL_write is to write a specified value to the XPU register that tracks the total slice count.

parameters: The parameters of this Function. · value: A 32-bit unsigned integer (u32) representing the value to be written to the XPU register.

Code Description: The XPU_REG_SLICE_COUNT_TOTAL_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, 'value', which is of type u32. This parameter is the data that will be written to the XPU register.

The function calls the reg_write function, passing two arguments: the address of the XPU register (XPU_REG_SLICE_COUNT_TOTAL_ADDR) and the value to be written. The reg_write function is responsible for performing the actual write operation to the specified register address. By using this function, developers can update the total slice count in the XPU hardware component, which is essential for managing and monitoring the performance of the processing unit.

Note: It is important to ensure that the value being written is within the acceptable range for the XPU register to avoid unintended behavior. Additionally, this function should be used in contexts where register access is permitted, as improper use may lead to system instability or hardware malfunctions.

graph TD
    A[Start] --> B[Call XPU_REG_SLICE_COUNT_TOTAL_write]
    B --> C[Receive value as parameter]
    C --> D[Execute reg_write function]
    D --> E[Write value to XPU_REG_SLICE_COUNT_TOTAL_ADDR]
    E --> F[End]

Function XPU_REG_SLICE_COUNT_START_write(u32 value)

XPU_REG_SLICE_COUNT_START_write: The function of XPU_REG_SLICE_COUNT_START_write is to write a specified value to the XPU register that controls the slice count start.

parameters: The parameters of this Function. · value: This is a 32-bit unsigned integer (u32) that represents the value to be written to the XPU register.

Code Description: The XPU_REG_SLICE_COUNT_START_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, 'value', which is expected to be a 32-bit unsigned integer.

Inside the function, the reg_write function is called with two arguments: the address of the XPU register (XPU_REG_SLICE_COUNT_START_ADDR) and the value to be written. The reg_write function is responsible for performing the actual write operation to the specified register address. This operation is crucial for configuring the XPU hardware, specifically for setting the starting count for slices in the processing unit.

The use of static inline suggests that this function is designed for efficiency, allowing it to be inlined at the call site, thus reducing the overhead of a function call. This is particularly beneficial in performance-critical code where register manipulation is frequent.

Note: It is important to ensure that the value being written is within the acceptable range for the XPU register to avoid undefined behavior. Additionally, this function should be used in the appropriate context where the XPU hardware is initialized and ready to accept configuration changes.

graph TD
    A[Start XPU_REG_SLICE_COUNT_START_write function] --> B[Receive input value]
    B --> C[Call reg_write function]
    C --> D[Write value to XPU_REG_SLICE_COUNT_START_ADDR]
    D --> E[End XPU_REG_SLICE_COUNT_START_write function]

Function XPU_REG_SLICE_COUNT_END_write(u32 value)

XPU_REG_SLICE_COUNT_END_write: The function of XPU_REG_SLICE_COUNT_END_write is to write a specified value to the XPU register that controls the slice count end.

parameters: The parameters of this Function. · value: A 32-bit unsigned integer (u32) that represents the value to be written to the XPU register.

Code Description: The XPU_REG_SLICE_COUNT_END_write function is defined as a static inline function, which means it is intended for use only within the file where it is defined (xpu.c) and may be optimized by the compiler for performance. The function takes a single parameter, 'value', which is of type u32. Inside the function, the reg_write function is called with two arguments: the address of the XPU register (XPU_REG_SLICE_COUNT_END_ADDR) and the 'value' parameter. This operation effectively writes the provided value to the specified register address, thereby updating the configuration or state of the XPU slice count end.

Note: It is important to ensure that the value being written is valid and appropriate for the intended operation, as writing incorrect values to hardware registers can lead to undefined behavior or system instability. Additionally, since this function is static inline, it may not be visible outside of this file, and developers should be aware of the context in which it is used.

graph TD
    A[Start] --> B[Call XPU_REG_SLICE_COUNT_END_write]
    B --> C[Receive value parameter]
    C --> D[Execute reg_write function]
    D --> E[Write value to XPU_REG_SLICE_COUNT_END_ADDR]
    E --> F[End]

Function XPU_REG_SLICE_COUNT_TOTAL_read(void)

XPU_REG_SLICE_COUNT_TOTAL_read: The function of XPU_REG_SLICE_COUNT_TOTAL_read is to read the total slice count from a specific hardware register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_SLICE_COUNT_TOTAL_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a hardware register located at the address defined by XPU_REG_SLICE_COUNT_TOTAL_ADDR. The function utilizes the reg_read function to access the register value. By calling this function, the user can obtain the current value stored in the XPU_REG_SLICE_COUNT_TOTAL register, which typically represents the total number of slices in the XPU (eXtended Processing Unit) architecture. The use of the static inline qualifier suggests that this function is intended for performance optimization, allowing the compiler to insert the function's code directly at the point of call, thereby reducing function call overhead.

Note: It is important to ensure that the hardware register address XPU_REG_SLICE_COUNT_TOTAL_ADDR is correctly defined and accessible before invoking this function. Additionally, this function should be used in a context where the XPU is properly initialized and operational to avoid reading invalid data.

Output Example: A possible return value of this function could be 5, indicating that there are currently 5 slices counted in the XPU's total slice register.

graph TD
    A[Start] --> B[Call XPU_REG_SLICE_COUNT_TOTAL_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_SLICE_COUNT_TOTAL_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_SLICE_COUNT_TOTAL_read]
    F --> G[End]

Function XPU_REG_SLICE_COUNT_START_read(void)

XPU_REG_SLICE_COUNT_START_read: The function of XPU_REG_SLICE_COUNT_START_read is to read the value from the XPU_REG_SLICE_COUNT_START register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The XPU_REG_SLICE_COUNT_START_read function is defined as a static inline function that returns a 32-bit unsigned integer (u32). The function performs a read operation from a specific hardware register identified by the address XPU_REG_SLICE_COUNT_START_ADDR. The function utilizes the reg_read function to access the register's value. The inline keyword suggests that the compiler may replace calls to this function with the function's body to optimize performance, reducing the overhead of a function call. This function is typically used in scenarios where the current slice count of the XPU (eXtensible Processing Unit) needs to be retrieved for monitoring or control purposes.

Note: It is important to ensure that the XPU_REG_SLICE_COUNT_START_ADDR is correctly defined and accessible in the context where this function is used. Additionally, this function should be called in a context where the hardware is properly initialized to avoid undefined behavior.

Output Example: A possible return value of this function could be a 32-bit integer such as 5, which may indicate that there are currently 5 slices active in the XPU.

graph TD
    A[Start] --> B[Call XPU_REG_SLICE_COUNT_START_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_SLICE_COUNT_START_ADDR]
    D --> E[Return value]
    E --> F[End]

Function XPU_REG_SLICE_COUNT_END_read(void)

XPU_REG_SLICE_COUNT_END_read: The function of XPU_REG_SLICE_COUNT_END_read is to read the value from the XPU_REG_SLICE_COUNT_END register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_SLICE_COUNT_END_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). The function performs a read operation from a specific hardware register identified by the address XPU_REG_SLICE_COUNT_END_ADDR. This address is likely defined elsewhere in the code, and the function utilizes the reg_read function to access the value stored at that address. The use of the static inline keyword suggests that this function is intended for performance optimization, allowing the compiler to inline the function call, thereby reducing the overhead of a function call in performance-critical code. The return value of this function represents the current state or configuration of the XPU_REG_SLICE_COUNT_END register.

Note: It is important to ensure that the XPU_REG_SLICE_COUNT_END_ADDR is correctly defined and accessible within the context where this function is used. Additionally, the function should be called in a context where the register's value is expected to be valid and meaningful.

Output Example: A possible return value of the function could be a 32-bit unsigned integer, such as 0x0000000A, which may represent a specific configuration or status of the XPU_REG_SLICE_COUNT_END register.

graph TD
    A[Start] --> B[Call XPU_REG_SLICE_COUNT_END_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_SLICE_COUNT_END_ADDR]
    D --> E[Return value from reg_read]
    E --> F[Return value from XPU_REG_SLICE_COUNT_END_read]
    F --> G[End]

Function XPU_REG_BB_RF_DELAY_write(u32 value)

XPU_REG_BB_RF_DELAY_write: The function of XPU_REG_BB_RF_DELAY_write is to write a specified value to the XPU register that controls the baseband radio frequency delay.

parameters: The parameters of this Function. · value: This is a 32-bit unsigned integer (u32) that represents the value to be written to the XPU register.

Code Description: The XPU_REG_BB_RF_DELAY_write function is defined as a static inline function, which means it is intended to be used only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, 'value', which is of type u32. Inside the function, the reg_write function is called with two arguments: the address of the XPU register (XPU_REG_BB_RF_DELAY_ADDR) and the value to be written. The reg_write function is responsible for performing the actual write operation to the specified register address. This function is crucial for configuring the delay settings of the baseband radio frequency, which can impact the performance and functionality of the XPU.

Note: It is important to ensure that the value being written is within the acceptable range for the XPU register to avoid unintended behavior. Additionally, this function should be called in a context where the hardware is ready to accept register writes to prevent any potential issues.

graph TD
    A[Start] --> B[Call XPU_REG_BB_RF_DELAY_write with value]
    B --> C[Execute reg_write function]
    C --> D[Write value to XPU_REG_BB_RF_DELAY_ADDR]
    D --> E[End]

Function XPU_REG_ACK_CTL_MAX_NUM_RETRANS_write(u32 value)

XPU_REG_ACK_CTL_MAX_NUM_RETRANS_write: The function of XPU_REG_ACK_CTL_MAX_NUM_RETRANS_write is to write a specified value to the XPU register that controls the maximum number of retransmissions.

parameters: The parameters of this Function. · value: This parameter is of type u32 and represents the value to be written to the XPU register.

Code Description: The function XPU_REG_ACK_CTL_MAX_NUM_RETRANS_write is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, 'value', which is a 32-bit unsigned integer (u32). Inside the function, the reg_write function is called with two arguments: the address of the XPU register (XPU_REG_ACK_CTL_MAX_NUM_RETRANS_ADDR) and the 'value' parameter. This operation effectively writes the provided value to the specified register address, thereby configuring the maximum number of retransmissions for the XPU.

Note: It is important to ensure that the value being written is within the acceptable range for the register to avoid unintended behavior. Additionally, since this function is static inline, it may not be visible outside of the file, and its inlining can lead to improved performance in scenarios where it is called frequently.

graph TD
    A[Start] --> B[Call XPU_REG_ACK_CTL_MAX_NUM_RETRANS_write]
    B --> C[Receive value parameter]
    C --> D[Execute reg_write function]
    D --> E[Write value to XPU_REG_ACK_CTL_MAX_NUM_RETRANS_ADDR]
    E --> F[End]

Function XPU_REG_ACK_CTL_MAX_NUM_RETRANS_read(void)

XPU_REG_ACK_CTL_MAX_NUM_RETRANS_read: The function of XPU_REG_ACK_CTL_MAX_NUM_RETRANS_read is to read the value from the register that controls the maximum number of retransmissions for acknowledgment in the XPU.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_ACK_CTL_MAX_NUM_RETRANS_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_ACK_CTL_MAX_NUM_RETRANS_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the value stored at the specified register address. The use of the static inline keyword indicates that this function is intended to be optimized by the compiler and may be expanded inline at the point of call, reducing function call overhead.

The purpose of this function is to provide a straightforward interface for retrieving the current configuration of the maximum number of retransmissions allowed for acknowledgment in the XPU, which is critical for managing communication reliability in the system.

Note: It is important to ensure that the register address XPU_REG_ACK_CTL_MAX_NUM_RETRANS_ADDR is correctly defined and accessible within the context of the system. Additionally, care should be taken when reading from hardware registers, as improper access may lead to undefined behavior or system instability.

Output Example: A possible return value of this function could be 5, indicating that the maximum number of retransmissions for acknowledgment is set to 5.

graph TD
    A[Start] --> B[Call XPU_REG_ACK_CTL_MAX_NUM_RETRANS_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_ACK_CTL_MAX_NUM_RETRANS_ADDR]
    D --> E[Return value from reg_read]
    E --> F[End]

Function XPU_REG_AMPDU_ACTION_write(u32 Data)

XPU_REG_AMPDU_ACTION_write: The function of XPU_REG_AMPDU_ACTION_write is to write a specified value to the AMPDU action register.

parameters: The parameters of this Function. · Data: A 32-bit unsigned integer (u32) that represents the value to be written to the AMPDU action register.

Code Description: The XPU_REG_AMPDU_ACTION_write function is defined as a static inline function, which means it is intended for use only within the file it is defined in and may be optimized by the compiler for performance. The function takes a single parameter, Data, which is a 32-bit unsigned integer. The primary operation of this function is to call the reg_write function, passing it two arguments: the address of the AMPDU action register (XPU_REG_AMPDU_ACTION_ADDR) and the value contained in the Data parameter. This operation effectively updates the register with the new value, allowing for control over the AMPDU (Aggregated MAC Protocol Data Unit) actions in the context of the XPU (eXtended Processing Unit).

Note: It is important to ensure that the value passed to the function is valid and appropriate for the specific use case, as writing incorrect values to hardware registers can lead to undefined behavior or system instability. Additionally, since this function is marked as inline, it is recommended to use it in performance-critical sections of code where the overhead of a function call should be minimized.

graph TD
    A[Start] --> B[Receive Data]
    B --> C[Call reg_write function]
    C --> D[Write Data to XPU_REG_AMPDU_ACTION_ADDR]
    D --> E[End]

Function XPU_REG_AMPDU_ACTION_read(void)

XPU_REG_AMPDU_ACTION_read: The function of XPU_REG_AMPDU_ACTION_read is to read the value from the XPU_REG_AMPDU_ACTION register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The function XPU_REG_AMPDU_ACTION_read is defined as a static inline function that returns a 32-bit unsigned integer (u32). It performs a read operation from a specific hardware register identified by the address XPU_REG_AMPDU_ACTION_ADDR. The function utilizes the reg_read function, which is presumably defined elsewhere in the codebase, to access the register's value. The use of the static inline specifier suggests that this function is intended for performance optimization, allowing the compiler to replace calls to this function with the actual code, thus reducing function call overhead. Since it does not take any parameters, it directly accesses the register address defined by XPU_REG_AMPDU_ACTION_ADDR.

Note: It is important to ensure that the register address XPU_REG_AMPDU_ACTION_ADDR is correctly defined and accessible in the context where this function is used. Additionally, the function should be called in a context where the register's value is expected to be valid and meaningful.

Output Example: A possible return value of this function could be a 32-bit integer such as 0x00000001, representing a specific state or configuration of the XPU_REG_AMPDU_ACTION register.

graph TD
    A[Start] --> B[Call XPU_REG_AMPDU_ACTION_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_AMPDU_ACTION_ADDR]
    D --> E[Return value from reg_read]
    E --> F[End]

Function XPU_REG_SPI_DISABLE_write(u32 Data)

XPU_REG_SPI_DISABLE_write: The function of XPU_REG_SPI_DISABLE_write is to write a specified value to the SPI disable register.

parameters: The parameters of this Function. · Data: This is a 32-bit unsigned integer (u32) that represents the value to be written to the SPI disable register.

Code Description: The function XPU_REG_SPI_DISABLE_write is defined as a static inline function, which means it is intended to be used only within the file it is defined in and can be optimized by the compiler for performance. The function takes a single parameter, Data, which is expected to be a 32-bit unsigned integer. Inside the function, the reg_write function is called with two arguments: XPU_REG_SPI_DISABLE_ADDR and Data.

XPU_REG_SPI_DISABLE_ADDR is a predefined constant that represents the memory address of the SPI disable register. The reg_write function is responsible for performing the actual write operation to the specified address with the provided data. This effectively disables the SPI functionality by writing the appropriate value to the register.

The use of the static inline keyword suggests that this function is designed for efficiency, allowing the compiler to insert the function's code directly at the point of call, thus reducing the overhead of a function call.

Note: It is important to ensure that the value passed to the Data parameter is appropriate for the operation intended, as writing incorrect values to the SPI disable register may lead to unintended behavior in the system. Additionally, this function should be used in contexts where the SPI interface needs to be disabled, and proper care should be taken to manage the state of the SPI peripheral accordingly.

graph TD
    A[Start] --> B[Call XPU_REG_SPI_DISABLE_write with Data]
    B --> C[Execute reg_write function]
    C --> D[Write Data to XPU_REG_SPI_DISABLE_ADDR]
    D --> E[End]

Function XPU_REG_SPI_DISABLE_read(void)

XPU_REG_SPI_DISABLE_read: The function of XPU_REG_SPI_DISABLE_read is to read the value from the XPU_REG_SPI_DISABLE register.

parameters: The parameters of this Function. · There are no parameters for this function.

Code Description: The XPU_REG_SPI_DISABLE_read function is defined as a static inline function that returns a 32-bit unsigned integer (u32). The purpose of this function is to read the current value of the XPU_REG_SPI_DISABLE register. It achieves this by calling the reg_read function, passing the address of the XPU_REG_SPI_DISABLE register, which is defined by the constant XPU_REG_SPI_DISABLE_ADDR. The use of the static inline qualifier suggests that this function is intended to be optimized by the compiler, allowing it to be inlined at the call site to improve performance. The return value of the function is the result of the reg_read call, which represents the current state of the XPU_REG_SPI_DISABLE register.

Note: It is important to ensure that the XPU_REG_SPI_DISABLE_ADDR is correctly defined and accessible in the context where this function is used. Additionally, the reg_read function must be implemented correctly to handle the reading of the register value.

Output Example: A possible return value of this function could be a 32-bit unsigned integer, such as 0x00000001, indicating that the SPI disable register is set to a specific state.

graph TD
    A[Start] --> B[Call XPU_REG_SPI_DISABLE_read]
    B --> C[Execute reg_read function]
    C --> D[Read value from XPU_REG_SPI_DISABLE_ADDR]
    D --> E[Return value from reg_read]
    E --> F[End]

Function XPU_REG_MAC_ADDR_write(u8 *mac_addr)

XPU_REG_MAC_ADDR_write: The function of XPU_REG_MAC_ADDR_write is to write a MAC address to specific registers in the XPU hardware.

parameters: The parameters of this Function. · mac_addr: A pointer to an array of 8 bytes representing the MAC address to be written.

Code Description: The XPU_REG_MAC_ADDR_write function is a static inline function that takes a pointer to a MAC address (mac_addr) as its parameter. This function is responsible for writing the MAC address into two separate registers: the lower and higher parts of the address.

The function first writes the lower 32 bits of the MAC address by dereferencing the mac_addr pointer and casting it to a pointer to a 32-bit unsigned integer (u32). This is done using the function XPU_REG_MAC_ADDR_LOW_write, which is assumed to handle the writing of the lower part of the MAC address to the appropriate register.

Next, the function writes the upper 16 bits of the MAC address. This is achieved by accessing the memory location that is 4 bytes ahead of the mac_addr pointer (i.e., mac_addr + 4) and casting it to a pointer to a 16-bit unsigned integer (u16). The function XPU_REG_MAC_ADDR_HIGH_write is then called to write this value to the corresponding register.

There is a conditional compilation block (#if 0 ... #endif) that contains additional logic for enabling or disabling a MAC address filter based on an 'en_flag' parameter. However, this block is currently disabled (as indicated by the #if 0 directive), meaning that the filtering functionality is not active in the current implementation.

Note: It is important to ensure that the mac_addr parameter points to a valid memory location containing a properly formatted MAC address. The function assumes that the MAC address is provided in a contiguous block of memory with the correct byte order. Additionally, since the filtering logic is currently commented out, any intended functionality related to enabling or disabling the MAC address filter will not be executed unless the code is modified to enable that section.

graph TD
    A[Start] --> B[Receive MAC address]
    B --> C[Write lower part of MAC address]
    C --> D[Write higher part of MAC address]
    D --> E[End]

Function hw_init(enum xpu_mode mode)

hw_init: The function of hw_init is to initialize the hardware settings for the XPU (eXtensible Processing Unit) based on the specified mode.

parameters: The parameters of this Function. · mode: An enumeration value of type xpu_mode that specifies the operating mode of the XPU. It can be either XPU_TEST or XPU_NORMAL.

Code Description: The hw_init function performs a series of hardware initialization tasks for the XPU. It begins by printing the current mode of operation. The function then executes a reset sequence on the XPU by writing to the XPU_REG_MULTI_RST register multiple times to ensure all components are reset properly.

Next, the function sets up various filter flags that determine which packets the XPU will process. It writes a predefined filter flag value to the XPU_REG_FILTER_FLAG register. The function also configures the CTS to RTS (Clear To Send to Request To Send) timing settings.

The initialization continues with the configuration of the receive acknowledgment count and the timing for sending acknowledgments. The function sets up the baseband and RF delays, which are crucial for synchronizing the transmission and reception of signals.

The function then configures the time schedule for all queues, ensuring that they are synchronized and set to open for processing. It resets the counters for all queues simultaneously.

Based on the provided mode, the function logs the current mode of operation. It also writes the band and channel settings to the XPU_REG_BAND_CHANNEL register, configuring the XPU to operate on the 5.8GHz band and channel 44 by default.

The function continues by configuring the RSSI (Received Signal Strength Indicator) settings, including the gain delay and threshold values. It writes these configurations to the appropriate registers.

Additionally, the function controls the duration to force the XPU into an idle state after decoding a packet, which is essential for managing the timing of signal processing.

Finally, the function writes various configuration values to the CSMA (Carrier Sense Multiple Access) debug and configuration registers, ensuring that the XPU is set up for efficient packet handling.

The function concludes by printing any errors encountered during the initialization process and returns an error code, which indicates the success or failure of the initialization.

Note: It is important to ensure that the correct mode is passed to the hw_init function, as an incorrect mode will result in an error being logged and returned. Proper initialization is crucial for the correct operation of the XPU.

Output Example: A possible return value of the function could be 0, indicating successful initialization, or 1, indicating an error due to an invalid mode.

graph TD
    A[Start hw_init function] --> B[Initialize variables]
    B --> C[Print initialization message]
    C --> D[Reset registers]
    D --> E[Write filter flag to register]
    E --> F[Write CTS to RTS config]
    F --> G[Write BB RF delay]
    G --> H[Setup time schedule for queues]
    H --> I[Reset all slice sync]
    I --> J[Check mode]
    J --> K{Mode is XPU_TEST?}
    K -->|Yes| L[Print XPU_TEST mode message]
    K -->|No| M{Mode is XPU_NORMAL?}
    M -->|Yes| N[Print XPU_NORMAL mode message]
    M -->|No| O[Print error message and set error flag]
    N --> P[Write band channel to register]
    L --> P
    O --> P
    P --> Q[Write RSSI DB config]
    Q --> R[Write LBT threshold]
    R --> S[Write force idle misc]
    S --> T[Write CSMA debug]
    T --> U[Write send ACK wait top]
    U --> V[Write receive ACK count top0]
    V --> W[Write receive ACK count top1]
    W --> X[Write DIFS advance]
    X --> Y[Print final error message]
    Y --> Z[Return error code]
    Z --> AA[End hw_init function]

Function dev_probe(struct platform_device *pdev)

dev_probe: The function of dev_probe is to initialize the device and set up the necessary hardware configurations for the platform device.

parameters: The parameters of this Function. · pdev: A pointer to the platform_device structure representing the device being probed.

Code Description: The dev_probe function is a static function that is responsible for probing a platform device and initializing its hardware. It begins by retrieving the device node associated with the platform device from the device structure. If the device node is not null, it attempts to match the device with a predefined list of compatible devices using the of_match_node function. If a match is found, it logs a message indicating a successful match and sets an error variable to zero.

If no match is found, the function returns an error code. Upon a successful match, the function proceeds to initialize various hardware access functions by assigning them to the xpu_api structure. These functions include read and write operations for multiple registers associated with the device.

Next, the function requests and maps the I/O memory for the device using platform_get_resource and devm_ioremap_resource. If the mapping fails, it returns an error code. The function then logs details about the I/O memory, including its start and end addresses, name, flags, and description.

After successfully mapping the I/O memory, the function resets the TSF timer and reads the TSF runtime value multiple times with delays in between to log the results. Finally, it logs a success message and calls the hw_init function to perform additional hardware initialization, returning its result.

Note: It is important to ensure that the device node is correctly defined in the device tree for successful matching. Additionally, proper error handling should be implemented to manage potential failures during resource mapping and initialization.

Output Example: A possible return value of the function could be 0, indicating successful initialization, or a negative error code such as -EINVAL if the device node is not found or if resource mapping fails.

graph TD
    A[Start dev_probe function] --> B[Get device node from platform device]
    B --> C{Check if device node exists}
    C -- Yes --> D[Match device node with device IDs]
    D --> E{Is there a match?}
    E -- Yes --> F[Print match message]
    F --> G[Set error to 0]
    E -- No --> H[Set error to 1]
    C -- No --> H
    H --> I{Is error non-zero?}
    I -- Yes --> J[Return error]
    I -- No --> K[Initialize xpu_api function pointers]
    K --> L[Request and map I/O memory]
    L --> M{Is base address valid?}
    M -- No --> N[Return pointer error]
    M -- Yes --> O[Print I/O memory details]
    O --> P[Reset TSF timer]
    P --> Q[Read TSF runtime value low]
    Q --> R[Delay for 33ms]
    R --> S[Read TSF runtime value low]
    S --> T[Delay for 67ms]
    T --> U[Read TSF runtime value low]
    U --> V[Print TSF runtime values]
    V --> W[Print success message]
    W --> X[Call hw_init with XPU_NORMAL]
    X --> Y[Return from dev_probe function]
    J --> Y
    N --> Y

Function dev_remove(struct platform_device *pdev)

dev_remove: The function of dev_remove is to handle the removal of a device from the platform.

parameters: The parameters of this Function. · parameter1: struct platform_device *pdev - A pointer to the platform device structure that represents the device being removed.

Code Description: The dev_remove function is a static function that is invoked when a device is being removed from the platform. It takes a single parameter, pdev, which is a pointer to the platform_device structure representing the device to be removed.

Upon invocation, the function begins by printing a newline character to the console for formatting purposes. It then proceeds to log several pieces of information related to the device and the driver. The first log statement outputs the base address of the device, which is cast to a 32-bit unsigned integer for display. This is followed by logging the address of the xpu_driver_api_inst instance, also cast to a 32-bit unsigned integer. The third log statement outputs the address of the xpu_api, again cast to a 32-bit unsigned integer.

Finally, the function logs a success message indicating that the device removal process has completed successfully. The function concludes by returning 0, which typically indicates that the operation was successful.

Note: It is important to ensure that any resources allocated to the device are properly released before the device is removed. This function primarily focuses on logging and does not handle resource cleanup.

Output Example: A possible appearance of the code's return value could be:

0

graph TD
    A[Start dev_remove function] --> B[Print newline]
    B --> C[Print base_addr value]
    C --> D[Print xpu_driver_api_inst value]
    D --> E[Print xpu_api value]
    E --> F[Print success message]
    F --> G[Return 0]
    G --> H[End dev_remove function]