2019-06-24 12:52:33 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register a new SPI peripheral.
|
|
|
|
* @param pin_number The pin number of the device's chip select pin.
|
|
|
|
*/
|
2019-06-26 14:46:07 +00:00
|
|
|
void peripheral_register(uint8_t pin_number);
|
2019-06-24 12:52:33 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Allows the device with the given chip select pin to talk on the SPI bus.
|
|
|
|
* @param pin_number The pin number of the chip select pin of the device to allow to talk.
|
|
|
|
*/
|
2019-06-26 14:46:07 +00:00
|
|
|
void peripheral_unsilence(uint8_t pin_number);
|
2019-06-24 12:52:33 +00:00
|
|
|
/**
|
|
|
|
* Stops the device with the given chip select pin from talking on the SPI bus.
|
|
|
|
* @param pin_number The chip-select pin number of the device to stop.
|
|
|
|
*/
|
2019-06-26 14:46:07 +00:00
|
|
|
void peripheral_silence(uint8_t pin_number);
|
2019-06-24 12:52:33 +00:00
|
|
|
/**
|
|
|
|
* Switches the active device from one to another on the SPI bus.
|
|
|
|
* @param pin_number_old The chip-select pin number of the old device to switch out from.
|
|
|
|
* @param pin_number_new The chip-select pin number of the new device to switch in to.
|
|
|
|
*/
|
2019-06-26 14:46:07 +00:00
|
|
|
void peripheral_switch(uint8_t pin_number_old, uint8_t pin_number_new);
|