/*
 * Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef SW_DEVICE_LIB_CAMERA_HM01B0_H_
#define SW_DEVICE_LIB_CAMERA_HM01B0_H_

#include "hw/top_matcha/sw/autogen/top_matcha.h"
#include "sw/device/lib/dif/dif_base.h"
#include "sw/device/lib/dif/dif_rv_plic.h"

#if defined(__cplusplus)
extern "C" {
#endif

typedef enum camera_hm01b0_test_pattern {
  kCameraHm01b0TestPatternNone = 0x0,
  kCameraHm01b0TestPatternColorBar = 0x1,
  kCameraHm01b0TestPatternWalkingOnes = 0x11,
} camera_hm01b0_test_pattern_t;

typedef enum camera_hm01b0_resolution {
  kCameraHm01b0Resolution324x324,
  kCameraHm01b0Resolution320x240,
} camera_hm01b0_resolution_t;

typedef enum camera_hm01b0_streaming_mode {
  kCameraHm01b0StreamingModeStandby = 0x0,
  kCameraHm01b0StreamingModeStream = 0x1,
  kCameraHm01b0StreamingModeCounter = 0x3,
  kCameraHm01b0StreamingModeTrigger = 0x5,
} camera_hm01b0_streaming_mode_t;

typedef enum camera_hm01b0_frame_rate {
  kCameraHm01b0FrameRate1Fps,
  kCameraHm01b0FrameRate30Fps,
  kCameraHm01b0FrameRate60Fps,
} camera_hm01b0_frame_rate_t;

dif_result_t camera_hm01b0_init(void);
dif_result_t camera_hm01b0_set_default_registers(
    camera_hm01b0_resolution_t resolution,
    camera_hm01b0_frame_rate_t frame_rate);
dif_result_t camera_hm01b0_set_test_pattern(
    camera_hm01b0_test_pattern_t pattern);
dif_result_t camera_hm01b0_irq_init(const dif_rv_plic_t* plic,
                                    const top_matcha_plic_target_smc_t target);
dif_result_t camera_hm01b0_irq_handler(dif_rv_plic_irq_id_t interrupt_id);
dif_result_t camera_hm01b0_validate_test_pattern(
    const uint8_t* addr, camera_hm01b0_test_pattern_t pattern,
    camera_hm01b0_resolution_t resolution);
dif_result_t camera_hm01b0_set_streaming_mode(
    camera_hm01b0_streaming_mode_t mode);
dif_result_t camera_hm01b0_set_frame_count(uint16_t count);

#if defined(__cplusplus)
}
#endif

#endif  // SW_DEVICE_LIB_CAMERA_HM01B0_H_
