9#include <avr/interrupt.h>
11#include <util/atomic.h>
13#define F_CPU 16000000L
15#define MYUBRR (F_CPU / 16 / BAUD - 1)
18char dataBuffer[MAXDATALEN];
20volatile REGTYPE *regPtrs[nRegs] = {&PORTB, &PORTC, &PORTD};
22REGTYPE masks[nRegs] = {
32 .state_rw = ®_pointers_state};
36#define extraInputBuffer_size 64
37uint8_t extraInputBuffer_raw[extraInputBuffer_size];
58 extraInputBuffer_raw);
60 Catch(e) {
return e; }
74 ATOMIC_BLOCK(ATOMIC_FORCEON) {
84 Catch(e) { nExceptions++; }
#define uart_rx_to_circ_buf(uart_no, circ_buf_ptr)
Receive a byte from UART into circular buffer.
#define uart_tx_from_circ_buf(uart_no, circ_buf_ptr)
Transmit a byte from the circular buffer.
circular_buffer_uint8 * ascii_serial_com_device_get_output_buffer(ascii_serial_com_device *ascd)
ASCII Serial Com Device get output buffer.
void ascii_serial_com_device_receive(ascii_serial_com_device *ascd)
ASCII Serial Com Device receive messages.
circular_buffer_uint8 * ascii_serial_com_device_get_input_buffer(ascii_serial_com_device *ascd)
ASCII Serial Com Device get input buffer.
void ascii_serial_com_device_init(ascii_serial_com_device *ascd, ascii_serial_com_device_config *config)
ASCII Serial Com Device init.
void ascii_serial_com_register_pointers_handle_message(ascii_serial_com *asc, char ascVersion, char appVersion, char command, char *data, size_t dataLen, void *register_pointers_state_vp)
ASCII Serial Com Register Pointers handle message.
void ascii_serial_com_register_pointers_init(ascii_serial_com_register_pointers *register_pointers_state, volatile REGTYPE **pointers, REGTYPE *write_masks, uint16_t n_regs)
ASCII Serial Com Register Pointers init.
ASCII Serial Com Register Pointers.
#define UART_Init(uart_no, ubrr, rxIntEnable)
Initialize USART.
void circular_buffer_init_uint8(circular_buffer_uint8 *circ_buf, const size_t capacity, uint8_t *buffer)
circular buffer init method
uint8_t circular_buffer_pop_front_uint8(circular_buffer_uint8 *circ_buf)
circular buffer pop front
bool circular_buffer_is_empty_uint8(const circular_buffer_uint8 *circ_buf)
circular buffer get if empty
void circular_buffer_push_back_uint8(circular_buffer_uint8 *circ_buf, const uint8_t element)
circular buffer push back
ASCII Serial Com Device Config Struct.
void(* func_rw)(ascii_serial_com *, char, char, char, char *data, size_t, void *)
ASCII Serial Com Device State struct.
ASCII Serial Com Register Pointers State struct.