2 #include "test_UartSpi.h"
4 void UartSpiInit_clocks_SPI_bus_at_5MHz(
void)
11 TEST_ASSERT_EQUAL_HEX8(0, *UartSpi_UBRR0);
13 void UartSpiInit_sets_Sck_as_an_output(
void)
20 TEST_ASSERT_BIT_HIGH_MESSAGE(
21 UartSpi_Sck, *UartSpi_ddr,
"Failed for pin Sck."
24 void UartSpiInit_sets_AdcConv_to_idle_low(
void)
31 TEST_ASSERT_BIT_LOW_MESSAGE(
32 UartSpi_AdcConv, *UartSpi_port,
"Failed for pin AdcConv."
35 void UartSpiInit_sets_AdcConv_as_an_output(
void)
42 TEST_ASSERT_BIT_HIGH_MESSAGE(
43 UartSpi_AdcConv, *UartSpi_ddr,
"Failed for pin AdcConv."
46 void UartSpiInit_enables_the_UART_in_Master_SPI_Mode(
void)
49 *UartSpi_UCSR0C = 0x00;
53 TEST_ASSERT_BIT_HIGH_MESSAGE(
56 "Failed for bit ModeSelect0."
58 TEST_ASSERT_BIT_HIGH_MESSAGE(
61 "Failed for bit ModeSelect1."
64 void UartSpiInit_uses_SPI_data_mode_CPOL_1_CPHA_1(
void)
67 *UartSpi_UCSR0C = 0x00;
71 TEST_ASSERT_BIT_HIGH_MESSAGE(
74 "Failed for bit ClockPolarity."
76 TEST_ASSERT_BIT_HIGH_MESSAGE(
79 "Failed for bit ClockPhase."
82 void UartSpiInit_cfgs_SPI_to_transfer_MSB_first(
void)
85 *UartSpi_UCSR0C = 0xFF;
89 TEST_ASSERT_BIT_LOW_MESSAGE(
92 "Failed for bit DataOrder."
95 void UartSpiInit_gives_SPI_control_over_Miso_and_Mosi_pin_behavior(
void)
98 *UartSpi_UCSR0B = 0x00;
102 TEST_ASSERT_BIT_HIGH_MESSAGE(
105 "Failed for bit RxEnable."
107 TEST_ASSERT_BIT_HIGH_MESSAGE(
110 "Failed for bit TxEnable."