| /* | |
| * 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_ |