Adjust the LCD display settings

This commit is contained in:
Savanni D'Gerinel 2022-07-26 21:12:11 -04:00
parent ce2a2e98b5
commit c7b5541109
2 changed files with 11 additions and 4 deletions

View File

@ -50,9 +50,9 @@ void status(display_t *display, rfm_t *radio, int clock) {
int main(void) {
display_t display = {
.reg = {
.output = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 7 },
.shift_clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 6 },
.latch_clock = { .ddr = &DDRB, .port = &PORTB, .pin = &PINB, .addr = 5 },
.output = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 7 },
.shift_clock = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 6 },
.latch_clock = { .ddr = &DDRF, .port = &PORTF, .pin = &PINF, .addr = 5 },
},
};
@ -132,8 +132,13 @@ int main(void) {
char msg[16];
snprintf(msg, 15, "[%d]: %d", length, packet[0]);
char msg_2[16];
snprintf(msg_2, 15, "RSSI: %d", rfm_rssi(&radio));
display_clear(&display);
display_write_message(&display, msg);
display_set_location(&display, 1, 0);
display_write_message(&display, msg_2);
_delay_ms(1000);
}

View File

@ -327,14 +327,16 @@ interrupt_flags_t rfm_interrupts(rfm_t *rfm) {
}
uint8_t rfm_rssi(rfm_t *rfm) {
uint8_t rssi_reg;
// uint8_t rssi_reg;
uint8_t rssi_value;
/*
_rfm_write(rfm, REG_RSSI_CONFIG, (uint8_t [1]){ _BV(0) }, 1);
while(!(rssi_reg & _BV(1))) {
_rfm_read(rfm, REG_RSSI_CONFIG, &rssi_reg, 1);
}
*/
_rfm_read(rfm, REG_RSSI_VALUE, &rssi_value, 1);