MNRS-BM-BSP/include/ehrenberg/devices/gen/GpioModule.h

41 lines
1.1 KiB
C
Raw Normal View History

2024-02-22 17:09:35 +01:00
/*
* Copyright (c) 2023 - 2024 MINRES Technologies GmbH
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-04-22 11:11:53 UTC
2024-02-22 17:09:35 +01:00
* by peakrdl_mnrs version 1.2.2
*/
#ifndef _BSP_GPIOMODULE_H
#define _BSP_GPIOMODULE_H
2024-02-22 17:09:35 +01:00
#include <stdint.h>
typedef struct __attribute((__packed__)) {
volatile uint32_t VALUE;
volatile uint32_t WRITE;
volatile uint32_t WRITEENABLE;
}gpiomodule_t;
2024-02-22 17:09:35 +01:00
static inline uint32_t get_gpiomodule_value(volatile gpiomodule_t *reg){
2024-02-22 17:09:35 +01:00
return (reg->VALUE >> 0) & 0xffffffff;
}
static inline uint32_t get_gpiomodule_write(volatile gpiomodule_t *reg){
2024-02-22 17:09:35 +01:00
return (reg->WRITE >> 0) & 0xffffffff;
}
static inline void set_gpiomodule_write(volatile gpiomodule_t *reg, uint32_t value){
2024-02-22 17:09:35 +01:00
reg->WRITE = (reg->WRITE & ~(0xffffffffU << 0)) | (value << 0);
}
static inline uint32_t get_gpiomodule_writeEnable(volatile gpiomodule_t *reg){
2024-02-22 17:09:35 +01:00
return (reg->WRITEENABLE >> 0) & 0xffffffff;
}
static inline void set_gpiomodule_writeEnable(volatile gpiomodule_t *reg, uint32_t value){
2024-02-22 17:09:35 +01:00
reg->WRITEENABLE = (reg->WRITEENABLE & ~(0xffffffffU << 0)) | (value << 0);
}
#endif /* _BSP_GPIOMODULE_H */