Firmware Version 1.0.4
This commit is contained in:
parent
18313cc6ae
commit
e13cbda4cc
26 changed files with 794 additions and 256 deletions
37
firmware/MotionControllerRP/src/hardware/spi_interface.h
Normal file
37
firmware/MotionControllerRP/src/hardware/spi_interface.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
// --------------------------------------------------------------------------------------
|
||||
// Project: MicroManipulatorStepper
|
||||
// License: MIT (see LICENSE file for full description)
|
||||
// All text in here must be included in any redistribution.
|
||||
// Author: M. S. (diffraction limited)
|
||||
// --------------------------------------------------------------------------------------
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "hardware/spi.h"
|
||||
#include "hardware/dma.h"
|
||||
#include "hardware/gpio.h"
|
||||
|
||||
//*** CLASS *****************************************************************************
|
||||
|
||||
class SpiDma {
|
||||
public:
|
||||
SpiDma(spi_inst_t* spi, uint sck, uint mosi, uint miso, uint cs);
|
||||
|
||||
void begin(uint32_t baudrate_hz);
|
||||
bool is_busy() const;
|
||||
void transfer(const void* tx_buf, void* rx_buf, size_t bytes);
|
||||
void wait_for_finish();
|
||||
void abort();
|
||||
|
||||
private:
|
||||
spi_inst_t* spi;
|
||||
uint sck, mosi, miso, cs;
|
||||
|
||||
int dma_tx;
|
||||
int dma_rx;
|
||||
dma_channel_config cfg_tx;
|
||||
dma_channel_config cfg_rx;
|
||||
};
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue