mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-05-19 23:20:27 -04:00
Formatted code (#1007)
* Updated style * Updated files * fixed new line * Updated spacing * File fix WIP * Updated to clang 13 * updated comment style * Removed old comment code
This commit is contained in:
parent
7aca7ce74d
commit
033c4e9a5b
599 changed files with 70746 additions and 66896 deletions
|
@ -34,37 +34,37 @@ using bit_t = uint_fast8_t;
|
|||
using data_t = uint32_t;
|
||||
|
||||
class SPI {
|
||||
public:
|
||||
enum class Direction {
|
||||
Write = 0,
|
||||
Read = 1,
|
||||
};
|
||||
public:
|
||||
enum class Direction {
|
||||
Write = 0,
|
||||
Read = 1,
|
||||
};
|
||||
|
||||
void init();
|
||||
void init();
|
||||
|
||||
reg_t read(const address_t address) {
|
||||
return transfer_word(Direction::Read, address, 0);
|
||||
}
|
||||
reg_t read(const address_t address) {
|
||||
return transfer_word(Direction::Read, address, 0);
|
||||
}
|
||||
|
||||
void write(const address_t address, const reg_t value) {
|
||||
transfer_word(Direction::Write, address, value);
|
||||
}
|
||||
void write(const address_t address, const reg_t value) {
|
||||
transfer_word(Direction::Write, address, value);
|
||||
}
|
||||
|
||||
private:
|
||||
void select(const bool active);
|
||||
private:
|
||||
void select(const bool active);
|
||||
|
||||
void direction_out();
|
||||
void direction_in();
|
||||
void direction_out();
|
||||
void direction_in();
|
||||
|
||||
void write_bit(const bit_t value);
|
||||
bit_t read_bit();
|
||||
void write_bit(const bit_t value);
|
||||
bit_t read_bit();
|
||||
|
||||
bit_t transfer_bit(const bit_t bit_out);
|
||||
data_t transfer_bits(const data_t data_out, const size_t count);
|
||||
data_t transfer_word(const Direction direction, const address_t address, const data_t data_out);
|
||||
bit_t transfer_bit(const bit_t bit_out);
|
||||
data_t transfer_bits(const data_t data_out, const size_t count);
|
||||
data_t transfer_word(const Direction direction, const address_t address, const data_t data_out);
|
||||
};
|
||||
|
||||
} /* spi */
|
||||
} /* rffc507x */
|
||||
} // namespace spi
|
||||
} // namespace rffc507x
|
||||
|
||||
#endif/*__RFFC507X_SPI_H__*/
|
||||
#endif /*__RFFC507X_SPI_H__*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue