adapts to updated uart register layout
This commit is contained in:
@ -1,11 +1,11 @@
|
||||
/*
|
||||
* Copyright (c) 2023 - 2024 MINRES Technologies GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Generated at 2024-12-26 18:07:07 UTC
|
||||
* by peakrdl_mnrs version 1.2.9
|
||||
*/
|
||||
* Copyright (c) 2023 - 2025 MINRES Technologies GmbH
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*
|
||||
* Generated at 2025-07-01 11:20:43 UTC
|
||||
* by peakrdl_mnrs version 1.2.9
|
||||
*/
|
||||
|
||||
#ifndef _BSP_TIMERCOUNTER_H
|
||||
#define _BSP_TIMERCOUNTER_H
|
||||
@ -13,14 +13,14 @@
|
||||
#include <stdint.h>
|
||||
|
||||
typedef struct {
|
||||
volatile uint32_t PRESCALER;
|
||||
volatile uint32_t T0_CTRL;
|
||||
volatile uint32_t T0_OVERFLOW;
|
||||
volatile uint32_t T0_COUNTER;
|
||||
volatile uint32_t T1_CTRL;
|
||||
volatile uint32_t T1_OVERFLOW;
|
||||
volatile uint32_t T1_COUNTER;
|
||||
} timercounter_t;
|
||||
volatile uint32_t PRESCALER;
|
||||
volatile uint32_t T0_CTRL;
|
||||
volatile uint32_t T0_OVERFLOW;
|
||||
volatile uint32_t T0_COUNTER;
|
||||
volatile uint32_t T1_CTRL;
|
||||
volatile uint32_t T1_OVERFLOW;
|
||||
volatile uint32_t T1_COUNTER;
|
||||
}timercounter_t;
|
||||
|
||||
#define TIMERCOUNTER_PRESCALER_OFFS 0
|
||||
#define TIMERCOUNTER_PRESCALER_MASK 0xffff
|
||||
@ -58,54 +58,84 @@ typedef struct {
|
||||
#define TIMERCOUNTER_T1_COUNTER_MASK 0xffffffff
|
||||
#define TIMERCOUNTER_T1_COUNTER(V) ((V & TIMERCOUNTER_T1_COUNTER_MASK) << TIMERCOUNTER_T1_COUNTER_OFFS)
|
||||
|
||||
// TIMERCOUNTER_PRESCALER
|
||||
static inline uint32_t get_timercounter_prescaler(volatile timercounter_t* reg) { return reg->PRESCALER; }
|
||||
static inline void set_timercounter_prescaler(volatile timercounter_t* reg, uint32_t value) { reg->PRESCALER = value; }
|
||||
static inline uint32_t get_timercounter_prescaler_limit(volatile timercounter_t* reg) { return (reg->PRESCALER >> 0) & 0xffff; }
|
||||
static inline void set_timercounter_prescaler_limit(volatile timercounter_t* reg, uint16_t value) {
|
||||
reg->PRESCALER = (reg->PRESCALER & ~(0xffffU << 0)) | (value << 0);
|
||||
//TIMERCOUNTER_PRESCALER
|
||||
inline uint32_t get_timercounter_prescaler(volatile timercounter_t* reg){
|
||||
return reg->PRESCALER;
|
||||
}
|
||||
inline void set_timercounter_prescaler(volatile timercounter_t* reg, uint32_t value){
|
||||
reg->PRESCALER = value;
|
||||
}
|
||||
inline uint32_t get_timercounter_prescaler_limit(volatile timercounter_t* reg){
|
||||
return (reg->PRESCALER >> 0) & 0xffff;
|
||||
}
|
||||
inline void set_timercounter_prescaler_limit(volatile timercounter_t* reg, uint16_t value){
|
||||
reg->PRESCALER = (reg->PRESCALER & ~(0xffffU << 0)) | (value << 0);
|
||||
}
|
||||
|
||||
// TIMERCOUNTER_T0_CTRL
|
||||
static inline uint32_t get_timercounter_t0_ctrl(volatile timercounter_t* reg) { return reg->T0_CTRL; }
|
||||
static inline void set_timercounter_t0_ctrl(volatile timercounter_t* reg, uint32_t value) { reg->T0_CTRL = value; }
|
||||
static inline uint32_t get_timercounter_t0_ctrl_enable(volatile timercounter_t* reg) { return (reg->T0_CTRL >> 0) & 0x7; }
|
||||
static inline void set_timercounter_t0_ctrl_enable(volatile timercounter_t* reg, uint8_t value) {
|
||||
reg->T0_CTRL = (reg->T0_CTRL & ~(0x7U << 0)) | (value << 0);
|
||||
//TIMERCOUNTER_T0_CTRL
|
||||
inline uint32_t get_timercounter_t0_ctrl(volatile timercounter_t* reg){
|
||||
return reg->T0_CTRL;
|
||||
}
|
||||
static inline uint32_t get_timercounter_t0_ctrl_clear(volatile timercounter_t* reg) { return (reg->T0_CTRL >> 3) & 0x3; }
|
||||
static inline void set_timercounter_t0_ctrl_clear(volatile timercounter_t* reg, uint8_t value) {
|
||||
reg->T0_CTRL = (reg->T0_CTRL & ~(0x3U << 3)) | (value << 3);
|
||||
inline void set_timercounter_t0_ctrl(volatile timercounter_t* reg, uint32_t value){
|
||||
reg->T0_CTRL = value;
|
||||
}
|
||||
inline uint32_t get_timercounter_t0_ctrl_enable(volatile timercounter_t* reg){
|
||||
return (reg->T0_CTRL >> 0) & 0x7;
|
||||
}
|
||||
inline void set_timercounter_t0_ctrl_enable(volatile timercounter_t* reg, uint8_t value){
|
||||
reg->T0_CTRL = (reg->T0_CTRL & ~(0x7U << 0)) | (value << 0);
|
||||
}
|
||||
inline uint32_t get_timercounter_t0_ctrl_clear(volatile timercounter_t* reg){
|
||||
return (reg->T0_CTRL >> 3) & 0x3;
|
||||
}
|
||||
inline void set_timercounter_t0_ctrl_clear(volatile timercounter_t* reg, uint8_t value){
|
||||
reg->T0_CTRL = (reg->T0_CTRL & ~(0x3U << 3)) | (value << 3);
|
||||
}
|
||||
|
||||
// TIMERCOUNTER_T0_OVERFLOW
|
||||
static inline uint32_t get_timercounter_t0_overflow(volatile timercounter_t* reg) { return (reg->T0_OVERFLOW >> 0) & 0xffffffff; }
|
||||
static inline void set_timercounter_t0_overflow(volatile timercounter_t* reg, uint32_t value) {
|
||||
reg->T0_OVERFLOW = (reg->T0_OVERFLOW & ~(0xffffffffU << 0)) | (value << 0);
|
||||
//TIMERCOUNTER_T0_OVERFLOW
|
||||
inline uint32_t get_timercounter_t0_overflow(volatile timercounter_t* reg){
|
||||
return (reg->T0_OVERFLOW >> 0) & 0xffffffff;
|
||||
}
|
||||
inline void set_timercounter_t0_overflow(volatile timercounter_t* reg, uint32_t value){
|
||||
reg->T0_OVERFLOW = (reg->T0_OVERFLOW & ~(0xffffffffU << 0)) | (value << 0);
|
||||
}
|
||||
|
||||
// TIMERCOUNTER_T0_COUNTER
|
||||
static inline uint32_t get_timercounter_t0_counter(volatile timercounter_t* reg) { return (reg->T0_COUNTER >> 0) & 0xffffffff; }
|
||||
|
||||
// TIMERCOUNTER_T1_CTRL
|
||||
static inline uint32_t get_timercounter_t1_ctrl(volatile timercounter_t* reg) { return reg->T1_CTRL; }
|
||||
static inline void set_timercounter_t1_ctrl(volatile timercounter_t* reg, uint32_t value) { reg->T1_CTRL = value; }
|
||||
static inline uint32_t get_timercounter_t1_ctrl_enable(volatile timercounter_t* reg) { return (reg->T1_CTRL >> 0) & 0x7; }
|
||||
static inline void set_timercounter_t1_ctrl_enable(volatile timercounter_t* reg, uint8_t value) {
|
||||
reg->T1_CTRL = (reg->T1_CTRL & ~(0x7U << 0)) | (value << 0);
|
||||
}
|
||||
static inline uint32_t get_timercounter_t1_ctrl_clear(volatile timercounter_t* reg) { return (reg->T1_CTRL >> 3) & 0x3; }
|
||||
static inline void set_timercounter_t1_ctrl_clear(volatile timercounter_t* reg, uint8_t value) {
|
||||
reg->T1_CTRL = (reg->T1_CTRL & ~(0x3U << 3)) | (value << 3);
|
||||
//TIMERCOUNTER_T0_COUNTER
|
||||
inline uint32_t get_timercounter_t0_counter(volatile timercounter_t* reg){
|
||||
return (reg->T0_COUNTER >> 0) & 0xffffffff;
|
||||
}
|
||||
|
||||
// TIMERCOUNTER_T1_OVERFLOW
|
||||
static inline uint32_t get_timercounter_t1_overflow(volatile timercounter_t* reg) { return (reg->T1_OVERFLOW >> 0) & 0xffffffff; }
|
||||
static inline void set_timercounter_t1_overflow(volatile timercounter_t* reg, uint32_t value) {
|
||||
reg->T1_OVERFLOW = (reg->T1_OVERFLOW & ~(0xffffffffU << 0)) | (value << 0);
|
||||
//TIMERCOUNTER_T1_CTRL
|
||||
inline uint32_t get_timercounter_t1_ctrl(volatile timercounter_t* reg){
|
||||
return reg->T1_CTRL;
|
||||
}
|
||||
inline void set_timercounter_t1_ctrl(volatile timercounter_t* reg, uint32_t value){
|
||||
reg->T1_CTRL = value;
|
||||
}
|
||||
inline uint32_t get_timercounter_t1_ctrl_enable(volatile timercounter_t* reg){
|
||||
return (reg->T1_CTRL >> 0) & 0x7;
|
||||
}
|
||||
inline void set_timercounter_t1_ctrl_enable(volatile timercounter_t* reg, uint8_t value){
|
||||
reg->T1_CTRL = (reg->T1_CTRL & ~(0x7U << 0)) | (value << 0);
|
||||
}
|
||||
inline uint32_t get_timercounter_t1_ctrl_clear(volatile timercounter_t* reg){
|
||||
return (reg->T1_CTRL >> 3) & 0x3;
|
||||
}
|
||||
inline void set_timercounter_t1_ctrl_clear(volatile timercounter_t* reg, uint8_t value){
|
||||
reg->T1_CTRL = (reg->T1_CTRL & ~(0x3U << 3)) | (value << 3);
|
||||
}
|
||||
|
||||
// TIMERCOUNTER_T1_COUNTER
|
||||
static inline uint32_t get_timercounter_t1_counter(volatile timercounter_t* reg) { return (reg->T1_COUNTER >> 0) & 0xffffffff; }
|
||||
//TIMERCOUNTER_T1_OVERFLOW
|
||||
inline uint32_t get_timercounter_t1_overflow(volatile timercounter_t* reg){
|
||||
return (reg->T1_OVERFLOW >> 0) & 0xffffffff;
|
||||
}
|
||||
inline void set_timercounter_t1_overflow(volatile timercounter_t* reg, uint32_t value){
|
||||
reg->T1_OVERFLOW = (reg->T1_OVERFLOW & ~(0xffffffffU << 0)) | (value << 0);
|
||||
}
|
||||
|
||||
//TIMERCOUNTER_T1_COUNTER
|
||||
inline uint32_t get_timercounter_t1_counter(volatile timercounter_t* reg){
|
||||
return (reg->T1_COUNTER >> 0) & 0xffffffff;
|
||||
}
|
||||
|
||||
#endif /* _BSP_TIMERCOUNTER_H */
|
Reference in New Issue
Block a user