File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ export class AVRSPI {
50
50
enableMask : SPCR_SPIE ,
51
51
} ;
52
52
53
- constructor ( private cpu : CPU , private config : SPIConfig , private freqMHz : number ) {
53
+ constructor ( private cpu : CPU , private config : SPIConfig , private freqHz : number ) {
54
54
const { SPCR , SPSR , SPDR } = config ;
55
55
cpu . writeHooks [ SPDR ] = ( value : u8 ) => {
56
56
if ( ! ( cpu . data [ SPCR ] & SPCR_SPE ) ) {
@@ -130,6 +130,6 @@ export class AVRSPI {
130
130
* In slave mode, the frequency can be as high as F(osc) / 4.
131
131
*/
132
132
get spiFrequency ( ) {
133
- return this . freqMHz / this . clockDivider ;
133
+ return this . freqHz / this . clockDivider ;
134
134
}
135
135
}
Original file line number Diff line number Diff line change @@ -104,7 +104,7 @@ export class AVRTWI {
104
104
enableMask : TWCR_TWIE ,
105
105
} ;
106
106
107
- constructor ( private cpu : CPU , private config : TWIConfig , private freqMHz : number ) {
107
+ constructor ( private cpu : CPU , private config : TWIConfig , private freqHz : number ) {
108
108
this . updateStatus ( STATUS_TWI_IDLE ) ;
109
109
this . cpu . writeHooks [ config . TWCR ] = ( value ) => {
110
110
this . cpu . data [ config . TWCR ] = value ;
@@ -149,7 +149,7 @@ export class AVRTWI {
149
149
}
150
150
151
151
get sclFrequency ( ) {
152
- return this . freqMHz / ( 16 + 2 * this . cpu . data [ this . config . TWBR ] * this . prescaler ) ;
152
+ return this . freqHz / ( 16 + 2 * this . cpu . data [ this . config . TWBR ] * this . prescaler ) ;
153
153
}
154
154
155
155
completeStart ( ) {
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ export class AVRUSART {
87
87
enableMask : UCSRB_TXCIE ,
88
88
} ;
89
89
90
- constructor ( private cpu : CPU , private config : USARTConfig , private freqMHz : number ) {
90
+ constructor ( private cpu : CPU , private config : USARTConfig , private freqHz : number ) {
91
91
this . reset ( ) ;
92
92
this . cpu . writeHooks [ config . UCSRA ] = ( value ) => {
93
93
cpu . data [ config . UCSRA ] = value ;
@@ -142,7 +142,7 @@ export class AVRUSART {
142
142
}
143
143
144
144
get baudRate ( ) {
145
- return Math . floor ( this . freqMHz / ( this . multiplier * ( 1 + this . UBRR ) ) ) ;
145
+ return Math . floor ( this . freqHz / ( this . multiplier * ( 1 + this . UBRR ) ) ) ;
146
146
}
147
147
148
148
get bitsPerChar ( ) {
You can’t perform that action at this time.
0 commit comments