ASCII Serial Com
Serial communication library between computers, microcontrollers, FPGAs, etc. Uses only ASCII. Not the most efficient protocol, but meant to be easy to read
Loading...
Searching...
No Matches
Macros | Functions | Variables
neorv32_asc_gpio.c File Reference

Test that ASC can communicate with GPIOs. More...

#include <stdbool.h>
#include <neorv32.h>
#include "asc_exception.h"
#include "ascii_serial_com.h"
#include "ascii_serial_com_device.h"
#include "ascii_serial_com_register_pointers.h"
#include "circular_buffer.h"
#include "millisec_timer.h"
Include dependency graph for neorv32_asc_gpio.c:

Go to the source code of this file.

Macros

#define BAUD_RATE   19200
 
#define UART1_TX_BUFFER_FULL    ((NEORV32_UART1.CTRL & (1 << UART_CTRL_TX_FULL)) != 0)
 
#define nRegs   4
 

Functions

 DECLARE_ASC_DEVICE_W_REGISTER_POINTERS () uint8_t tmp_byte
 
int main ()
 

Variables

CEXCEPTION_T e
 
uint16_t nExceptions
 
volatile REGTYPE * register_map [nRegs]
 Register Map.
 
REGTYPE register_write_masks [nRegs]
 Write masks for register_map.
 
int rx_status
 

Detailed Description

Test that ASC can communicate with GPIOs.

Register map is documented at register_map

Definition in file neorv32_asc_gpio.c.

Macro Definition Documentation

◆ BAUD_RATE

#define BAUD_RATE   19200

Definition at line 27 of file neorv32_asc_gpio.c.

◆ nRegs

#define nRegs   4

Definition at line 34 of file neorv32_asc_gpio.c.

◆ UART1_TX_BUFFER_FULL

#define UART1_TX_BUFFER_FULL    ((NEORV32_UART1.CTRL & (1 << UART_CTRL_TX_FULL)) != 0)

Definition at line 28 of file neorv32_asc_gpio.c.

Function Documentation

◆ DECLARE_ASC_DEVICE_W_REGISTER_POINTERS()

DECLARE_ASC_DEVICE_W_REGISTER_POINTERS ( )

Definition at line 155 of file stm32f091nucleo64_adc_streaming.c.

◆ main()

int main ( void )

Definition at line 74 of file neorv32_asc_gpio.c.

Variable Documentation

◆ e

CEXCEPTION_T e

Definition at line 31 of file neorv32_asc_gpio.c.

◆ nExceptions

uint16_t nExceptions

Definition at line 32 of file neorv32_asc_gpio.c.

◆ register_map

volatile REGTYPE* register_map[nRegs]
Initial value:
= {
&NEORV32_GPIO.OUTPUT_LO,
&NEORV32_GPIO.OUTPUT_HI,
&NEORV32_GPIO.INPUT_LO,
&NEORV32_GPIO.INPUT_HI,
}

Register Map.

Register Map

Register Number Description r/w
0 GPIO output (lower 32 bits) r/w
1 GPIO output (upper 32 bits) r/w
2 GPIO input (lower 32 bits) r
3 GPIO input (upper 32 bits) r
See also
register_write_masks

Definition at line 50 of file neorv32_asc_gpio.c.

◆ register_write_masks

REGTYPE register_write_masks[nRegs]
Initial value:
= {
0xFFFFFFFF,
0xFFFFFFFF,
0,
0,
}

Write masks for register_map.

These define whether the given register in register_map is writable or not

Definition at line 62 of file neorv32_asc_gpio.c.

◆ rx_status

int rx_status

Definition at line 72 of file neorv32_asc_gpio.c.