serial/communication.h
2025-05-02 02:02:08 +02:00

30 lines
598 B
C

//
// Created by nano on 4/26/25.
//
#ifndef COMMS_H
#define COMMS_H
#include <libserialport.h>
#include <stdlib.h>
typedef u_int8_t byte;
void comm_init_communication();
/**
* Initializes the serial communication for the usb -> uart board
*/
void comm_end_communication(struct sp_port *port);
struct sp_port **comm_get_port_list();
void comm_list_serial_ports(struct sp_port **port_list);
void comm_open_port(struct sp_port *port);
int check(enum sp_return result);
void uint8_to_bit_array(byte *bit_array, byte data);
byte bit_array_to_uint8(const byte bit_array[]);
#endif //COMMS_H