fixes inline declarations of functions

This commit is contained in:
2025-04-13 18:13:31 +02:00
parent c73bc9e144
commit e1ea5a98d6
14 changed files with 1107 additions and 1733 deletions

View File

@@ -1,11 +1,11 @@
/*
* Copyright (c) 2023 - 2025 MINRES Technologies GmbH
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2025-02-28 17:25:03 UTC
* by peakrdl_mnrs version 1.2.9
*/
* Copyright (c) 2023 - 2025 MINRES Technologies GmbH
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2025-02-28 17:25:03 UTC
* by peakrdl_mnrs version 1.2.9
*/
#ifndef _BSP_CAMERA_H
#define _BSP_CAMERA_H
@@ -13,16 +13,16 @@
#include <stdint.h>
typedef struct {
volatile uint32_t PIXEL;
volatile uint32_t CONFIG;
volatile uint32_t CONFIG2;
volatile uint32_t DATA_SIZE;
volatile uint32_t START;
volatile uint32_t STATUS;
volatile uint32_t CAMERA_CLOCK_CTRL;
volatile uint32_t IE;
volatile uint32_t IP;
}camera_t;
volatile uint32_t PIXEL;
volatile uint32_t CONFIG;
volatile uint32_t CONFIG2;
volatile uint32_t DATA_SIZE;
volatile uint32_t START;
volatile uint32_t STATUS;
volatile uint32_t CAMERA_CLOCK_CTRL;
volatile uint32_t IE;
volatile uint32_t IP;
} camera_t;
#define CAMERA_PIXEL_OFFS 0
#define CAMERA_PIXEL_MASK 0xffffffff
@@ -124,214 +124,134 @@ typedef struct {
#define CAMERA_IP_FRAME_FINISHED_IRQ_PEND_MASK 0x1
#define CAMERA_IP_FRAME_FINISHED_IRQ_PEND(V) ((V & CAMERA_IP_FRAME_FINISHED_IRQ_PEND_MASK) << CAMERA_IP_FRAME_FINISHED_IRQ_PEND_OFFS)
//CAMERA_PIXEL
inline uint32_t get_camera_pixel(volatile camera_t* reg){
return (reg->PIXEL >> 0) & 0xffffffff;
}
inline void set_camera_pixel(volatile camera_t* reg, uint32_t value){
reg->PIXEL = (reg->PIXEL & ~(0xffffffffU << 0)) | (value << 0);
// CAMERA_PIXEL
static inline uint32_t get_camera_pixel(volatile camera_t* reg) { return (reg->PIXEL >> 0) & 0xffffffff; }
static inline void set_camera_pixel(volatile camera_t* reg, uint32_t value) {
reg->PIXEL = (reg->PIXEL & ~(0xffffffffU << 0)) | (value << 0);
}
//CAMERA_CONFIG
inline uint32_t get_camera_config(volatile camera_t* reg){
return reg->CONFIG;
// CAMERA_CONFIG
static inline uint32_t get_camera_config(volatile camera_t* reg) { return reg->CONFIG; }
static inline void set_camera_config(volatile camera_t* reg, uint32_t value) { reg->CONFIG = value; }
static inline uint32_t get_camera_config_output_curr(volatile camera_t* reg) { return (reg->CONFIG >> 0) & 0x3; }
static inline void set_camera_config_output_curr(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x3U << 0)) | (value << 0);
}
inline void set_camera_config(volatile camera_t* reg, uint32_t value){
reg->CONFIG = value;
static inline uint32_t get_camera_config_offset_ramp(volatile camera_t* reg) { return (reg->CONFIG >> 2) & 0x3; }
static inline void set_camera_config_offset_ramp(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x3U << 2)) | (value << 2);
}
inline uint32_t get_camera_config_output_curr(volatile camera_t* reg){
return (reg->CONFIG >> 0) & 0x3;
static inline uint32_t get_camera_config_ramp_gain(volatile camera_t* reg) { return (reg->CONFIG >> 4) & 0x3; }
static inline void set_camera_config_ramp_gain(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x3U << 4)) | (value << 4);
}
inline void set_camera_config_output_curr(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x3U << 0)) | (value << 0);
static inline uint32_t get_camera_config_vrst_pix(volatile camera_t* reg) { return (reg->CONFIG >> 6) & 0x3; }
static inline void set_camera_config_vrst_pix(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x3U << 6)) | (value << 6);
}
inline uint32_t get_camera_config_offset_ramp(volatile camera_t* reg){
return (reg->CONFIG >> 2) & 0x3;
static inline uint32_t get_camera_config_rows_in_reset(volatile camera_t* reg) { return (reg->CONFIG >> 8) & 0xff; }
static inline void set_camera_config_rows_in_reset(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0xffU << 8)) | (value << 8);
}
inline void set_camera_config_offset_ramp(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x3U << 2)) | (value << 2);
static inline uint32_t get_camera_config_high_speed(volatile camera_t* reg) { return (reg->CONFIG >> 16) & 0x1; }
static inline void set_camera_config_high_speed(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x1U << 16)) | (value << 16);
}
inline uint32_t get_camera_config_ramp_gain(volatile camera_t* reg){
return (reg->CONFIG >> 4) & 0x3;
static inline uint32_t get_camera_config_idle_mode(volatile camera_t* reg) { return (reg->CONFIG >> 17) & 0x1; }
static inline void set_camera_config_idle_mode(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x1U << 17)) | (value << 17);
}
inline void set_camera_config_ramp_gain(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x3U << 4)) | (value << 4);
static inline uint32_t get_camera_config_cvc_curr(volatile camera_t* reg) { return (reg->CONFIG >> 18) & 0x3; }
static inline void set_camera_config_cvc_curr(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x3U << 18)) | (value << 18);
}
inline uint32_t get_camera_config_vrst_pix(volatile camera_t* reg){
return (reg->CONFIG >> 6) & 0x3;
static inline uint32_t get_camera_config_vref(volatile camera_t* reg) { return (reg->CONFIG >> 20) & 0x3; }
static inline void set_camera_config_vref(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x3U << 20)) | (value << 20);
}
inline void set_camera_config_vrst_pix(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x3U << 6)) | (value << 6);
static inline uint32_t get_camera_config_mclk_mode(volatile camera_t* reg) { return (reg->CONFIG >> 22) & 0x3; }
static inline void set_camera_config_mclk_mode(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x3U << 22)) | (value << 22);
}
inline uint32_t get_camera_config_rows_in_reset(volatile camera_t* reg){
return (reg->CONFIG >> 8) & 0xff;
static inline uint32_t get_camera_config_output_mode(volatile camera_t* reg) { return (reg->CONFIG >> 24) & 0x1; }
static inline void set_camera_config_output_mode(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x1U << 24)) | (value << 24);
}
inline void set_camera_config_rows_in_reset(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0xffU << 8)) | (value << 8);
static inline uint32_t get_camera_config_cds_gain(volatile camera_t* reg) { return (reg->CONFIG >> 25) & 0x1; }
static inline void set_camera_config_cds_gain(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x1U << 25)) | (value << 25);
}
inline uint32_t get_camera_config_high_speed(volatile camera_t* reg){
return (reg->CONFIG >> 16) & 0x1;
static inline uint32_t get_camera_config_bias_curr_increase(volatile camera_t* reg) { return (reg->CONFIG >> 26) & 0x1; }
static inline void set_camera_config_bias_curr_increase(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x1U << 26)) | (value << 26);
}
inline void set_camera_config_high_speed(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x1U << 16)) | (value << 16);
}
inline uint32_t get_camera_config_idle_mode(volatile camera_t* reg){
return (reg->CONFIG >> 17) & 0x1;
}
inline void set_camera_config_idle_mode(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x1U << 17)) | (value << 17);
}
inline uint32_t get_camera_config_cvc_curr(volatile camera_t* reg){
return (reg->CONFIG >> 18) & 0x3;
}
inline void set_camera_config_cvc_curr(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x3U << 18)) | (value << 18);
}
inline uint32_t get_camera_config_vref(volatile camera_t* reg){
return (reg->CONFIG >> 20) & 0x3;
}
inline void set_camera_config_vref(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x3U << 20)) | (value << 20);
}
inline uint32_t get_camera_config_mclk_mode(volatile camera_t* reg){
return (reg->CONFIG >> 22) & 0x3;
}
inline void set_camera_config_mclk_mode(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x3U << 22)) | (value << 22);
}
inline uint32_t get_camera_config_output_mode(volatile camera_t* reg){
return (reg->CONFIG >> 24) & 0x1;
}
inline void set_camera_config_output_mode(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x1U << 24)) | (value << 24);
}
inline uint32_t get_camera_config_cds_gain(volatile camera_t* reg){
return (reg->CONFIG >> 25) & 0x1;
}
inline void set_camera_config_cds_gain(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x1U << 25)) | (value << 25);
}
inline uint32_t get_camera_config_bias_curr_increase(volatile camera_t* reg){
return (reg->CONFIG >> 26) & 0x1;
}
inline void set_camera_config_bias_curr_increase(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x1U << 26)) | (value << 26);
}
inline uint32_t get_camera_config_rows_delay(volatile camera_t* reg){
return (reg->CONFIG >> 27) & 0x1f;
}
inline void set_camera_config_rows_delay(volatile camera_t* reg, uint8_t value){
reg->CONFIG = (reg->CONFIG & ~(0x1fU << 27)) | (value << 27);
static inline uint32_t get_camera_config_rows_delay(volatile camera_t* reg) { return (reg->CONFIG >> 27) & 0x1f; }
static inline void set_camera_config_rows_delay(volatile camera_t* reg, uint8_t value) {
reg->CONFIG = (reg->CONFIG & ~(0x1fU << 27)) | (value << 27);
}
//CAMERA_CONFIG2
inline uint32_t get_camera_config2(volatile camera_t* reg){
return reg->CONFIG2;
// CAMERA_CONFIG2
static inline uint32_t get_camera_config2(volatile camera_t* reg) { return reg->CONFIG2; }
static inline void set_camera_config2(volatile camera_t* reg, uint32_t value) { reg->CONFIG2 = value; }
static inline uint32_t get_camera_config2_auto_idle(volatile camera_t* reg) { return (reg->CONFIG2 >> 0) & 0x1; }
static inline void set_camera_config2_auto_idle(volatile camera_t* reg, uint8_t value) {
reg->CONFIG2 = (reg->CONFIG2 & ~(0x1U << 0)) | (value << 0);
}
inline void set_camera_config2(volatile camera_t* reg, uint32_t value){
reg->CONFIG2 = value;
}
inline uint32_t get_camera_config2_auto_idle(volatile camera_t* reg){
return (reg->CONFIG2 >> 0) & 0x1;
}
inline void set_camera_config2_auto_idle(volatile camera_t* reg, uint8_t value){
reg->CONFIG2 = (reg->CONFIG2 & ~(0x1U << 0)) | (value << 0);
}
inline uint32_t get_camera_config2_auto_discard_frame(volatile camera_t* reg){
return (reg->CONFIG2 >> 1) & 0x1;
}
inline void set_camera_config2_auto_discard_frame(volatile camera_t* reg, uint8_t value){
reg->CONFIG2 = (reg->CONFIG2 & ~(0x1U << 1)) | (value << 1);
static inline uint32_t get_camera_config2_auto_discard_frame(volatile camera_t* reg) { return (reg->CONFIG2 >> 1) & 0x1; }
static inline void set_camera_config2_auto_discard_frame(volatile camera_t* reg, uint8_t value) {
reg->CONFIG2 = (reg->CONFIG2 & ~(0x1U << 1)) | (value << 1);
}
//CAMERA_DATA_SIZE
inline uint32_t get_camera_data_size(volatile camera_t* reg){
return reg->DATA_SIZE;
}
inline void set_camera_data_size(volatile camera_t* reg, uint32_t value){
reg->DATA_SIZE = value;
}
inline uint32_t get_camera_data_size_data_size(volatile camera_t* reg){
return (reg->DATA_SIZE >> 0) & 0x3;
}
inline void set_camera_data_size_data_size(volatile camera_t* reg, uint8_t value){
reg->DATA_SIZE = (reg->DATA_SIZE & ~(0x3U << 0)) | (value << 0);
// CAMERA_DATA_SIZE
static inline uint32_t get_camera_data_size(volatile camera_t* reg) { return reg->DATA_SIZE; }
static inline void set_camera_data_size(volatile camera_t* reg, uint32_t value) { reg->DATA_SIZE = value; }
static inline uint32_t get_camera_data_size_data_size(volatile camera_t* reg) { return (reg->DATA_SIZE >> 0) & 0x3; }
static inline void set_camera_data_size_data_size(volatile camera_t* reg, uint8_t value) {
reg->DATA_SIZE = (reg->DATA_SIZE & ~(0x3U << 0)) | (value << 0);
}
//CAMERA_START
inline uint32_t get_camera_start(volatile camera_t* reg){
return reg->START;
}
inline void set_camera_start(volatile camera_t* reg, uint32_t value){
reg->START = value;
}
inline uint32_t get_camera_start_start(volatile camera_t* reg){
return (reg->START >> 0) & 0x1;
}
inline void set_camera_start_start(volatile camera_t* reg, uint8_t value){
reg->START = (reg->START & ~(0x1U << 0)) | (value << 0);
// CAMERA_START
static inline uint32_t get_camera_start(volatile camera_t* reg) { return reg->START; }
static inline void set_camera_start(volatile camera_t* reg, uint32_t value) { reg->START = value; }
static inline uint32_t get_camera_start_start(volatile camera_t* reg) { return (reg->START >> 0) & 0x1; }
static inline void set_camera_start_start(volatile camera_t* reg, uint8_t value) {
reg->START = (reg->START & ~(0x1U << 0)) | (value << 0);
}
//CAMERA_STATUS
inline uint32_t get_camera_status(volatile camera_t* reg){
return reg->STATUS;
}
inline uint32_t get_camera_status_pixel_avail(volatile camera_t* reg){
return (reg->STATUS >> 0) & 0x1;
// CAMERA_STATUS
static inline uint32_t get_camera_status(volatile camera_t* reg) { return reg->STATUS; }
static inline uint32_t get_camera_status_pixel_avail(volatile camera_t* reg) { return (reg->STATUS >> 0) & 0x1; }
// CAMERA_CAMERA_CLOCK_CTRL
static inline uint32_t get_camera_camera_clock_ctrl(volatile camera_t* reg) { return reg->CAMERA_CLOCK_CTRL; }
static inline void set_camera_camera_clock_ctrl(volatile camera_t* reg, uint32_t value) { reg->CAMERA_CLOCK_CTRL = value; }
static inline uint32_t get_camera_camera_clock_ctrl_divider(volatile camera_t* reg) { return (reg->CAMERA_CLOCK_CTRL >> 0) & 0xfff; }
static inline void set_camera_camera_clock_ctrl_divider(volatile camera_t* reg, uint16_t value) {
reg->CAMERA_CLOCK_CTRL = (reg->CAMERA_CLOCK_CTRL & ~(0xfffU << 0)) | (value << 0);
}
//CAMERA_CAMERA_CLOCK_CTRL
inline uint32_t get_camera_camera_clock_ctrl(volatile camera_t* reg){
return reg->CAMERA_CLOCK_CTRL;
// CAMERA_IE
static inline uint32_t get_camera_ie(volatile camera_t* reg) { return reg->IE; }
static inline void set_camera_ie(volatile camera_t* reg, uint32_t value) { reg->IE = value; }
static inline uint32_t get_camera_ie_en_pixel_avail(volatile camera_t* reg) { return (reg->IE >> 0) & 0x1; }
static inline void set_camera_ie_en_pixel_avail(volatile camera_t* reg, uint8_t value) {
reg->IE = (reg->IE & ~(0x1U << 0)) | (value << 0);
}
inline void set_camera_camera_clock_ctrl(volatile camera_t* reg, uint32_t value){
reg->CAMERA_CLOCK_CTRL = value;
}
inline uint32_t get_camera_camera_clock_ctrl_divider(volatile camera_t* reg){
return (reg->CAMERA_CLOCK_CTRL >> 0) & 0xfff;
}
inline void set_camera_camera_clock_ctrl_divider(volatile camera_t* reg, uint16_t value){
reg->CAMERA_CLOCK_CTRL = (reg->CAMERA_CLOCK_CTRL & ~(0xfffU << 0)) | (value << 0);
static inline uint32_t get_camera_ie_en_frame_finished(volatile camera_t* reg) { return (reg->IE >> 1) & 0x1; }
static inline void set_camera_ie_en_frame_finished(volatile camera_t* reg, uint8_t value) {
reg->IE = (reg->IE & ~(0x1U << 1)) | (value << 1);
}
//CAMERA_IE
inline uint32_t get_camera_ie(volatile camera_t* reg){
return reg->IE;
// CAMERA_IP
static inline uint32_t get_camera_ip(volatile camera_t* reg) { return reg->IP; }
static inline void set_camera_ip(volatile camera_t* reg, uint32_t value) { reg->IP = value; }
static inline uint32_t get_camera_ip_pixel_avail_irq_pend(volatile camera_t* reg) { return (reg->IP >> 0) & 0x1; }
static inline void set_camera_ip_pixel_avail_irq_pend(volatile camera_t* reg, uint8_t value) {
reg->IP = (reg->IP & ~(0x1U << 0)) | (value << 0);
}
inline void set_camera_ie(volatile camera_t* reg, uint32_t value){
reg->IE = value;
}
inline uint32_t get_camera_ie_en_pixel_avail(volatile camera_t* reg){
return (reg->IE >> 0) & 0x1;
}
inline void set_camera_ie_en_pixel_avail(volatile camera_t* reg, uint8_t value){
reg->IE = (reg->IE & ~(0x1U << 0)) | (value << 0);
}
inline uint32_t get_camera_ie_en_frame_finished(volatile camera_t* reg){
return (reg->IE >> 1) & 0x1;
}
inline void set_camera_ie_en_frame_finished(volatile camera_t* reg, uint8_t value){
reg->IE = (reg->IE & ~(0x1U << 1)) | (value << 1);
}
//CAMERA_IP
inline uint32_t get_camera_ip(volatile camera_t* reg){
return reg->IP;
}
inline void set_camera_ip(volatile camera_t* reg, uint32_t value){
reg->IP = value;
}
inline uint32_t get_camera_ip_pixel_avail_irq_pend(volatile camera_t* reg){
return (reg->IP >> 0) & 0x1;
}
inline void set_camera_ip_pixel_avail_irq_pend(volatile camera_t* reg, uint8_t value){
reg->IP = (reg->IP & ~(0x1U << 0)) | (value << 0);
}
inline uint32_t get_camera_ip_frame_finished_irq_pend(volatile camera_t* reg){
return (reg->IP >> 1) & 0x1;
}
inline void set_camera_ip_frame_finished_irq_pend(volatile camera_t* reg, uint8_t value){
reg->IP = (reg->IP & ~(0x1U << 1)) | (value << 1);
static inline uint32_t get_camera_ip_frame_finished_irq_pend(volatile camera_t* reg) { return (reg->IP >> 1) & 0x1; }
static inline void set_camera_ip_frame_finished_irq_pend(volatile camera_t* reg, uint8_t value) {
reg->IP = (reg->IP & ~(0x1U << 1)) | (value << 1);
}
#endif /* _BSP_CAMERA_H */