iPXE
Data Structures | Functions
mlx_blink_leds.h File Reference
#include "../../mlx_lib/mlx_reg_access/mlx_reg_access.h"
#include "../../include/public/mlx_utils.h"

Go to the source code of this file.

Data Structures

struct  mlx_led_control
 

Functions

 FILE_LICENCE (GPL2_OR_LATER)
 
mlx_status mlx_blink_leds (IN mlx_utils *utils, IN mlx_uint16 secs)
 

Function Documentation

◆ FILE_LICENCE()

FILE_LICENCE ( GPL2_OR_LATER  )

◆ mlx_blink_leds()

mlx_status mlx_blink_leds ( IN mlx_utils utils,
IN mlx_uint16  secs 
)

Definition at line 27 of file mlx_blink_leds.c.

31 {
33  struct mlx_led_control led_control;
34  mlx_uint32 reg_status;
35 
36  if (utils == NULL ) {
38  goto bad_param;
39  }
40  mlx_memory_set(utils, &led_control, 0, sizeof(led_control));
41  led_control.beacon_duration = secs;
42  status = mlx_reg_access(utils, REG_ID_MLCR, REG_ACCESS_WRITE, &led_control, sizeof(led_control),
43  &reg_status);
44  MLX_CHECK_STATUS(utils, status, reg_err, "mlx_reg_access failed ");
45  if (reg_status != 0) {
46  MLX_DEBUG_ERROR(utils,"mlx_reg_access failed with status = %d\n", reg_status);
48  goto reg_err;
49  }
50 reg_err:
51 bad_param:
52  return status;
53 }
#define MLX_INVALID_PARAMETER
uint8_t status
Status.
Definition: ena.h:16
uint32_t mlx_uint32
mlx_status mlx_memory_set(IN mlx_utils *utils, IN mlx_void *block, IN mlx_int32 value, IN mlx_size size)
Definition: mlx_memory.c:171
#define MLX_SUCCESS
#define REG_ID_MLCR
#define MLX_FAILED
#define MLX_DEBUG_ERROR(...)
Definition: mlx_logging.h:29
int mlx_status
mlx_status mlx_reg_access(IN mlx_utils *utils, IN mlx_uint16 reg_id, IN REG_ACCESS_OPT reg_opt, IN OUT mlx_void *reg_data, IN mlx_size reg_size, OUT mlx_uint32 *reg_status)
#define MLX_CHECK_STATUS(id, status, label, message)
Definition: mlx_bail.h:37
#define NULL
NULL pointer (VOID *)
Definition: Base.h:362

References mlx_led_control::beacon_duration, MLX_CHECK_STATUS, MLX_DEBUG_ERROR, MLX_FAILED, MLX_INVALID_PARAMETER, mlx_memory_set(), mlx_reg_access(), MLX_SUCCESS, NULL, REG_ACCESS_WRITE, REG_ID_MLCR, and status.