|
|
|
@ -56,50 +56,46 @@
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __SAM3X8E__
|
|
|
|
|
|
|
|
|
|
// #include <inttypes.h>
|
|
|
|
|
#include "../../inc/MarlinConfigPre.h"
|
|
|
|
|
|
|
|
|
|
// #include "src/core/macros.h"
|
|
|
|
|
// #include "Configuration.h"
|
|
|
|
|
#include "../../Marlin.h"
|
|
|
|
|
#include "../../inc/MarlinConfig.h"
|
|
|
|
|
#if ENABLED(DOGLCD)
|
|
|
|
|
|
|
|
|
|
#include <U8glib.h>
|
|
|
|
|
#include <U8glib.h>
|
|
|
|
|
|
|
|
|
|
#define SPI_FULL_SPEED 0
|
|
|
|
|
#define SPI_HALF_SPEED 1
|
|
|
|
|
#define SPI_QUARTER_SPEED 2
|
|
|
|
|
#define SPI_EIGHTH_SPEED 3
|
|
|
|
|
#define SPI_SIXTEENTH_SPEED 4
|
|
|
|
|
#define SPI_SPEED_5 5
|
|
|
|
|
#define SPI_SPEED_6 6
|
|
|
|
|
#include "../../Marlin.h"
|
|
|
|
|
|
|
|
|
|
void spiBegin();
|
|
|
|
|
void spiInit(uint8_t spiRate);
|
|
|
|
|
void spiSend(uint8_t b);
|
|
|
|
|
void spiSend(const uint8_t* buf, size_t n);
|
|
|
|
|
#define SPI_FULL_SPEED 0
|
|
|
|
|
#define SPI_HALF_SPEED 1
|
|
|
|
|
#define SPI_QUARTER_SPEED 2
|
|
|
|
|
#define SPI_EIGHTH_SPEED 3
|
|
|
|
|
#define SPI_SIXTEENTH_SPEED 4
|
|
|
|
|
#define SPI_SPEED_5 5
|
|
|
|
|
#define SPI_SPEED_6 6
|
|
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include "../../core/macros.h"
|
|
|
|
|
#include "fastio_Due.h"
|
|
|
|
|
void spiBegin();
|
|
|
|
|
void spiInit(uint8_t spiRate);
|
|
|
|
|
void spiSend(uint8_t b);
|
|
|
|
|
void spiSend(const uint8_t* buf, size_t n);
|
|
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include "fastio_Due.h"
|
|
|
|
|
|
|
|
|
|
void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) {
|
|
|
|
|
void u8g_SetPIOutput_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index) {
|
|
|
|
|
PIO_Configure(g_APinDescription[u8g->pin_list[pin_index]].pPort, PIO_OUTPUT_1,
|
|
|
|
|
g_APinDescription[u8g->pin_list[pin_index]].ulPin, g_APinDescription[u8g->pin_list[pin_index]].ulPinConfiguration); // OUTPUT
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void u8g_SetPILevel_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index, uint8_t level) {
|
|
|
|
|
void u8g_SetPILevel_DUE_hw_spi(u8g_t *u8g, uint8_t pin_index, uint8_t level) {
|
|
|
|
|
volatile Pio* port = g_APinDescription[u8g->pin_list[pin_index]].pPort;
|
|
|
|
|
uint32_t mask = g_APinDescription[u8g->pin_list[pin_index]].ulPin;
|
|
|
|
|
if (level) port->PIO_SODR = mask;
|
|
|
|
|
else port->PIO_CODR = mask;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr)
|
|
|
|
|
{
|
|
|
|
|
uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void *arg_ptr)
|
|
|
|
|
{
|
|
|
|
|
switch(msg)
|
|
|
|
|
{
|
|
|
|
|
case U8G_COM_MSG_STOP:
|
|
|
|
@ -158,6 +154,8 @@
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif // DOGLCD
|
|
|
|
|
|
|
|
|
|
#endif //__SAM3X8E__
|
|
|
|
|