skullc-peripherals/Peripherals/Inc/peripherals_serial.hpp
Erki ed1509809e
All checks were successful
continuous-integration/drone/push Build is passing
Remake folder structure, add messaging library start
2021-03-27 16:51:04 +02:00

36 lines
665 B
C++

/*
* peripherals_serial.hpp
*
* Created on: Mar 22, 2021
* Author: erki
*/
#ifndef SKULLC_PERIPHERALS_SERIAL_HPP_
#define SKULLC_PERIPHERALS_SERIAL_HPP_
#include <cstdint>
namespace Peripherals
{
template<typename HT, HT* Handle,
void (*tx_function)(HT*, char*, std::uint32_t),
void (*rx_function)(HT*, char*, std::uint32_t)>
struct SerialPeripheral
{
void transmit(char* data, const std::uint32_t data_length)
{
tx_function(handle, data, data_length);
}
void receive(char* output, const std::uint32_t data_length)
{
rx_function(handle, data, data_length);
}
};
}
#endif /* SKULLC_PERIPHERALS_SERIAL_HPP_ */