updates ehrenberg devices and BSP

This commit is contained in:
2024-06-10 10:13:07 +02:00
parent c94eb7c61a
commit 231366cc94
13 changed files with 200 additions and 20 deletions

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-05-30 18:25:57 UTC
* Generated at 2024-06-08 13:20:02 UTC
* by peakrdl_mnrs version 1.2.5
*/

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-05-30 18:25:57 UTC
* Generated at 2024-06-08 13:20:02 UTC
* by peakrdl_mnrs version 1.2.5
*/

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-05-30 18:25:57 UTC
* Generated at 2024-06-08 13:20:02 UTC
* by peakrdl_mnrs version 1.2.5
*/

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-05-30 18:25:57 UTC
* Generated at 2024-06-08 13:20:02 UTC
* by peakrdl_mnrs version 1.2.5
*/

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-05-30 18:25:57 UTC
* Generated at 2024-06-08 13:20:02 UTC
* by peakrdl_mnrs version 1.2.5
*/

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-05-30 18:25:57 UTC
* Generated at 2024-06-08 13:20:02 UTC
* by peakrdl_mnrs version 1.2.5
*/

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-05-30 18:25:57 UTC
* Generated at 2024-06-08 13:20:02 UTC
* by peakrdl_mnrs version 1.2.5
*/

View File

@ -3,7 +3,7 @@
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-05-30 18:25:57 UTC
* Generated at 2024-06-08 13:20:02 UTC
* by peakrdl_mnrs version 1.2.5
*/
@ -32,6 +32,10 @@ typedef struct __attribute((__packed__)) {
#define UART_RX_TX_REG_TX_FREE_MASK 0x1
#define UART_RX_TX_REG_TX_FREE(V) ((V & UART_RX_TX_REG_TX_FREE_MASK) << UART_RX_TX_REG_TX_FREE_OFFS)
#define UART_RX_TX_REG_TX_EMPTY_OFFS 16
#define UART_RX_TX_REG_TX_EMPTY_MASK 0x1
#define UART_RX_TX_REG_TX_EMPTY(V) ((V & UART_RX_TX_REG_TX_EMPTY_MASK) << UART_RX_TX_REG_TX_EMPTY_OFFS)
#define UART_INT_CTRL_REG_WRITE_INTR_ENABLE_OFFS 0
#define UART_INT_CTRL_REG_WRITE_INTR_ENABLE_MASK 0x1
#define UART_INT_CTRL_REG_WRITE_INTR_ENABLE(V) ((V & UART_INT_CTRL_REG_WRITE_INTR_ENABLE_MASK) << UART_INT_CTRL_REG_WRITE_INTR_ENABLE_OFFS)
@ -115,6 +119,9 @@ inline uint32_t get_uart_rx_tx_reg_rx_avail(volatile uart_t* reg){
inline uint32_t get_uart_rx_tx_reg_tx_free(volatile uart_t* reg){
return (reg->RX_TX_REG >> 15) & 0x1;
}
inline uint32_t get_uart_rx_tx_reg_tx_empty(volatile uart_t* reg){
return (reg->RX_TX_REG >> 16) & 0x1;
}
//UART_INT_CTRL_REG
inline uint32_t get_uart_int_ctrl_reg(volatile uart_t* reg){

View File

@ -4,7 +4,7 @@
#include <stdint.h>
#include "gen/gpio.h"
inline void gpio_init(gpio_t* reg) {
inline void gpio_init(volatile gpio_t* reg) {
set_gpio_write(reg, 0);
set_gpio_writeEnable(reg, 0);
}

View File

@ -4,20 +4,24 @@
#include <stdint.h>
#include "gen/uart.h"
static inline uint32_t uart_get_tx_free(volatile uart_t *reg){
return (reg->STATUS_REG >> 16) & 0xFF;
static inline uint32_t uart_get_tx_free(volatile uart_t* reg){
return get_uart_rx_tx_reg_tx_free(reg);
}
static inline uint32_t uart_get_rx_avail(volatile uart_t *reg){
return reg->STATUS_REG >> 24;
static inline uint32_t uart_get_tx_empty(volatile uart_t* reg){
return get_uart_rx_tx_reg_tx_empty(reg);
}
static inline void uart_write(volatile uart_t *reg, uint8_t data){
static inline uint32_t uart_get_rx_avail(volatile uart_t* reg){
return get_uart_rx_tx_reg_rx_avail(reg);
}
static inline void uart_write(volatile uart_t* reg, uint8_t data){
while(get_uart_rx_tx_reg_tx_free(reg) == 0);
set_uart_rx_tx_reg_data(reg, data);
}
static inline inline uint8_t uart_read(volatile uart_t *reg){
static inline inline uint8_t uart_read(volatile uart_t* reg){
uint32_t res = get_uart_rx_tx_reg_data(reg);
while((res&0x10000) == 0) res = get_uart_rx_tx_reg_data(reg);
return res;