|
STAR
Cal STAR — firmware, DAQ server, and engine design
|
Go to the source code of this file.
Enumerations | |
| enum | board_spi_device_t { BOARD_SPI_IMU = 0 , BOARD_SPI_HIGH_G , BOARD_SPI_BARO , BOARD_SPI_ETH , BOARD_SPI_RADIO , BOARD_SPI_NAND , BOARD_SPI_COUNT } |
| enum | board_spi_status_t { BOARD_SPI_OK = 0 , BOARD_SPI_TIMEOUT , BOARD_SPI_ERROR , BOARD_SPI_NOT_CONFIGURED } |
Functions | |
| bool | board_spi_init (void) |
| bool | board_spi_routed (board_spi_device_t device) |
| uint8_t | board_spi_mode (board_spi_device_t device) |
| uint32_t | board_spi_clock_hz (board_spi_device_t device) |
| board_spi_status_t | board_spi_lock (board_spi_device_t device, uint32_t deadline_ms) |
| void | board_spi_unlock (board_spi_device_t device) |
| board_spi_status_t | board_spi_frame (board_spi_device_t device, const uint8_t *tx, uint8_t *rx, uint16_t len, uint32_t deadline_ms) |
| board_spi_status_t | board_spi_transfer (board_spi_device_t device, const uint8_t *tx, uint8_t *rx, uint16_t len, uint32_t deadline_ms) |
| void | board_spi_select (board_spi_device_t device) |
| void | board_spi_deselect (board_spi_device_t device) |
| board_spi_status_t | board_spi_shift (board_spi_device_t device, const uint8_t *tx, uint8_t *rx, uint16_t len, uint32_t deadline_ms) |
| board_spi_status_t | board_spi_idle_clocks (board_spi_device_t device, uint16_t len, uint32_t deadline_ms) |
| self_test_reply_t | board_spi_self_test_exchange (void *context, uint16_t device_id, uint8_t mode, uint32_t max_hz, self_test_spi_frame_t *frames, uint8_t count, uint32_t budget_ms) |
| enum board_spi_device_t |
| Enumerator | |
|---|---|
| BOARD_SPI_IMU | |
| BOARD_SPI_HIGH_G | |
| BOARD_SPI_BARO | |
| BOARD_SPI_ETH | |
| BOARD_SPI_RADIO | |
| BOARD_SPI_NAND | |
| BOARD_SPI_COUNT | |
Definition at line 26 of file board_spi.h.
| enum board_spi_status_t |
| Enumerator | |
|---|---|
| BOARD_SPI_OK | |
| BOARD_SPI_TIMEOUT | |
| BOARD_SPI_ERROR | |
| BOARD_SPI_NOT_CONFIGURED | |
Definition at line 36 of file board_spi.h.
| uint32_t board_spi_clock_hz | ( | board_spi_device_t | device | ) |
Definition at line 82 of file board_spi.c.
References HAL_RCCEx_GetPeriphCLKFreq(), hspi4, r, RCC_PERIPHCLK_SPI123, RCC_PERIPHCLK_SPI45, route(), SPI_CFG1_MBR, and SPI_CFG1_MBR_Pos.
Referenced by board_spi_self_test_exchange().
| void board_spi_deselect | ( | board_spi_device_t | device | ) |
Definition at line 195 of file board_spi.c.
References GPIO_PIN_SET, HAL_GPIO_WritePin(), r, and route().
Referenced by ms5611_reset(), sd_command(), and sd_read_cid().
| board_spi_status_t board_spi_frame | ( | board_spi_device_t | device, |
| const uint8_t * | tx, | ||
| uint8_t * | rx, | ||
| uint16_t | len, | ||
| uint32_t | deadline_ms ) |
Definition at line 163 of file board_spi.c.
References BOARD_SPI_NOT_CONFIGURED, BOARD_SPI_OK, GPIO_PIN_RESET, GPIO_PIN_SET, HAL_GPIO_WritePin(), r, route(), shift(), and wait_busy_low().
Referenced by board_spi_self_test_exchange(), and board_spi_transfer().
| board_spi_status_t board_spi_idle_clocks | ( | board_spi_device_t | device, |
| uint16_t | len, | ||
| uint32_t | deadline_ms ) |
Definition at line 210 of file board_spi.c.
References BOARD_SPI_NOT_CONFIGURED, GPIO_PIN_SET, HAL_GPIO_WritePin(), NULL, r, route(), and shift().
Referenced by sd_nand_probe().
| bool board_spi_init | ( | void | ) |
Definition at line 56 of file board_spi.c.
References bus_locks, NULL, osMutexNew(), and osMutexPrioInherit.
Referenced by board_bringup_power_up().
| board_spi_status_t board_spi_lock | ( | board_spi_device_t | device, |
| uint32_t | deadline_ms ) |
Definition at line 94 of file board_spi.c.
References board_ms_left(), BOARD_SPI_NOT_CONFIGURED, BOARD_SPI_OK, BOARD_SPI_TIMEOUT, bus_index(), bus_locks, lock, osMutexAcquire(), osOK, r, and route().
Referenced by board_spi_self_test_exchange(), board_spi_transfer(), ms5611_reset(), and sd_nand_probe().
| uint8_t board_spi_mode | ( | board_spi_device_t | device | ) |
Definition at line 73 of file board_spi.c.
References r, route(), SPI_PHASE_2EDGE, and SPI_POLARITY_HIGH.
Referenced by board_spi_self_test_exchange().
| bool board_spi_routed | ( | board_spi_device_t | device | ) |
Definition at line 69 of file board_spi.c.
References route().
Referenced by board_spi_self_test_exchange().
| void board_spi_select | ( | board_spi_device_t | device | ) |
Definition at line 189 of file board_spi.c.
References GPIO_PIN_RESET, HAL_GPIO_WritePin(), r, and route().
Referenced by ms5611_reset(), sd_command(), and sd_read_cid().
| self_test_reply_t board_spi_self_test_exchange | ( | void * | context, |
| uint16_t | device_id, | ||
| uint8_t | mode, | ||
| uint32_t | max_hz, | ||
| self_test_spi_frame_t * | frames, | ||
| uint8_t | count, | ||
| uint32_t | budget_ms ) |
Definition at line 243 of file board_spi.c.
References board_now_ms(), board_spi_clock_hz(), board_spi_frame(), board_spi_lock(), board_spi_mode(), BOARD_SPI_NOT_CONFIGURED, BOARD_SPI_OK, board_spi_routed(), BOARD_SPI_TIMEOUT, board_spi_unlock(), count(), from_self_test(), SELF_TEST_FAIL, SELF_TEST_NOT_CONFIGURED, SELF_TEST_PASS, SELF_TEST_TIMEOUT, and st_reply().
Referenced by board_bringup_power_up().
| board_spi_status_t board_spi_shift | ( | board_spi_device_t | device, |
| const uint8_t * | tx, | ||
| uint8_t * | rx, | ||
| uint16_t | len, | ||
| uint32_t | deadline_ms ) |
Definition at line 201 of file board_spi.c.
References BOARD_SPI_NOT_CONFIGURED, r, route(), and shift().
Referenced by ms5611_reset(), sd_command(), and sd_read_cid().
| board_spi_status_t board_spi_transfer | ( | board_spi_device_t | device, |
| const uint8_t * | tx, | ||
| uint8_t * | rx, | ||
| uint16_t | len, | ||
| uint32_t | deadline_ms ) |
Definition at line 178 of file board_spi.c.
References board_spi_frame(), board_spi_lock(), BOARD_SPI_OK, and board_spi_unlock().
Referenced by anonymous_namespace{radio_task.cpp}::BoardBus::transfer(), and xfer().
| void board_spi_unlock | ( | board_spi_device_t | device | ) |
Definition at line 108 of file board_spi.c.
References bus_index(), bus_locks, osMutexRelease(), r, and route().
Referenced by board_spi_self_test_exchange(), board_spi_transfer(), ms5611_reset(), and sd_nand_probe().