sw: initial commit of mvp test

This version of the test runs end-to-end, and should be
mostly feature complete.

Signed-off-by: Sean Cross <sean@xobs.io>
This commit is contained in:
2019-05-23 17:07:55 +08:00
parent 5ff6153b53
commit 6d8875850c
5 changed files with 291 additions and 51 deletions

View File

@ -1,5 +1,5 @@
//--------------------------------------------------------------------------------
// Auto-generated by Migen (bc90344) & LiteX (3a72688b) on 2019-05-22 22:55:33
// Auto-generated by Migen (bc90344) & LiteX (3a72688b) on 2019-05-23 14:16:56
//--------------------------------------------------------------------------------
#ifndef __GENERATED_CSR_H
#define __GENERATED_CSR_H
@ -188,9 +188,9 @@ static inline unsigned char rgb_bypass_read(void) {
static inline void rgb_bypass_write(unsigned char value) {
csr_writel(value, 0xe000680cL);
}
#define CSR_RGB_PWM_COUNT_ADDR 0xe0006810L
#define CSR_RGB_PWM_COUNT_SIZE 3
static inline unsigned int rgb_pwm_count_read(void) {
#define CSR_RGB_PULSE_ADDR 0xe0006810L
#define CSR_RGB_PULSE_SIZE 3
static inline unsigned int rgb_pulse_read(void) {
unsigned int r = csr_readl(0xe0006810L);
r <<= 8;
r |= csr_readl(0xe0006814L);
@ -198,33 +198,48 @@ static inline unsigned int rgb_pwm_count_read(void) {
r |= csr_readl(0xe0006818L);
return r;
}
static inline void rgb_pwm_count_write(unsigned int value) {
static inline void rgb_pulse_write(unsigned int value) {
csr_writel(value >> 16, 0xe0006810L);
csr_writel(value >> 8, 0xe0006814L);
csr_writel(value, 0xe0006818L);
}
#define CSR_RGB_SENT_PULSES_ADDR 0xe000681cL
#define CSR_RGB_SENT_PULSES_SIZE 4
static inline unsigned int rgb_sent_pulses_read(void) {
#define CSR_RGB_DUTY_ADDR 0xe000681cL
#define CSR_RGB_DUTY_SIZE 3
static inline unsigned int rgb_duty_read(void) {
unsigned int r = csr_readl(0xe000681cL);
r <<= 8;
r |= csr_readl(0xe0006820L);
r <<= 8;
r |= csr_readl(0xe0006824L);
r <<= 8;
r |= csr_readl(0xe0006828L);
return r;
}
#define CSR_RGB_DETECTED_PULSES_ADDR 0xe000682cL
#define CSR_RGB_DETECTED_PULSES_SIZE 4
static inline unsigned int rgb_detected_pulses_read(void) {
unsigned int r = csr_readl(0xe000682cL);
static inline void rgb_duty_write(unsigned int value) {
csr_writel(value >> 16, 0xe000681cL);
csr_writel(value >> 8, 0xe0006820L);
csr_writel(value, 0xe0006824L);
}
#define CSR_RGB_SENT_PULSES_ADDR 0xe0006828L
#define CSR_RGB_SENT_PULSES_SIZE 4
static inline unsigned int rgb_sent_pulses_read(void) {
unsigned int r = csr_readl(0xe0006828L);
r <<= 8;
r |= csr_readl(0xe000682cL);
r <<= 8;
r |= csr_readl(0xe0006830L);
r <<= 8;
r |= csr_readl(0xe0006834L);
return r;
}
#define CSR_RGB_DETECTED_PULSES_ADDR 0xe0006838L
#define CSR_RGB_DETECTED_PULSES_SIZE 4
static inline unsigned int rgb_detected_pulses_read(void) {
unsigned int r = csr_readl(0xe0006838L);
r <<= 8;
r |= csr_readl(0xe0006838L);
r |= csr_readl(0xe000683cL);
r <<= 8;
r |= csr_readl(0xe0006840L);
r <<= 8;
r |= csr_readl(0xe0006844L);
return r;
}

View File

@ -160,6 +160,11 @@ struct usb_cdc_notification {
int cdc_connected();
void cdc_set_connected(int is_connected);
void put_hex(uint32_t val);
void put_hex_byte(uint8_t val);
void put_string(const char *str);
void put_char(char character);
void flush_serial(void);
#endif