dev/irq #8

Merged
tkl merged 6 commits from dev/irq into master 2020-04-09 08:05:33 +00:00
9 changed files with 24 additions and 24 deletions
Showing only changes of commit 209c09cbf4 - Show all commits

View File

@ -3,7 +3,7 @@
#include <cstdint>
namespace interfaces {
namespace pinetime::interfaces {
class GpioInterface
{

View File

@ -3,7 +3,7 @@
#include <cstdint>
namespace interfaces {
namespace pinetime::interfaces {
class SpiInterface
{

View File

@ -5,7 +5,7 @@
#include "platform/nrf52/gpio.h"
#include "platform/nrf52/spi.h"
namespace hal = platform::nrf52;
namespace hal = pinetime::platform::nrf52;
#endif
#endif

View File

@ -7,7 +7,7 @@ extern "C" {
NRF_GPIO_Type *const GPIO_REGS = reinterpret_cast<NRF_GPIO_Type *>(NRF_P0_BASE);
}
using namespace platform::nrf52;
using namespace pinetime::platform::nrf52;
Gpio::Gpio(uint32_t pin)
: pin_number(pin)

View File

@ -3,9 +3,9 @@
#include "gpio_interface.h"
namespace platform::nrf52 {
namespace pinetime::platform::nrf52 {
class Gpio : public interfaces::GpioInterface
class Gpio : public pinetime::interfaces::GpioInterface
{
public:
inline Gpio() {}

View File

@ -9,9 +9,9 @@ extern "C" {
NRF_SPI_Type *SPI_REGS = reinterpret_cast<NRF_SPI_Type *>(NRF_SPI0_BASE);
}
using namespace platform::nrf52;
using namespace pinetime::platform::nrf52;
Spi::Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, interfaces::GpioInterface & cs)
Spi::Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, pinetime::interfaces::GpioInterface & cs)
: chip_select(cs)
{
assert(instance < 3);

View File

@ -4,12 +4,12 @@
#include "gpio_interface.h"
#include "spi_interface.h"
namespace platform::nrf52 {
namespace pinetime::platform::nrf52 {
class Spi : public interfaces::SpiInterface
class Spi : public pinetime::interfaces::SpiInterface
{
public:
Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, interfaces::GpioInterface & cs);
Spi(uint32_t instance, uint32_t sck, uint32_t mosi, uint32_t miso, pinetime::interfaces::GpioInterface & cs);
~Spi();
void send(const uint8_t * buffer, uint32_t len) override;
void recv(uint8_t * buffer, uint32_t len) override;
@ -17,7 +17,7 @@ public:
private:
uint32_t transfer(uint32_t);
interfaces::GpioInterface & chip_select;
pinetime::interfaces::GpioInterface & chip_select;
};
}

View File

@ -3,10 +3,10 @@
#include "delay.h"
#include "st7789.h"
St7789::St7789(interfaces::SpiInterface & spi_if,
interfaces::GpioInterface & rst,
interfaces::GpioInterface & dc,
interfaces::GpioInterface & bl)
St7789::St7789(pinetime::interfaces::SpiInterface & spi_if,
pinetime::interfaces::GpioInterface & rst,
pinetime::interfaces::GpioInterface & dc,
pinetime::interfaces::GpioInterface & bl)
: spi(spi_if)
, reset(rst)
, data_command(dc)

View File

@ -8,19 +8,19 @@
class St7789
{
public:
St7789(interfaces::SpiInterface &,
interfaces::GpioInterface &,
interfaces::GpioInterface &,
interfaces::GpioInterface &);
St7789(pinetime::interfaces::SpiInterface &,
pinetime::interfaces::GpioInterface &,
pinetime::interfaces::GpioInterface &,
pinetime::interfaces::GpioInterface &);
void init();
void clear(uint16_t Color);
private:
interfaces::SpiInterface & spi;
interfaces::GpioInterface & reset;
interfaces::GpioInterface & data_command;
interfaces::GpioInterface & backlight;
pinetime::interfaces::SpiInterface & spi;
pinetime::interfaces::GpioInterface & reset;
pinetime::interfaces::GpioInterface & data_command;
pinetime::interfaces::GpioInterface & backlight;
void send_cmd(uint8_t);
void send_data(uint8_t);