CuVoodoo STM32F1 firmware template
|
library to communicate using microwore as master (code) More...
Go to the source code of this file.
Macros | |
#define | MICROWIRE_MASTER_SDO_PORT A |
SDO output signal port (to be connected on D slave signal) | |
#define | MICROWIRE_MASTER_SDO_PIN 0 |
SDO output signal pin (to be connected on D slave signal) | |
#define | MICROWIRE_MASTER_SDI_PORT A |
SDO input signal port (to be connected on Q slave signal) | |
#define | MICROWIRE_MASTER_SDI_PIN 2 |
SDO input signal pin (to be connected on Q slave signal) | |
#define | MICROWIRE_MASTER_SCK_PORT A |
SCK output signal port (to be connected on C slave signal) | |
#define | MICROWIRE_MASTER_SCK_PIN 4 |
SCK output signal pin (to be connected on C slave signal) | |
#define | MICROWIRE_MASTER_TIMER 4 |
timer peripheral | |
Functions | |
void | microwire_master_setup (uint32_t frequency, bool organization_x16, uint8_t address_size) |
setup microwire peripheral More... | |
static void | microwire_master_wait_clock (void) |
wait for clock tick used to synchronise communication | |
static void | microwire_master_send_bit (bool bit) |
send bit over microwire More... | |
static void | microwire_master_start (uint8_t operation, uint32_t address) |
initialize microwire communication and send header (with leading start bit '1') More... | |
static void | microwire_master_stop (void) |
stop microwire communication and end all activities | |
static bool | microwire_master_read_bit (void) |
read bit from microwire communication More... | |
void | microwire_master_read (uint32_t address, uint16_t *data, size_t length) |
read data from slave memory More... | |
void | microwire_master_write_enable (void) |
enable write and erase operations More... | |
void | microwire_master_write_disable (void) |
disable write and erase operations More... | |
void | microwire_master_write (uint32_t address, uint16_t data) |
write data to slave memory More... | |
void | microwire_master_wait_ready (void) |
wait until slave is ready after a write or erase | |
void | microwire_master_erase (uint32_t address) |
erase memory More... | |
void | microwire_master_erase_all (void) |
erase all memory More... | |
void | microwire_master_write_all (uint16_t data) |
write data to all slave memory More... | |
Variables | |
uint8_t | mirowire_master_address_size = 0 |
address size used in operations (slave specific) | |
bool | mirowire_master_organization_x16 = true |
organization used (true=x16, false=x8) | |
library to communicate using microwore as master (code)
Definition in file microwire_master.c.
void microwire_master_erase | ( | uint32_t | address | ) |
erase memory
[in] | address | memory address of data to read |
Definition at line 275 of file microwire_master.c.
void microwire_master_erase_all | ( | void | ) |
erase all memory
Definition at line 286 of file microwire_master.c.
void microwire_master_read | ( | uint32_t | address, |
uint16_t * | data, | ||
size_t | length | ||
) |
read data from slave memory
[in] | address | memory address of data to read |
[out] | data | array to store read data |
[in] | length | number of data bytes/words to read |
Definition at line 186 of file microwire_master.c.
|
static |
read bit from microwire communication
Definition at line 177 of file microwire_master.c.
|
static |
send bit over microwire
[in] | bit | bit to send (true = '1', false = '0') |
Definition at line 106 of file microwire_master.c.
void microwire_master_setup | ( | uint32_t | frequency, |
bool | organization_x16, | ||
uint8_t | address_size | ||
) |
setup microwire peripheral
[in] | frequency | clock frequency in Hz |
[in] | organization_x16 | if x16 memory organization (16-bits) is used, or x8 (8-bits) |
[in] | address_size | address size in bits |
Definition at line 60 of file microwire_master.c.
|
static |
initialize microwire communication and send header (with leading start bit '1')
[in] | operation | operation code to send (2 bits) |
[in] | address | slave memory address to select |
Definition at line 123 of file microwire_master.c.
void microwire_master_write | ( | uint32_t | address, |
uint16_t | data | ||
) |
write data to slave memory
[in] | address | memory address of data to read |
[in] | data | byte/word to write |
Definition at line 237 of file microwire_master.c.
void microwire_master_write_all | ( | uint16_t | data | ) |
write data to all slave memory
[in] | data | byte/word to write |
Definition at line 297 of file microwire_master.c.
void microwire_master_write_disable | ( | void | ) |
disable write and erase operations
Definition at line 226 of file microwire_master.c.
void microwire_master_write_enable | ( | void | ) |
enable write and erase operations
Definition at line 215 of file microwire_master.c.