#include <errno.h>
#include <zephyr/device.h>
#include <syscalls/bbram.h>
 
Go to the source code of this file.
 | 
| int  | bbram_check_invalid (const struct device *dev) | 
|   | Check if BBRAM is invalid.  More...
  | 
|   | 
| int  | bbram_check_standby_power (const struct device *dev) | 
|   | Check for standby (Volt SBY) power failure.  More...
  | 
|   | 
| int  | bbram_check_power (const struct device *dev) | 
|   | Check for V CC1 power failure.  More...
  | 
|   | 
| int  | bbram_get_size (const struct device *dev, size_t *size) | 
|   | 
| int  | bbram_read (const struct device *dev, size_t offset, size_t size, uint8_t *data) | 
|   | 
| int  | bbram_write (const struct device *dev, size_t offset, size_t size, const uint8_t *data) | 
|   | 
| int  | bbram_emul_set_invalid (const struct device *dev, bool is_invalid) | 
|   | 
| int  | bbram_emul_set_standby_power_state (const struct device *dev, bool failure) | 
|   | 
| int  | bbram_emul_set_power_state (const struct device *dev, bool failure) | 
|   | 
◆ bbram_api_check_invalid
      
        
          | typedef int(* bbram_api_check_invalid) (const struct device *dev) | 
        
      
 
 
◆ bbram_api_check_power
      
        
          | typedef int(* bbram_api_check_power) (const struct device *dev) | 
        
      
 
 
◆ bbram_api_check_standby_power
      
        
          | typedef int(* bbram_api_check_standby_power) (const struct device *dev) | 
        
      
 
 
◆ bbram_api_get_size
      
        
          | typedef int(* bbram_api_get_size) (const struct device *dev, size_t *size) | 
        
      
 
 
◆ bbram_api_read
      
        
          | typedef int(* bbram_api_read) (const struct device *dev, size_t offset, size_t size, uint8_t *data) | 
        
      
 
API template to read from BBRAM.
- See also
 - bbram_read 
 
 
 
◆ bbram_api_write
      
        
          | typedef int(* bbram_api_write) (const struct device *dev, size_t offset, size_t size, const uint8_t *data) | 
        
      
 
 
◆ bbram_check_invalid()
      
        
          | int bbram_check_invalid  | 
          ( | 
          const struct device *  | 
          dev | ) | 
           | 
        
      
 
Check if BBRAM is invalid. 
Check if "Invalid Battery-Backed RAM" status is set then reset the status bit. This may occur as a result to low voltage at the VBAT pin.
- Parameters
 - 
  
  
 
- Returns
 - 0 if the Battery-Backed RAM data is valid, -EFAULT otherwise. 
 
 
 
◆ bbram_check_power()
      
        
          | int bbram_check_power  | 
          ( | 
          const struct device *  | 
          dev | ) | 
           | 
        
      
 
Check for V CC1 power failure. 
This will return an error if the V CC1 power domain is turned on after it was off and reset the status bit.
- Parameters
 - 
  
  
 
- Returns
 - 0 if the V CC1 power domain is in normal operation, -EFAULT otherwise. 
 
 
 
◆ bbram_check_standby_power()
      
        
          | int bbram_check_standby_power  | 
          ( | 
          const struct device *  | 
          dev | ) | 
           | 
        
      
 
Check for standby (Volt SBY) power failure. 
Check if the V standby power domain is turned on after it was off then reset the status bit.
- Parameters
 - 
  
  
 
- Returns
 - 0 if V SBY power domain is in normal operation. 
 
 
 
◆ bbram_emul_set_invalid()
      
        
          | int bbram_emul_set_invalid  | 
          ( | 
          const struct device *  | 
          dev,  | 
        
        
           | 
           | 
          bool  | 
          is_invalid  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ bbram_emul_set_power_state()
      
        
          | int bbram_emul_set_power_state  | 
          ( | 
          const struct device *  | 
          dev,  | 
        
        
           | 
           | 
          bool  | 
          failure  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ bbram_emul_set_standby_power_state()
      
        
          | int bbram_emul_set_standby_power_state  | 
          ( | 
          const struct device *  | 
          dev,  | 
        
        
           | 
           | 
          bool  | 
          failure  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
 
◆ bbram_get_size()
      
        
          | int bbram_get_size  | 
          ( | 
          const struct device *  | 
          dev,  | 
        
        
           | 
           | 
          size_t *  | 
          size  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Get the size of the BBRAM (in bytes).
- Parameters
 - 
  
    | dev | BBRAM device pointer.  | 
    | size | Pointer to write the size to.  | 
  
   
- Returns
 - 0 for success, -EFAULT otherwise. 
 
 
 
◆ bbram_read()
      
        
          | int bbram_read  | 
          ( | 
          const struct device *  | 
          dev,  | 
        
        
           | 
           | 
          size_t  | 
          offset,  | 
        
        
           | 
           | 
          size_t  | 
          size,  | 
        
        
           | 
           | 
          uint8_t *  | 
          data  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Read bytes from BBRAM.
- Parameters
 - 
  
    | dev | The BBRAM device pointer to read from.  | 
    | offset | The offset into the RAM address to start reading from.  | 
    | size | The number of bytes to read.  | 
    | data | The buffer to load the data into.  | 
  
   
- Returns
 - 0 on success, -EFAULT if the address range is out of bounds. 
 
 
 
◆ bbram_write()
      
        
          | int bbram_write  | 
          ( | 
          const struct device *  | 
          dev,  | 
        
        
           | 
           | 
          size_t  | 
          offset,  | 
        
        
           | 
           | 
          size_t  | 
          size,  | 
        
        
           | 
           | 
          const uint8_t *  | 
          data  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
Write bytes to BBRAM.
- Parameters
 - 
  
    | dev | The BBRAM device pointer to write to.  | 
    | offset | The offset into the RAM address to start writing to.  | 
    | size | The number of bytes to write.  | 
    | data | Pointer to the start of data to write.  | 
  
   
- Returns
 - 0 on success, -EFAULT if the address range is out of bounds.