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> #include <cstdint>
namespace interfaces { namespace pinetime::interfaces {
class GpioInterface class GpioInterface
{ {

View File

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

View File

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

View File

@ -7,7 +7,7 @@ extern "C" {
NRF_GPIO_Type *const GPIO_REGS = reinterpret_cast<NRF_GPIO_Type *>(NRF_P0_BASE); 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) Gpio::Gpio(uint32_t pin)
: pin_number(pin) : pin_number(pin)

View File

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

View File

@ -9,9 +9,9 @@ extern "C" {
NRF_SPI_Type *SPI_REGS = reinterpret_cast<NRF_SPI_Type *>(NRF_SPI0_BASE); 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) : chip_select(cs)
{ {
assert(instance < 3); assert(instance < 3);

View File

@ -4,12 +4,12 @@
#include "gpio_interface.h" #include "gpio_interface.h"
#include "spi_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: 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(); ~Spi();
void send(const uint8_t * buffer, uint32_t len) override; void send(const uint8_t * buffer, uint32_t len) override;
void recv(uint8_t * buffer, uint32_t len) override; void recv(uint8_t * buffer, uint32_t len) override;
@ -17,7 +17,7 @@ public:
private: private:
uint32_t transfer(uint32_t); uint32_t transfer(uint32_t);
interfaces::GpioInterface & chip_select; pinetime::interfaces::GpioInterface & chip_select;
}; };
} }

View File

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

View File

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